[OpenLayers-Users] maximum ZoomLevel for google maps

Arnd Wippermann arnd.wippermann at web.de
Wed Nov 26 13:42:51 EST 2008


Hi Rodolfo,

the patch from the old post is really not needed and there are only 21
zoomlevels for Wuppertal. 

Looking now at the question with a better understanding of OpenLayers, I
see, that I have only to set the numZoomLevels for the map object and
MAX_ZOOM_LEVEL for the Google layers. 

The default values are

MAX_ZOOM_LEVEL = 19
numZoomLevels  = 16

With the set

MAX_ZOOM_LEVEL = 21      (0 - 21 => 22 numZoomLevels)
numZoomLevels  = 21+1

i can get the result without any patch.


var maxZOOMLEVEL = 21;

map = new OpenLayers.Map('map',
{ 
    maxExtent: new
OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),
    numZoomLevels: maxZOOMLEVEL+1,
    maxResolution: 156543.0399,
    units: 'm',
    projection: new OpenLayers.Projection("EPSG:900913")
});

var gsat = new OpenLayers.Layer.Google(
    "Google Satellite",
    {type: G_SATELLITE_MAP, sphericalMercator : true, MAX_ZOOM_LEVEL :
maxZOOMLEVEL}
);

At http://gis.ibbeck.de/ginfo/ you can zoom up to 21 zoomlevels.

I hope, that helps.

Arnd Wippermann




More information about the Users mailing list