Rather than doing this:
map.setZoom(map.getBoundsZoomLevel(bounds));
you need to evaluate it
var zoom1 = map.getBoundsZoomLevel(bounds)
and also evaluate the maptype.getMaxZoomAtLatLng. The syntax is
something like this:
map.getCurrentMaptype().getMaxZoomAtLatLng(bounds.getCenter(),function(
reply) {
var zoom1 = map.getBoundsZoomLevel(bounds)
if (reply.status == 200) {
var zoom2 = reply.zoom;
} else {
var zoom2 = map.getCurrentMaptype().getMaximumResolution();
}
if (zoom1<zoom2) {
map.setZoom(zoom1)
} else {
map.setZoom(zoom2)
}
});
I assume that "map" and "bounds" are either global variables or held in
scope by Function Closure. If not, take appropriate action to get them
into scope.
--
Mike Williams
http://econym.org.uk/gmap
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---