[OpenLayers-Users] Adjusting map zoom to google max zoom level

Nuno Magalhães nuno.magalhaes at inov.pt
Thu Jan 31 01:31:09 PST 2013


After some research I found this Google API function:

maxZoomService.getMaxZoomAtLatLng(e.latLng, function(response) {
  if (response.status != google.maps.MaxZoomStatus.OK) {
    alert('Error in MaxZoomService');
    return;
  }
  else {
    alert('The maximum zoom at this location is: ' + response.zoom + '\nThe
current zoom is: ' + map.getZoom());
  }
  map.panTo(e.latLng);
}

What I've noticed is that in some locations, here at my country, the maximum
zoom (with google maps) is 20 and the current zoom will not go beyond 19.
But for some reason openlayers seems to force a zoom where google won't
zoom. Has anyone experienced this?
Try this coordinates {"lon":-7.9705713624915,"lat":37.018937478431} at
openlayers zoom 20. You'll notice that map will pan slower than markers and
vector data, at zoom 20, which will result in incorrect graphical display at
this zoom level.

Is this normal? Can someone help me?

Regards,
Nuno Magalhães.




--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Adjusting-map-zoom-to-google-max-zoom-level-tp5030969p5031137.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list