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 want to determine resolution and number of zoom level dynamically instead of inputting the values in openlayers client. When the user move the position on map by dragging or panning control, I can track the updated Lat-lon and get the min and max lat-lon. Now, I would like to calculate the resolution and maxzoomLevel for newly calculated latlon position when each time user changes the map position.


share|improve this question
up vote 1 down vote accepted

i didnt understand your question very well but you can do sth when your zoomend end:

// zoom end or move end(change zoomend)'zoomend', this, function (event) {
    var currentZoom = map.getZoom();       
    if( currentZoom  > 5)
        // do something;
share|improve this answer
Thanks for the answer Aragon.I used the concept like you mentioned above and passed the zoom level value by POST.Now.I can get the zoom level dynamically now based on parent map. Thanks – panalbish Dec 5 '11 at 11:24
Currently, I am dynamically passing the resolution value based on zoom level, by which I can restrict the minzoom level. But,I am facing the issue of "NetworkError: 404 Not Found -""; while trying to get the base layer.And I have blank base layer. And also I noticed, i am in zoom level lets say 16, but OSM is trying to get the tiles for zoom level 0, as you can see above the error message. Do any body have any idea regarding this issue? Thanks – panalbish Dec 6 '11 at 11:27

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.