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 the following situation: i display points and point informations in popups. the points are added to a layer. The popups are added to the map, with map.addPopup function. It works great. The problem is that i want to control the visibility of the popups. For example, if i should be able to add the popups to a layer, then i should be able to hide/show that layer with LayerSwitcher (OpenLayers.Control.LayerSwitcher). But i haven't found any example when somebody adds a popup to a layer. Every example uses the map.addPopup function. Any idea?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Popups in OpenLayers does not belong to a layer at all. The only method is map.addPopup. For more complex uses I'm afraid you'll have to write some code of your own to handle the issue at hand.

share|improve this answer

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.