I want to create a marker at center of map when my user clicks on some
link (say: "Add New marker") << OUTSIDE >> the map.
This marker should be draggable.
-----------------------------------------------------------------------------
GEvent.addListener(map, 'click', function(overlay, point) {
var marker = new GMarker(point, {draggable: true});
var html = "Some text";
GEvent.addListener(marker, "dragstart", function() {
map.closeInfoWindow();
});
GEvent.addListener(marker, "dragend", function(point) {
var lat_new = point.lat();
var lng_new = point.lng();
var html_new = "Some new text";
marker.openInfoWindowHtml(html_new);
});
GEvent.addListener(marker, 'click', function() {
marker.openInfoWindowHtml(html);
});
map.addOverlay(marker);
});
-----------------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---