Basic popup overlay for an OL3 map. By default the map is centred so that the popup is entirely visible.
The examples demonstrate usage and can be viewed online thanks to RawGit:
- Basic usage
- Create a popup instance, show it on single-click specifying the content
- DOM Events
- Handle DOM events triggered by interacting with elements within the popup content
- Scroll
- Controlling popup dimensions and scrolling overflowing content
The source for all examples can be found in examples.
OpenLayers 3 Popup Overlay. See the examples for usage. Styling can be done via CSS.
Name | Type | Description |
---|---|---|
opt_options |
Object |
Overlay options, extends olx.OverlayOptions adding: panMapIfOutOfView Boolean - Should the map be panned so that the popup is entirely within view. |
ol.Overlay
Show the popup.
Name | Type | Description |
---|---|---|
coord |
ol.Coordinate |
Where to anchor the popup. |
html |
String |
String of HTML to display within the popup. |
Hide the popup.
MIT (c) Matt Walker.
Based on an example by Tim Schaub posted on the OL3-Dev list.
If you find the popup useful you might also like the ol3-layerswitcher.