I'm developing a map in an Android WebView, using OpenLayers and a WMS Service. I can only zoom a certain amount of times (which I would like to increase).

My code is:

map = new OpenLayers.Map({div:"map"});
baseLayer = new OpenLayers.Layer.WMS("WMS", link, {layers:"basic"});

I've tried from the page Setting Zoom Levels

var options = { numZoomLevels: 25 };
map = new OpenLayers.Map( {div:"map"} , options); 

but then the map doesn't even show. And this:

map = new OpenLayers.Map({div:"map"});
baseLayer = new OpenLayers.Layer.WMS("WMS", link, {layers:"basic", numZoomLevels: 25});

but in this case, nothing changes (I can only zoom in 16 times, as before). Where is my mistake?

1 Answer 1


I suspect there isn't enough information in the way you're instantiating in your map. OpenLayers will work out-of-the-box with minimum properties, but will only have basic functionality. To access some of the more advanced functionalities such as the numZoomLevels setting, you need to provide more parameters. maxResolution is one property that generally needs to be specified. If you don't know what it is, you can grab it from the map object resolutions array.

Have a look at this page to find out more about the combinations of map properties you can set.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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