Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was trying to obtain maximum zoom level ( level 22) for Google street map using script.

The following code does not seem to work.It works to the maximum zoom level when Var zoom is set to 15. below or above 15, it set centre to world extent.

Any idea what went wrong ? we tried using Google maps API v2 and v3 , same result for Maxm zoom, except for value = 15.

var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection); var zoom = 22; map.setCenter(position, zoom);

share|improve this question

You need to configure your Google layer with an appropriate numZoomLevels value, and also override the internal default for the maximum zoom level with MAX_ZOOM_LEVEL. The latter will cause unexpected behavior if the Google layer does not support all zoom levels.

new OpenLayers.Layer.Google('Satellite', {
    type: google.maps.MapTypeId.SATELLITE,
    numZoomLevels: 23,
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.