MarkerClusterer

abstract class MarkerClusterer : Overlay

An overlay allowing to perform markers clustering. Usage: put your markers inside with add(Marker), and add the MarkerClusterer to the map overlays. Depending on the zoom level, markers will be displayed separately, or grouped as a single Marker. This abstract class provides the framework. Sub-classes have to implement the clustering algorithm, and the rendering of a cluster.

Author

M.Kergall

Inheritors

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open fun add(marker: MarkerWithLabel)
Add the Marker.
Link copied to clipboard
abstract fun buildClusterMarker(cluster: StaticCluster, mapView: MapView): MarkerWithLabel
Build the marker for a cluster.
Link copied to clipboard
abstract fun clusterer(mapView: MapView): ArrayList<StaticCluster>
clustering algorithm
Link copied to clipboard
open fun draw(canvas: Canvas, mapView: MapView, shadow: Boolean)
Link copied to clipboard
open fun getBounds(): BoundingBox
Link copied to clipboard
Link copied to clipboard
open fun getItem(id: Int): MarkerWithLabel
Link copied to clipboard
Link copied to clipboard
open fun getName(): String
Link copied to clipboard
open fun invalidate()
Force a rebuild of clusters at next draw, even without a zooming action.
Link copied to clipboard
open fun onDoubleTap(event: MotionEvent, mapView: MapView): Boolean
Link copied to clipboard
open fun onLongPress(event: MotionEvent, mapView: MapView): Boolean
Link copied to clipboard
open fun onSingleTapConfirmed(event: MotionEvent, mapView: MapView): Boolean
Link copied to clipboard
open fun onTouchEvent(event: MotionEvent, mapView: MapView): Boolean
Link copied to clipboard
abstract fun renderer(clusters: ArrayList<StaticCluster>, canvas: Canvas, mapView: MapView)
build clusters markers to be used at next draw
Link copied to clipboard
Link copied to clipboard
open fun setDescription(description: String)
Link copied to clipboard
open fun setIcon(icon: Bitmap)
Set the cluster icon to be drawn when a cluster contains more than 1 marker.
Link copied to clipboard
open fun setName(name: String)