Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For posterity, you want to disable a bunch of events on the marker pop-up dom, this was the prescribed method, even though it feels like overkill. You could alternatively cycle through all the markers present apart from the one clicked and disable clicking on them (actually that's probably a better solution in hindsight). Depends on how many markers you have perhaps, I had <em>a lot</em>.</p> <p>Something <em>like</em> this (transcribed here without testing from my coffeescript so...)</p> <pre><code>// All in a google.maps.OverlayView subclass. ... this.listeners = new Array(); // save listeners for unbinding later ... this.cancelEvents = function(){ events = ['mousedown', 'mousemove', 'mouseover', 'mouseout', 'mouseup', 'mousewheel', 'DOMMouseScroll', 'touchstart', 'touchend', 'touchmove', 'dblclick', 'contextmenu']; // Note, don't disable 'click' if you want to be able to click links in the dom. Some things we're disabling here will can effect how your user might interact with the popup (double click to select text etc) for(var i = 0; i &lt; events.length; i++){ var event = events[i]; this.listeners.push( google.maps.event.addDomListener( this.popup_dom_element, event, function(ev){ e.cancelBubble = true; if(e.stopPropagation){ e.stopPropagation(); } } ); ); } } this.onAdd = function (){ // build your html popup var html_code = "..."; // easy way to get a dom element but probably over kill if its your only JQ this.popup_dom_element = $(html_code); this.cancelEvents(); } this.onRemove = function(){ // any other removal code you have ... for(var i = 0; i &lt; this.listeners.length; i++){ // remove our event listeners google.maps.event.removeListener(this.listeners[i]); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload