I am using the map demo in my app. Now, I added some markers and I want that when you tap in them, the infowindow opens.
In my desktop browser it works. But on my cellphone, doesn’t. I know that the “problem” is this part in the demo:
// Stop the side bar from dragging when mousedown/tapdown on the map
google.maps.event.addDomListener(document.getElementById('map'), 'mousedown', function(e) {
e.preventDefault();
return false;
});
because I am attaching an event to each of my markers using mousedown
too. How can I do that and still stop the side bar from dragging?
Also, I don’t know why if I comment the preventDefault
part my first marker opens well, but my second doesn’t.
Here is a Pen with my code.
Thanks!