OpenLayers 3 popup overlay
JavaScript CSS
Latest commit c8a552a Jan 11, 2017 @walkermatt committed on GitHub Merge pull request #23 from drnextgis/autopan
Use standard ol.Overlay autoPan options & pass options to base class, fix #21 and #22

OpenLayers 3 Popup

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
  • Multiple popups
    • Add a new popup each time the maps is clicked

The source for all examples can be found in examples.


new ol.Overlay.Popup(opt_options)

OpenLayers 3 Popup Overlay. See the examples for usage. Styling can be done via CSS.


Name Type Description
opt_options Object Overlay options.





Show the popup.

Name Type Description
coord ol.Coordinate Where to anchor the popup.
html String or HTMLElement String or element of HTML to display within the popup.

Hide the popup.


Indicates if the popup is in open state


Contributions are welcome, please create an issue first to discuss any potential contributions.

Updating is generated from the JSDoc comments in the source code and the template util/ To update the API docs edit the comments in the code; to update the other text edit the template (util/

Once you've made edits run the following which will recreate using the JSDoc comments and template:

npm run doc

In order to use the doc npm script you will need to install the devDependencies:

npm install --only=dev


MIT (c) Matt Walker.


Based on an example by Tim Schaub posted on the OL3-Dev list.

Also see

If you find the popup useful you might also like the ol3-layerswitcher.