Ionic map demo: touch events


#1

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!


#2

see this Google Maps Info Box works fine in browser but fails in emulator


#3

I think using that is the same that the e.preventDefault() and didn’t help me…


#4

it is not the same… and your sample doesnt reflect the change suggested


#5

Sorry, I was really busy the lasts days. Here is an upadted Pen: http://codepen.io/matiastucci/pen/Fhdmg

Thanks!