Marker#

Example#

from ipyleaflet import Map, Marker

center = (52.204793, 360.121558)

m = Map(center=center, zoom=15)

marker = Marker(location=center, draggable=False)
m.add(marker);

m

Attributes and methods#

class ipyleaflet.leaflet.Marker(**kwargs: Any)[source]#

Marker class.

Clickable/Draggable marker on the map.

location#

The tuple containing the latitude/longitude of the marker.

Type:

tuple, default (0, 0)

opacity#

Opacity of the marker between 0. (fully transparent) and 1. (fully opaque).

Type:

float, default 1.

visible#

Whether the marker is visible or not.

Type:

boolean, default True

icon#

Icon used for the marker, it can be an Icon or an AwesomeIcon instance. By default it will use a blue icon.

Type:

object, default None

draggable#

Whether the marker is draggable with the mouse or not.

Type:

boolean, default True

keyboard#

Whether the marker can be tabbed to with a keyboard and clicked by pressing enter.

Type:

boolean, default True

title#

Text for the browser tooltip that appear on marker hover (no tooltip by default).

Type:

string, default ‘’

alt#

Text for the alt attribute of the icon image (useful for accessibility).

Type:

string, default ‘’

rotation_angle#

The rotation angle of the marker in degrees.

Type:

float, default 0.

rotation_origin#

The rotation origin of the marker.

Type:

string, default ‘’

z_index_offset#
Type:

int, default 0

opacity#
Type:

float, default 1.0

rise_offset#

The z-index offset used for the rise_on_hover feature

Type:

int, default 250

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

Add a move event listener.

Parameters:
  • callback (callable) – Callback function that will be called on move event.

  • remove (boolean) – Whether to remove this callback or not. Defaults to False.