I've build this web-map http://gimoya.bplaced.net/Openlayers/Trails/map.html with bike-trails (retrieved from a KML on my webserver), where several trails from a region are covered by a selectable region's polygon. Selecting a region's polygon will trigger a zoom to the polygons extent. Now, when zoomed inside the selected polygon the active select control prevents dragging and zooming.

Where in my script would I have to deactivate/activate the select control to enable dragging and zooming on top of a selected polygon?


First things first, nice map!

I also have this problem and have never found a solution. Perhaps a workaround would be that, since when you zoom to the extent of the polygon you are no longer showing it, you could just turn off the layer that has that polygon (http://dev.openlayers.org/releases/OpenLayers-2.5/doc/apidocs/files/OpenLayers/Layer-js.html#OpenLayers.Layer.display) when you are zoomed above a certain threshold.

Like I said, this is a workaround, not a solution, but it's too long to fit in a comment!


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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