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 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.

Thanks

share|improve this question

1 Answer 1

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)

  map.events.register('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 - tile.openstreetmap.org/0/0/149189.png""; 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

 
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.