Dear Group,
I am totally lost, I almost read every related thread in this group
but my script stil doesn't work.
I create a marker by clicking one the map, a info window pops up and
inside is a link that allows you to remove the marker again.
I tried everything, but the script don't work. Online example is at
http://www.variouselmts.com/happytrees/
Code:
var markers = new Array();
var counter = 0;
google.load("maps", "2");
// Call this function when the page has been loaded
function initialize() {
var map = new
google.maps.Map2(document.getElementById("map"));
map.addControl(new GMapTypeControl());
map.addControl(new GLargeMapControl());
map.setCenter(new google.maps.LatLng(40.717079, -73.98571),
12);
map.setMapType(G_SATELLITE_MAP);
map.enableScrollWheelZoom();
GEvent.addListener(map, "click", function(overlay, latlng) {
counter++;
var marker = new GMarker(latlng, {title: counter,
draggable: true});
markers[counter] = marker;
var markerbox = "
, function() {
marker.openInfoWindowHtml(markerbox);
});
map.addOverlay(marker);
marker.openInfoWindowHtml(markerbox);
});
};
google.setOnLoadCallback(initialize);
Reply to this question