Hey Guys,
I've got the following onClick function...
GEvent.addListener(map, "click", function(overlay, latLng)
{
if (latLng) {
marker = new GMarker(latLng, {draggable:true});
marker.openInfoWindowHtml(mes);
}
// display the lat/lng in your form's lat/lng fields
document.getElementById("lat").value = latLng.lat();
document.getElementById("lng").value = latLng.lng();
});
basically I want to make it so only a marker shows on the most recent click. I've been looking at this question http://stackoverflow.com/questions/1409939/googlemaps-removing-previous-marker but can't really figure out how I'd apply that to my code. could someone help me out?
Thanks.