I am creating a google map mashup (v3) where there is a map listener for the click event.
google.maps.event.addListener(map, 'click', function(event) {addMarker(event)});
This click event on the map creates a new marker. However, I also create an OverlayView (in the floatPane of the google map) using the jQuery button when the marker is clicked.
markerDialogOverlay.prototype.onAdd = function() { var divToAdd = document.createElement('div'); divToAdd.id = 'markerHelper'; divToAdd.title = 'Edit Marker'; this.div = divToAdd; var panes = this.getPanes(); panes.floatPane.appendChild(this.div); this.jqdiv = $('#markerHelper'); this.jqdiv.empty(); } markerDialogOverlay.prototype.draw = function() { overlayProjection = this.getProjection(); var posxy = overlayProjection.fromLatLngToDivPixel(this.marker.getPosition()); this.jqdiv.css({ 'z-index': '1', 'left': posxy.x + 'px', 'top': posxy.y + 'px', 'position' : 'absolute'}); this.jqdiv.append($('<button id="deleteMarker">Delete</button>').button().click(function(){deleteLocation(this.marker)}).hide().fadeIn('slow')); }
After clicking the jQuery button, the jQuery button click event and the google map click event are fired, but I want only the jQuery button to click.
I still want to enable the map click event, not where the OverlayView div is located. Any ideas on how to get around this?
jquery google-maps google-maps-api-3
Evan Siroky
source share