Marker Cluster#

Example#

from ipyleaflet import Map, Marker, MarkerCluster

m = Map(center=(50, 0), zoom=5)

marker1 = Marker(location=(48, -2))
marker2 = Marker(location=(50, 0))
marker3 = Marker(location=(52, 2))

marker_cluster = MarkerCluster(
    markers=(marker1, marker2, marker3)
)

m.add(marker_cluster);

m

Attributes#

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

MarkerCluster class, with Layer as parent class.

A cluster of markers that you can put on the map like other layers.

markers#

List of markers to include in the cluster.

Type:

list, default []