Hi All,
The map.getBounds function seems not be able to return the correct
lat&lng
here is my test:
I set the map center to Sydney with lat:-32.7780379853637 and lng:
151.652526855469
Test1: set the map zoom to 2,
lat<34.88593094075317 and lat>-72.3957057065326 and lng<41.1328125 and
lng>-97.38281250000001
I can see the whole Australia on the map, but the longitude
151.65xxxx(Sydney) is out of the range of the lng return by
getBounds()
Test2: set the map zoom to 5
lat<-24.96614015991296 and lat>-40.078071427450084 and lng<165.5859375
and lng>137.900390625
zoom 5 got a wider lng range than zoom 3? that's ridiculous (pls
notice lng<165.58xxx in zoom 5 and the lng<41.132xxx in zoom 2)
Enclosed my code how i calculate the lats and lngs from getBounds()
-------------------------------------------------------------------------------
var nePoint = map.getBounds().getNorthEast();
var maxLat = nePoint.lat();
var maxLng = nePoint.lng();
var swPoint = map.getBounds().getSouthWest();
var minLat = swPoint.lat();
var minLng = swPoint.lng();
if (maxLat < minLat) {
maxLat = swPoint.lat();
minLat = nePoint.lat();
}
if (maxLng < minLng) {
maxLng = swPoint.lng();
minLng = nePoint.lng();
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---