2

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

1 Answer 1

1

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;
    }
});
2
  • 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
    Commented Dec 5, 2011 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
    Commented Dec 6, 2011 at 11:27

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.