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 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
add comment

1 Answer

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
1  
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 gis.stackexchange.com/questions/18984/… –  CaptDragon Jan 20 '12 at 19:19
add comment

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.