Skip to content

wwfeng990/ol-popup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenLayers 3 Popup

Basic popup overlay for an OL3 map. By default the map is centred so that the popup is entirely visible.

Examples

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.

API

new ol.Overlay.Popup(opt_options)

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

Parameters:

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.

Extends

ol.Overlay

Methods

show(coord,html)

Show the popup.

Parameters:
Name Type Description
coord ol.Coordinate Where to anchor the popup.
html String String of HTML to display within the popup.
hide()

Hide the popup.

License

MIT (c) Matt Walker.

Credit

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.

About

OpenLayers popup overlay

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 79.4%
  • CSS 20.6%