RichMarker for Google Maps v3 - Click falls through marker

前端 未结 2 511
醉话见心
醉话见心 2020-12-21 08:12

I am using RichMarker for Google Maps v3 as found at https://googlemaps.github.io/js-rich-marker/reference.html

I have successfully been able to register clicking on

相关标签:
2条回答
  • 2020-12-21 09:07
    google.maps.event.addListener(richMarker, 'click', function(event) 
    {
        // your stuff here
    
        event.preventDefault();
        event.stopPropagation();
        event.preventDefault();
    });
    
    0 讨论(0)
  • 2020-12-21 09:09

    You'll need to modify the library.

    Find this part:

    google.maps.event.addDomListener(this.markerContent_, 'click',   function(e) {
      google.maps.event.trigger(that, 'click');
    });
    

    and change it to

    google.maps.event.addDomListener(this.markerContent_, 'click', function(e) {
      e.stopPropagation();
      google.maps.event.trigger(that, 'click');
    });
    
    0 讨论(0)
提交回复
热议问题