Demonstrates how to use the "FeaturePopups" control to
display popups on multiple vector layers using templates.
This control wraps the management of popups and SelectFeature control.
Try:
- Move the cursor over a feature.
- Select a clustered feature (circles), popup is shown as a list.
- Do zoom-in, selection is kept: this is the safe selection.
- Click a link, shows a single popup: due to
${showPopup()}
in "item" template.
- Select any feature in Africa and do zoom-in: selection is kept even though the strategy BBOX has been used, this is also the safe selection but requires "fid"
- Hide the layer "POI's" and re-display: the popup disappears and reappears.
- Select some features from different layers using selection box (press CTRL key and drag)
- Now hide one layer and re-display: the popup list is updated.
- Select only one single feature using a selection box, is shown a single pupup not a list.
- Use a external div instead of a popups to display lists of features, see:
feature-popups-external.html
Features:
- The contents of the popup are built using templates.
- Templates as strings or functions
- Allows internationalization of labels in templates.
- Show popups by selection or hover from multiple vector layers.
- Multiple selection using box and show the list of features selected into an popup
- Proper popups on clustered features (OpenLayers.Strategy.Cluster)
- Safe selection: Features remain selected even after zooming or moving the map (using Cluster and BBOX strategies)
- See more: Description of the project
View the feature-popups.js
source to see how this is done.
(see also feature-popups-common.js)