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


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.