Hi,
I would like to click on a marker and get the marker position then
cetered in the map and zoomed in.
For creating the marker I am using the code of Mike:
// A function to create the marker and set up the event window
function createMarker(point,name,html) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
});
I hoped to get a zoom-in by asking for the LatLng of the marker and
using this information to setup the map.setCenter function.
Unfortunately it didn't work out
// A function to create the marker and set up the event window
function createMarker(point,name,html) {
var marker = new GMarker(point);
var mLatLng = "";
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(html);
marker.getLatLng(mLatLng);
map.setCenter(new GLatLng(mLatLng), 16);
});
I hope you get what I want to do. The code is probably horrible
wrong...
Thomas
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---