1 | ---
|
2 | layout: example.html
|
3 | title: Popup
|
4 | shortdesc: Uses an overlay to create a popup.
|
5 | docs: >
|
6 | <p>
|
7 | Click on the map to get a popup. The popup is composed of a few basic elements: a container, a close button, and a place for the content. To anchor the popup to the map, an <code>ol.Overlay</code> is created with the popup container. A listener is registered for the map's <code>click</code> event to display the popup, and another listener is set as the <code>click</code> handler for the close button to hide the popup.
|
8 | </p>
|
9 | tags: "overlay, popup"
|
10 | ---
|
11 | <div id="map" class="map"></div>
|
12 | <div id="popup" class="ol-popup">
|
13 | <a href="#" id="popup-closer" class="ol-popup-closer"></a>
|
14 | <div id="popup-content"></div>
|
15 | </div>
|