Hi All,

another newby question regarding getBounds().
The code below, using maps API v3, fails, saying "bounds is
undefined". The code:

                var latlng = new google.maps.LatLng(47, 19);
                var myOptions = {
                        zoom: 15,
                        center: latlng,
                        mapTypeId: google.maps.MapTypeId.ROADMAP
                        };
                var map = new google.maps.Map(document.getElementById("map"),
myOptions);

                        var bounds = map.getBounds();
                        var southWest = bounds.getSouthWest();
                        var northEast = bounds.getNorthEast();
                        var lngSpan = northEast.lng() - southWest.lng();
                        var latSpan = northEast.lat() - southWest.lat();
                        // var distance =
                        alert('Delta Lat: '+latSpan+'; Delta Lon: '+lngSpan);

Any idea, why?

Thanks in advance,

regards
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to