Class MarkerClusterOptions
java.lang.Object
org.vaadin.addons.componentfactory.leaflet.plugins.markercluster.MarkerClusterOptions
- All Implemented Interfaces:
Serializable
Possible
MarkerClusterGroup options
- minOpacity -
- Since:
- 2020-05-25
- Version:
- 1.0
- Author:
- Gabor Kokeny Email: kokeny19@gmail.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the delay, in milliseconds, between processing consecutive chunks when chunked loading is enabled.intGets the maximum time, in milliseconds, spent processing markers in a single chunk before yielding to the browser.Gets the name of the map pane in which the cluster icons are placed.Gets the zoom level at and beyond which clustering is disabled, ornullif clustering is always enabled.intGets the maximum radius, in pixels, that a cluster will cover from the central marker.Gets the path options used to style the coverage polygon shown when a cluster is hovered.doubleGets the multiplier applied to the distance between markers when a cluster is spiderfied.Gets the path options used to style the leg lines drawn to each marker when a cluster is spiderfied.booleanReturns whether cluster splitting and merging is animated on zoom.booleanReturns whether markers added after the initial batch are animated into their clusters.booleanReturns whether markers are added in chunks to keep the UI responsive when loading large numbers of markers.booleanReturns whether clusters and markers that fall outside the visible map bounds are removed from the DOM for performance.booleanReturns whether the bounds of the markers contained in a cluster are shown as a polygon when the cluster is hovered.booleanReturns whether single markers are wrapped in a cluster icon rather than shown as a plain marker.booleanReturns whether clicking a cluster at the bottom zoom level spiderfies it so all of its markers become visible.booleanReturns whether clicking a cluster zooms the map to the bounds of its markers.voidsetAnimate(boolean animate) Sets whether cluster splitting and merging is animated on zoom.voidsetAnimateAddingMarkers(boolean animateAddingMarkers) Sets whether markers added after the initial batch are animated into their clusters.voidsetChunkDelay(int chunkDelay) Sets the delay, in milliseconds, between processing consecutive chunks when chunked loading is enabled.voidsetChunkedLoading(boolean chunkedLoading) Sets whether markers are added in chunks to keep the UI responsive when loading large numbers of markers.voidsetChunkInterval(int chunkInterval) Sets the maximum time, in milliseconds, spent processing markers in a single chunk before yielding to the browser.voidsetClusterPane(String clusterPane) Sets the name of the map pane in which the cluster icons are placed.voidsetDisableClusteringAtZoom(Integer disableClusteringAtZoom) Sets the zoom level at and beyond which markers are no longer clustered.voidsetMaxClusterRadius(int maxClusterRadius) Sets the maximum radius, in pixels, that a cluster will cover from the central marker.voidsetPolygonOptions(PathOptions polygonOptions) Sets the path options used to style the coverage polygon shown when a cluster is hovered.voidsetRemoveOutsideVisibleBounds(boolean removeOutsideVisibleBounds) Sets whether clusters and markers that fall outside the visible map bounds are removed from the DOM for performance.voidsetShowCoverageOnHover(boolean showCoverageOnHover) Sets whether the bounds of the markers contained in a cluster are shown as a polygon when the cluster is hovered.voidsetSingleMarkerMode(boolean singleMarkerMode) Sets whether single markers are wrapped in a cluster icon rather than shown as a plain marker.voidsetSpiderfyDistanceMultiplier(double spiderfyDistanceMultiplier) Sets the multiplier applied to the distance between markers when a cluster is spiderfied.voidsetSpiderfyOnMaxZoom(boolean spiderfyOnMaxZoom) Sets whether clicking a cluster at the bottom zoom level spiderfies it so all of its markers become visible.voidsetSpiderLegPolylineOptions(PathOptions spiderLegPolylineOptions) Sets the path options used to style the leg lines drawn to each marker when a cluster is spiderfied.voidsetZoomToBoundsOnClick(boolean zoomToBoundsOnClick) Sets whether clicking a cluster zooms the map to the bounds of its markers.
-
Constructor Details
-
MarkerClusterOptions
public MarkerClusterOptions()
-
-
Method Details
-
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
-
setMaxClusterRadius
public void setMaxClusterRadius(int maxClusterRadius) Sets the maximum radius, in pixels, that a cluster will cover from the central marker. A smaller value produces more, smaller clusters.- Parameters:
maxClusterRadius- the maximum cluster radius in pixels
-
getClusterPane
Gets the name of the map pane in which the cluster icons are placed.- Returns:
- the cluster pane name
-
setClusterPane
Sets the name of the map pane in which the cluster icons are placed.- Parameters:
clusterPane- 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:
trueif the cluster spiderfies at the maximum zoom level
-
setSpiderfyOnMaxZoom
public void setSpiderfyOnMaxZoom(boolean spiderfyOnMaxZoom) Sets whether clicking a cluster at the bottom zoom level spiderfies it so all of its markers become visible.- Parameters:
spiderfyOnMaxZoom-trueto spiderfy 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:
trueif the cluster coverage polygon is shown on hover
-
setShowCoverageOnHover
public void setShowCoverageOnHover(boolean showCoverageOnHover) Sets whether the bounds of the markers contained in a cluster are shown as a polygon when the cluster is hovered.- Parameters:
showCoverageOnHover-trueto show the coverage polygon on hover
-
isZoomToBoundsOnClick
public boolean isZoomToBoundsOnClick()Returns whether clicking a cluster zooms the map to the bounds of its markers.- Returns:
trueif clicking a cluster zooms to its bounds
-
setZoomToBoundsOnClick
public void setZoomToBoundsOnClick(boolean zoomToBoundsOnClick) Sets whether clicking a cluster zooms the map to the bounds of its markers.- Parameters:
zoomToBoundsOnClick-trueto zoom to the cluster bounds on click
-
isSingleMarkerMode
public boolean isSingleMarkerMode()Returns whether single markers are wrapped in a cluster icon rather than shown as a plain marker.- Returns:
trueif single marker mode is enabled
-
setSingleMarkerMode
public void setSingleMarkerMode(boolean singleMarkerMode) Sets whether single markers are wrapped in a cluster icon rather than shown as a plain marker.- Parameters:
singleMarkerMode-trueto enable single marker mode
-
getDisableClusteringAtZoom
Gets the zoom level at and beyond which clustering is disabled, ornullif clustering is always enabled.- Returns:
- the zoom level at which clustering is disabled, or
null
-
setDisableClusteringAtZoom
Sets the zoom level at and beyond which markers are no longer clustered. Usenullto keep clustering enabled at every zoom level.- Parameters:
disableClusteringAtZoom- the zoom level at which to disable clustering, ornullto always cluster
-
isRemoveOutsideVisibleBounds
public boolean isRemoveOutsideVisibleBounds()Returns whether clusters and markers that fall outside the visible map bounds are removed from the DOM for performance.- Returns:
trueif markers outside the visible bounds are removed
-
setRemoveOutsideVisibleBounds
public void setRemoveOutsideVisibleBounds(boolean removeOutsideVisibleBounds) Sets whether clusters and markers that fall outside the visible map bounds are removed from the DOM for performance.- Parameters:
removeOutsideVisibleBounds-trueto remove markers outside the visible bounds
-
isAnimate
public boolean isAnimate()Returns whether cluster splitting and merging is animated on zoom.- Returns:
trueif clustering animations are enabled
-
setAnimate
public void setAnimate(boolean animate) Sets whether cluster splitting and merging is animated on zoom.- Parameters:
animate-trueto enable clustering animations
-
isAnimateAddingMarkers
public boolean isAnimateAddingMarkers()Returns whether markers added after the initial batch are animated into their clusters.- Returns:
trueif adding markers is animated
-
setAnimateAddingMarkers
public void setAnimateAddingMarkers(boolean animateAddingMarkers) Sets whether markers added after the initial batch are animated into their clusters.- Parameters:
animateAddingMarkers-trueto animate markers as they are added
-
getSpiderfyDistanceMultiplier
public double getSpiderfyDistanceMultiplier()Gets the multiplier applied to the distance between markers when a cluster is spiderfied.- Returns:
- the spiderfy distance multiplier
-
setSpiderfyDistanceMultiplier
public void setSpiderfyDistanceMultiplier(double spiderfyDistanceMultiplier) Sets the multiplier applied to the distance between markers when a cluster is spiderfied. Increase it to spread the markers further apart.- Parameters:
spiderfyDistanceMultiplier- the spiderfy distance multiplier
-
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
-
setSpiderLegPolylineOptions
Sets the path options used to style the leg lines drawn to each marker when a cluster is spiderfied.- Parameters:
spiderLegPolylineOptions- 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:
trueif chunked loading is enabled
-
setChunkedLoading
public void setChunkedLoading(boolean chunkedLoading) Sets whether markers are added in chunks to keep the UI responsive when loading large numbers of markers.- Parameters:
chunkedLoading-trueto enable chunked loading
-
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
-
setChunkInterval
public void setChunkInterval(int chunkInterval) Sets the maximum time, in milliseconds, spent processing markers in a single chunk before yielding to the browser.- Parameters:
chunkInterval- 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
-
setChunkDelay
public void setChunkDelay(int chunkDelay) Sets the delay, in milliseconds, between processing consecutive chunks when chunked loading is enabled.- Parameters:
chunkDelay- the delay between chunks in milliseconds
-
getPolygonOptions
Gets the path options used to style the coverage polygon shown when a cluster is hovered.- Returns:
- the coverage polygon options
-
setPolygonOptions
Sets the path options used to style the coverage polygon shown when a cluster is hovered.- Parameters:
polygonOptions- the coverage polygon options
-