Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I set up a MapServer (WMS) with a raster basemap like this (Mapfile):

MAP
  PROJECTION
   "init=epsg:900913"
  END
  WEB
    METADATA
      "wms_title" "mymap"
      "wms_srs" "epsg:900913"
    END
  END
  LAYER
    METADATA
      "wms_title" "myraster"
      "wms_srs" "epsg:900913"
      "wms_enable_request" "*"
    END
    PROJECTION
     "init=epsg:900913"
    END
    NAME         myraster
    DATA         "/path/to/myraster.tif"
    STATUS       ON
    TYPE         RASTER
    PROCESSING   "BANDS=1,2,3"
    OFFSITE      0 0 0
  END 
END

Now I display this map with OpenLayers:

var mylayer = new OpenLayers.Layer.WMS( "My Map", "http://127.0.0.1/cgi-bin/mapserv?map=/path/to/mymapfile.map", {layers:'myraster'} );

That works fine so far. However, there seems to be a limit of 16 zoom levels and I would like to be able to zoom in deeper than that. I tried to add the option numZoomLevels:22 but that did not have any effect. My raster image should be large enough - opened in an image viewer the resolution is much higher than displayed with OpenLayers (I also tried using a larger raster image). Is there a way to enhance the maximum number of zoom levels?

EDIT - added OpenLayers code:

var wgs84 = new OpenLayers.Projection("EPSG:4326");
var sphericalMercator = new OpenLayers.Projection("EPSG:900913");

map = new OpenLayers.Map( 'map', { projection: sphericalMercator });

layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
        "http://127.0.0.1/cgi-bin/mapserv?map=/path/to/mapfile.map",
        { layers: 'myraster' } );

map.addLayer(layer);
map.setCenter(new OpenLayers.LonLat(7.7, 48).transform(wgs84,sphericalMercator), 13);
share|improve this question
5  
Mapserver (and WMS in general) don't have the concept of zoomlevels - this is a client issue. So you need to post your OpenLayers code instead of your mapfile before we can help –  iant Jan 6 '13 at 15:23
    
try looking at trac.osgeo.org/openlayers/wiki/SettingZoomLevels –  iant Jan 7 '13 at 8:49

1 Answer 1

16 is the default for maxZoomLevel, but you can set it in a range of ways. A good (extensive if sometimes dense) description is provided at http://trac.osgeo.org/openlayers/wiki/SettingZoomLevels

share|improve this answer

Your Answer

 
discard

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.