All Implemented Interfaces:
Serializable, Evented, SupportsLayerEvents, SupportsMouseEvents, FeatureGroupFunctions, LayerGroupFunctions, HasStyle, Identifiable, LayerPopupFunctions, LayerTooltipFunctions, ExecutableFunctions

@NpmPackage(value="leaflet.markercluster", version="1.5.3") @JsModule("leaflet.markercluster/dist/leaflet.markercluster-src.js") @CssImport(value="leaflet.markercluster/dist/MarkerCluster.css",themeFor="leaflet-map") @CssImport(value="leaflet.markercluster/dist/MarkerCluster.Default.css",themeFor="leaflet-map") public class MarkerClusterGroup extends FeatureGroup

Leaflet.markercluster

Web component: https://www.npmjs.com/package/leaflet.markercluster

Provides Beautiful Animated Marker Clustering functionality for LeafletMap.

Since:
2020-05-26
Version:
1.0
Author:
Gabor Kokeny Email: kokeny19@gmail.com
See Also:
  • Constructor Details

    • MarkerClusterGroup

      public MarkerClusterGroup()
      Creates a new marker cluster group with default clustering options.
    • MarkerClusterGroup

      public MarkerClusterGroup(MarkerClusterOptions options)
      Creates a new marker cluster group configured with the given options.
      Parameters:
      options - the clustering options to apply, not null
  • Method Details

    • getOptions

      public MarkerClusterOptions getOptions()
      Gets the clustering options applied to this marker cluster group.
      Returns:
      the clustering options
    • onClusterClick

      public void onClusterClick(LeafletEventListener<LeafletEvent> listener)
      Fired when the user clicks (or taps) the marker cluster
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onClusterMouseOver

      public void onClusterMouseOver(LeafletEventListener<LeafletEvent> listener)
      Fired when the mouse enters the marker cluster
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onClusterMouseOut

      public void onClusterMouseOut(LeafletEventListener<LeafletEvent> listener)
      Fired when the mouse leaves the marker cluster
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onAnimationEnd

      public void onAnimationEnd(LeafletEventListener<LeafletEvent> listener)
      Fires when marker clustering/unclustering animation has completed
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onSpiderfied

      public void onSpiderfied(LeafletEventListener<LeafletEvent> listener)
      Fires when overlapping markers get spiderified (Contains cluster and markers attributes)
      Parameters:
      listener - the listener to call when the event occurs, not null
    • onUnspiderfied

      public void onUnspiderfied(LeafletEventListener<LeafletEvent> listener)
      Fires when overlapping markers get unspiderified (Contains cluster and markers attributes)
      Parameters:
      listener - the listener to call when the event occurs, not null
    • getConstructorArgumentNames

      public List<String> getConstructorArgumentNames()
      Returns the client-side constructor argument names for this layer. A marker cluster group is created without positional constructor arguments.
      Overrides:
      getConstructorArgumentNames in class LeafletObject
      Returns:
      an empty list
    • getPane

      public String getPane()
      Gets the map pane in which the cluster icons are placed.
      Overrides:
      getPane in class Layer
      Returns:
      the cluster pane name
    • getMaxClusterRadius

      public int getMaxClusterRadius()
      Gets the maximum radius, in pixels, that a cluster will cover from the central marker.
      Returns:
      the maximum cluster radius in pixels
    • getClusterPane

      public String getClusterPane()
      Gets the name of the map pane in which the cluster icons are placed.
      Returns:
      the cluster pane name
    • isSpiderfyOnMaxZoom

      public boolean isSpiderfyOnMaxZoom()
      Returns whether clicking a cluster at the bottom zoom level spiderfies it so all of its markers become visible.
      Returns:
      true if the cluster spiderfies at the maximum zoom level
    • isShowCoverageOnHover

      public boolean isShowCoverageOnHover()
      Returns whether the bounds of the markers contained in a cluster are shown as a polygon when the cluster is hovered.
      Returns:
      true if the cluster coverage polygon is shown on hover
    • isZoomToBoundsOnClick

      public boolean isZoomToBoundsOnClick()
      Returns whether clicking a cluster zooms the map to the bounds of its markers.
      Returns:
      true if clicking a cluster zooms to its bounds
    • isSingleMarkerMode

      public boolean isSingleMarkerMode()
      Returns whether single markers are wrapped in a cluster icon rather than shown as a plain marker.
      Returns:
      true if single marker mode is enabled
    • getDisableClusteringAtZoom

      public Integer getDisableClusteringAtZoom()
      Gets the zoom level at and beyond which clustering is disabled, or null if clustering is always enabled.
      Returns:
      the zoom level at which clustering is disabled, or null
    • isRemoveOutsideVisibleBounds

      public boolean isRemoveOutsideVisibleBounds()
      Returns whether clusters and markers that fall outside the visible map bounds are removed from the DOM for performance.
      Returns:
      true if markers outside the visible bounds are removed
    • isAnimate

      public boolean isAnimate()
      Returns whether cluster splitting and merging is animated on zoom.
      Returns:
      true if clustering animations are enabled
    • isAnimateAddingMarkers

      public boolean isAnimateAddingMarkers()
      Returns whether markers added after the initial batch are animated into their clusters.
      Returns:
      true if adding markers is animated
    • getSpiderfyDistanceMultiplier

      public double getSpiderfyDistanceMultiplier()
      Gets the multiplier applied to the distance between markers when a cluster is spiderfied.
      Returns:
      the spiderfy distance multiplier
    • getSpiderLegPolylineOptions

      public PathOptions getSpiderLegPolylineOptions()
      Gets the path options used to style the leg lines drawn to each marker when a cluster is spiderfied.
      Returns:
      the spider leg polyline options
    • isChunkedLoading

      public boolean isChunkedLoading()
      Returns whether markers are added in chunks to keep the UI responsive when loading large numbers of markers.
      Returns:
      true if chunked loading is enabled
    • getChunkInterval

      public int getChunkInterval()
      Gets the maximum time, in milliseconds, spent processing markers in a single chunk before yielding to the browser.
      Returns:
      the chunk processing interval in milliseconds
    • getChunkDelay

      public int getChunkDelay()
      Gets the delay, in milliseconds, between processing consecutive chunks when chunked loading is enabled.
      Returns:
      the delay between chunks in milliseconds
    • getPolygonOptions

      public PathOptions getPolygonOptions()
      Gets the path options used to style the coverage polygon shown when a cluster is hovered.
      Returns:
      the coverage polygon options