API Reference#

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

BaseControl abstract class.

This is the base class for all ipyopenlayers controls. A control is additional UI components on top of the Map.

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

Base class for overlays on the map.

position#

The position of the overlay on the map (it’s center).

Type:

list of float, default [0, 0]

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

FullScreen class, with Control as parent class.

A control which contains a button that will put the Map in full-screen when clicked.

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

GeoJSON class for GeoJSON data layers.

data#

The GeoJSON data for the layer.

Type:

dict

style#

Style options for the GeoJSON data.

Type:

dict

visible#

Whether the layer is visible or not.

Type:

bool, default True

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

GeoTIFFTileLayer class for WebGL-based GeoTIFF raster tiles.

url#

The URL for the WebGL-based GeoTIFF tiles.

Type:

str, default “”

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

HeatmapLayer class for heatmap visualization.

points#

A list of data points to be displayed on the heatmap, The weight determines the intensity of the heatmap at that point.

Type:

list of lists [latitude, longitude, weight]

blur#

Specifies the blur radius for the heatmap The blur controls the smoothness of the heatmap, with higher values creating more diffuse effects

Type:

int, default 15

radius#

The radius of each point in the heatmap, affects how large each data point appears on the map

Type:

int, default 8

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

ImageOverlay class.

Image layer from a local or remote image file.

image_url#

Url to the local or remote image file.

Type:

string, default “”

position#

center of the image.

Type:

list, default [0., 0]

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

Base class for all layers on the map.

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

Map class.

The Map class is the main widget in ipyopenlayers.

layers#

The list of layers that are currently on the map.

Type:

list of Layer instances

controls#

The list of controls that are currently on the map.

Type:

list of Control instances

overlays#

The list of Overlays that are currently on the map.

Type:

list of Overlay instances

center#

The current center of the map.

Type:

list, default [0, 0]

zoom#

The current zoom value of the map.

Type:

float, default 0

add_control(control)[source]#

Add a control on the map.

Parameters:

control (Control instance) – The new control to add.

add_layer(layer)[source]#

Add a layer on the map.

Parameters:

layer (Layer instance) – The new layer to add.

add_overlay(overlay)[source]#

Add an overlay to the map.

Parameters:

overlay (BaseOverlay instance) – The overlay to add.

clear_layers()[source]#

Remove all layers from the map.

on_click(callback, remove=False)[source]#

Add a click event listener.

remove_control(control)[source]#

Remove a control from the map.

Parameters:

control (Control instance) – The control to remove.

remove_layer(layer)[source]#

Remove a layer from the map.

Parameters:

layer (Layer instance) – The layer to remove.

remove_overlay(overlay)[source]#

Remove an overlay from the map.

Parameters:

overlay (BaseOverlay instance) – The overlay to remove.

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

MousePosition class for displaying the mouse position on the map.

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]

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

RasterTileLayer class for WebGL-based raster tiles.

Inherits from TileLayer and provides additional functionality for rendering raster tiles using WebGL.

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

ScaleLine class for adding a scale line control to the map.

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

The TileLayer class serves as the foundational class for both raster and vector tile layers.

url#

The URL template for the tile images.

Type:

str

attribution#

Attribution text for the tile layer.

Type:

str, default “”

opacity#

Opacity of the tile layer, between 0.0 and 1.0.

Type:

float, default 1.0

visible#

Whether the layer is visible or not.

Type:

bool, default True

min_zoom#

Minimum zoom level for the layer.

Type:

int, default 0

max_zoom#

Maximum zoom level for the layer.

Type:

int, default 18

source_format#

Additional format options for the tile source.

Type:

dict

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

VectorTileLayer class for vector tiles. Inherits from TileLayer and provides additional functionality for vector tiles.

style#

Style options for vector tiles.

Type:

dict

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

VideoOverlay class.

Video layer from a local or remote video file.

video_url#

Url to the local or remote image file.

Type:

string, default “”

position#

center of the video.

Type:

list, default [0., 0]

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

ZoomSlider class for adding a zoom slider control to the map.