Skip to main content
Ctrl+K

ipyopenlayers 0.2.1 documentation

  • Introduction to ipyopenlayers
  • Installation
  • Developer install
  • Map
  • Layers
    • Overlays
    • Controls
    • API Reference
  • Introduction to ipyopenlayers
  • Installation
  • Developer install
  • Map
  • Layers
  • Overlays
  • Controls
  • API Reference

Section Navigation

  • Image Overlay
  • Video Overlay
  • Popup Overlay
  • Overlays
  • Popup Overlay

Popup Overlay#

The PopupOverlay class in ipyopenlayers allows you to create and manage popups on your map. Popups are useful for displaying additional information, annotations, or interactive elements when a specific point on the map is clicked or hovered over. The PopupOverlay class provides options to specify the position of the popup and its content.

Key Features#

  • Informative: Display additional information or annotations at specific points on the map.

  • Interactive: Popups can contain HTML content, making them highly customizable and interactive.

  • Dynamic Updates: The content and position of the popup can be updated dynamically, allowing for interactive and responsive map displays.

Example#

Below is an example of how to use the PopupOverlay class to add a popup to your ipyopenlayers map:

from ipyopenlayers import Map, PopupOverlay,RasterTileLayer

# Create a map centered at coordinates [0.0, 0.0] with zoom level 2
m = Map(center=[-11.844178003179724, 37.31477334221525], zoom=0)

# Add layer
layer=RasterTileLayer()
m.add_layer(layer)

# Display the map
display(m)

# Create a PopupOverlay and set its position and content
popup = PopupOverlay(position=[-120.06694821433305, 40.70520249808547], popup_content = 'United States of America')

# Add the PopupOverlay to the map
m.add_overlay(popup)

Attributes#

class ipyopenlayers.openlayers.PopupOverlay(**kwargs: Any)[source]#

PopupOverlay class.

popup_content#

Content to display.

Type:

string, default “”

position#

position of the popup.

Type:

list, default [0., 0]

previous

Video Overlay

next

Controls

On this page
  • Key Features
  • Example
  • Attributes
    • PopupOverlay
      • PopupOverlay.popup_content
      • PopupOverlay.position
Show Source

© Copyright 2024, QuantStack.

Created using Sphinx 8.0.2.

Built with the PyData Sphinx Theme 0.15.4.