I got it working with this code, if anyone have the same question:

        google.maps.event.addListener(map, 'zoom_changed', function()
{
        zoom = map.getZoom();
        if(zoom>12) {
         map.setMapTypeId(google.maps.MapTypeId.SATELLITE);
         google.maps.event.addListener(map, 'click', function(event) {
         myLatLng = event.latLng;
         oLat = document.getElementById("lat");
         oLat.value = myLatLng.lat();
             oLon = document.getElementById("lon");
             oLon.value = myLatLng.lng();
         });

        } else {

         map.setMapTypeId(google.maps.MapTypeId.ROADMAP);

        }
        });

Pil: The code is not working if I put the var in front of the
variables.

Jesper

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to