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 have a navigation toolbar with some common OL controls such as Navigation and ZoomBox on it.

I also have a SelectFeature control that isn't part of the navigation toolbar b/c it should be active all the time for vector features. Each layer that is added to the SelectFeature control using setLayers() has a handler registered to the 'featureselected' event.

However, in cases where I choose the ZoomBox control my ability to select vector features disappears. I have to refresh the layer to get it back. I can work with the Navigation control (in fact many other controls too) and still have my vectors responding to the select event.

Has anyone else experienced this or know a work around? Even if you have a cool Firebug way to troubleshoot this issue I'd like to hear about it.

thx mazery

share|improve this question

You could add button for SelectFeature control into panel and deactivate ZoomBox control when SelectFeature control is active. Here is my little example.

share|improve this answer
I agree. You're either selecting, panning, or zoomboxing but you cannot have them all active at once. I'm sure that's why OpenLayers deactivates the selectControl when you're panning. – CaptDragon Jan 20 '12 at 14:03
thanks for the response guys. this was the main reason then that I wanted to create separate onclick handlers for each svg vector feature even if it's expensive. thx for the help – maztaz Jan 20 '12 at 17:15
@maztaz i found a solution to that… – CaptDragon Jan 20 '12 at 19:19

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.