Hi, I have a problem using Google Earth complement and
GEvent.addListener.
I have a page that consists in a map with a form. When the user clicks
on any part of the map, a marker is created, and 2 inputs of the form
are filled with the Lat Lng information of the marker, it works fine,
here is the code:
if (GBrowserIsCompatible()) {
var map = new google.maps.Map2(document.getElementById("mapa"));
map.setCenter(new google.maps.LatLng(42.33989,-7.866),13);
map.addMapType(G_SATELLITE_3D_MAP);
map.addControl(new google.maps.HierarchicalMapTypeControl());
map.addControl(new google.maps.LargeMapControl());
var point = new google.maps.Point (-7.866,42.33989);
var marker = new google.maps.Marker(point);
map.addOverlay(marker);
GEvent.addListener(map, "click", function (overlay,point){
if (point){
marker.setPoint(point);
document.formulario.lat.value=point.y
document.formulario.lng.value=point.x
}
});
}
Like you see. I'm using the Google Earth complement map.addMapType
(G_SATELLITE_3D_MAP);
What I'm trying to do, is do the same with the G_SATELLITE_3D_MAP.
Because when I change the map type to G_SATELLITE_3D_MAP, when I click
in any part of the map a marker is not created neither the 2 inputs
are filled with any information.
Could somebody tell me, how to adapt my code to work as the same way
in GMaps and GEarth?
Thanks for your time.
Regards.
Javier.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---