If you want more than one marker, then you should use a createMarker()
function to hold context on the relevant variables.
Unless you've got a really good reason for using double click, I'd
recommend using single clicks. Use map:click to create a marker, and
have <input type="button" value="Delete" onclick="deleteLastMarker()" />
at the bottom of the info window.
Store a global copy of the "marker" variable when the info window opens.
GEvent.addListener(marker, "click", function(){
lastMarker = marker;
marker.openInfoWindowHtml('LatLng: ' + marker.getLatLng()
+'<input type="button" value="Delete" onclick="deleteLastMarker()" />'
);
});
function deleteLastMarker() {
map.closeInfoWindow();
map.removeOverlay(lastMarker);
}
Your "map" variable will also need to be global.
[All this is untested, so you might have to tweak it a bit.]
--
http://econym.org.uk/gmap
The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---