fixed wrong marker display behaviour

I put the display of the map markers and the setup of the info pop-ups
in own scopes that the promises work correctly