PointAnnotationManager

The pointAnnotation manager allows to add pointAnnotations to a map.

Constructors

PointAnnotationManager
Link copied to clipboard
fun PointAnnotationManager(mapView: View, delegateProvider: MapDelegateProvider, annotationConfig: AnnotationConfig?)

Types

Companion
Link copied to clipboard

Static variables and methods.

object Companion

Functions

addClickListener
Link copied to clipboard
open override fun addClickListener(u: OnPointAnnotationClickListener): Boolean
addDragListener
Link copied to clipboard
open override fun addDragListener(d: OnPointAnnotationDragListener): Boolean
addInteractionListener
Link copied to clipboard
open override fun addInteractionListener(i: OnPointAnnotationInteractionListener): Boolean
addLongClickListener
Link copied to clipboard
open override fun addLongClickListener(v: OnPointAnnotationLongClickListener): Boolean
create
Link copied to clipboard

Create a list of pointAnnotations on the map.

PointAnnotations are going to be created only for features with a matching geometry.

All supported properties are: PointAnnotationOptions.PROPERTY_ICON_ANCHOR - IconAnchor PointAnnotationOptions.PROPERTY_ICON_IMAGE - String PointAnnotationOptions.PROPERTY_ICON_OFFSET - List<Double> PointAnnotationOptions.PROPERTY_ICON_ROTATE - Double PointAnnotationOptions.PROPERTY_ICON_SIZE - Double PointAnnotationOptions.PROPERTY_SYMBOL_SORT_KEY - Double PointAnnotationOptions.PROPERTY_TEXT_ANCHOR - TextAnchor PointAnnotationOptions.PROPERTY_TEXT_FIELD - String PointAnnotationOptions.PROPERTY_TEXT_JUSTIFY - TextJustify PointAnnotationOptions.PROPERTY_TEXT_LETTER_SPACING - Double PointAnnotationOptions.PROPERTY_TEXT_MAX_WIDTH - Double PointAnnotationOptions.PROPERTY_TEXT_OFFSET - List<Double> PointAnnotationOptions.PROPERTY_TEXT_RADIAL_OFFSET - Double PointAnnotationOptions.PROPERTY_TEXT_ROTATE - Double PointAnnotationOptions.PROPERTY_TEXT_SIZE - Double PointAnnotationOptions.PROPERTY_TEXT_TRANSFORM - TextTransform PointAnnotationOptions.PROPERTY_ICON_COLOR - String PointAnnotationOptions.PROPERTY_ICON_HALO_BLUR - Double PointAnnotationOptions.PROPERTY_ICON_HALO_COLOR - String PointAnnotationOptions.PROPERTY_ICON_HALO_WIDTH - Double PointAnnotationOptions.PROPERTY_ICON_OPACITY - Double PointAnnotationOptions.PROPERTY_TEXT_COLOR - String PointAnnotationOptions.PROPERTY_TEXT_HALO_BLUR - Double PointAnnotationOptions.PROPERTY_TEXT_HALO_COLOR - String PointAnnotationOptions.PROPERTY_TEXT_HALO_WIDTH - Double PointAnnotationOptions.PROPERTY_TEXT_OPACITY - Double Learn more about above properties in the )The online documentation.

Out of spec properties: "is-draggable" - Boolean, true if the pointAnnotation should be draggable, false otherwise

fun create(featureCollection: FeatureCollection): List<PointAnnotation>
fun create(json: String): List<PointAnnotation>

Create an annotation with the option

open override fun create(option: PointAnnotationOptions): PointAnnotation

Create some annotations with the options

open override fun create(options: List<PointAnnotationOptions>): List<PointAnnotation>
createClusterLevelLayer
Link copied to clipboard
override fun createClusterLevelLayer(level: Int, colorLevels: List<Pair<Int, Int>>): CircleLayer
createClusterTextLayer
Link copied to clipboard
override fun createClusterTextLayer(): SymbolLayer
createSource
Link copied to clipboard
override fun createSource(): GeoJsonSource
delete
Link copied to clipboard

Delete the annotation

open override fun delete(annotation: PointAnnotation)

Delete annotations in the list

open override fun delete(annotations: List<PointAnnotation>)
deleteAll
Link copied to clipboard

Delete all the added annotations

open override fun deleteAll()
enableDataDrivenProperty
Link copied to clipboard

Enable a data-driven property

open override fun enableDataDrivenProperty(property: String)
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
getAnnotationIdKey
Link copied to clipboard

Get the key of the id of the annotation.

open override fun getAnnotationIdKey(): String
hashCode
Link copied to clipboard
open override fun hashCode(): Int
initClusterLayers
Link copied to clipboard
override fun initClusterLayers()
onDestroy
Link copied to clipboard

Invoked when Mapview or Annotation manager is destroyed.

open override fun onDestroy()
onSizeChanged
Link copied to clipboard

Invoked when MapView's width and height have changed.

open override fun onSizeChanged(width: Int, height: Int)
onStyleLoaded
Link copied to clipboard

Invoked when the style is loaded

open override fun onStyleLoaded(styleDelegate: StyleInterface)
queryMapForFeatures
Link copied to clipboard

Query the rendered annotation around the point

override fun queryMapForFeatures(point: Point, callback: QueryAnnotationCallback<PointAnnotation>)
override fun queryMapForFeatures(screenCoordinate: ScreenCoordinate, callback: QueryAnnotationCallback<PointAnnotation>)
removeClickListener
Link copied to clipboard
open override fun removeClickListener(u: OnPointAnnotationClickListener): Boolean
removeDragListener
Link copied to clipboard
open override fun removeDragListener(d: OnPointAnnotationDragListener): Boolean
removeInteractionListener
Link copied to clipboard
open override fun removeInteractionListener(i: OnPointAnnotationInteractionListener): Boolean
removeLongClickListener
Link copied to clipboard
open override fun removeLongClickListener(v: OnPointAnnotationLongClickListener): Boolean
selectAnnotation
Link copied to clipboard

Toggles the annotation's selection state. If the annotation is deselected, it becomes selected. If the annotation is selected, it becomes deselected.

open override fun selectAnnotation(annotation: PointAnnotation)
toString
Link copied to clipboard
open override fun toString(): String
update
Link copied to clipboard

Update the annotation

open override fun update(annotation: PointAnnotation)

Update annotations in the list

open override fun update(annotations: List<PointAnnotation>)
updateSource
Link copied to clipboard

Trigger an update to the underlying source

override fun updateSource()

Properties

annotationConfig
Link copied to clipboard
override val annotationConfig: AnnotationConfig?
annotationMap
Link copied to clipboard
override val annotationMap: ConcurrentHashMap<Long, PointAnnotation>
annotations
Link copied to clipboard

The added annotations

open override val annotations: List<PointAnnotation>
clickListeners
Link copied to clipboard

The Added clickListeners

open override val clickListeners: MutableList<OnPointAnnotationClickListener>
currentId
Link copied to clipboard
override var currentId: Long
delegateProvider
Link copied to clipboard

The delegateProvider

override val delegateProvider: MapDelegateProvider
draggedAnnotation
Link copied to clipboard
override var draggedAnnotation: PointAnnotation?
dragListeners
Link copied to clipboard

The added dragListeners

open override val dragListeners: MutableList<OnPointAnnotationDragListener>
gesturesPlugin
Link copied to clipboard
override var gesturesPlugin: GesturesPlugin
height
Link copied to clipboard
override var height: Int
iconAllowOverlap
Link copied to clipboard

The IconAllowOverlap property

If true, the icon will be visible even if it collides with other previously drawn symbols.

var iconAllowOverlap: Boolean?
iconIgnorePlacement
Link copied to clipboard

The IconIgnorePlacement property

If true, other symbols can be visible even if they collide with the icon.

var iconIgnorePlacement: Boolean?
iconKeepUpright
Link copied to clipboard

The IconKeepUpright property

If true, the icon may be flipped to prevent it from being rendered upside-down.

var iconKeepUpright: Boolean?
iconOptional
Link copied to clipboard

The IconOptional property

If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.

var iconOptional: Boolean?
iconPadding
Link copied to clipboard

The IconPadding property

Size of the additional area around the icon bounding box used for detecting symbol collisions.

var iconPadding: Double?
iconPitchAlignment
Link copied to clipboard

The IconPitchAlignment property

Orientation of icon when map is pitched.

var iconPitchAlignment: IconPitchAlignment?
iconRotationAlignment
Link copied to clipboard

The IconRotationAlignment property

In combination with {@link Property.SYMBOL_PLACEMENT}, determines the rotation behavior of icons.

var iconRotationAlignment: IconRotationAlignment?
iconTextFit
Link copied to clipboard

The IconTextFit property

Scales the icon to fit around the associated text.

var iconTextFit: IconTextFit?
iconTextFitPadding
Link copied to clipboard

The IconTextFitPadding property

Size of the additional area added to dimensions determined by {@link Property.ICON_TEXT_FIT}, in clockwise order: top, right, bottom, left.

var iconTextFitPadding: List<Double>?
iconTranslate
Link copied to clipboard

The IconTranslate property

Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

var iconTranslate: List<Double>?
iconTranslateAnchor
Link copied to clipboard

The IconTranslateAnchor property

Controls the frame of reference for {@link PropertyFactory#iconTranslate}.

var iconTranslateAnchor: IconTranslateAnchor?
interactionListener
Link copied to clipboard

The added interactionListener

open override val interactionListener: MutableList<OnPointAnnotationInteractionListener>
layerFilter
Link copied to clipboard

The filter on the managed pointAnnotations.

open override var layerFilter: Expression?
longClickListeners
Link copied to clipboard

The added longClickListeners

open override val longClickListeners: MutableList<OnPointAnnotationLongClickListener>
mapCameraManagerDelegate
Link copied to clipboard
override var mapCameraManagerDelegate: MapCameraManagerDelegate
mapFeatureQueryDelegate
Link copied to clipboard
override var mapFeatureQueryDelegate: MapFeatureQueryDelegate
styleStateDelegate
Link copied to clipboard
override var styleStateDelegate: MapStyleStateDelegate
symbolAvoidEdges
Link copied to clipboard

The SymbolAvoidEdges property

If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like Mapbox GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.

var symbolAvoidEdges: Boolean?
symbolPlacement
Link copied to clipboard

The SymbolPlacement property

Label placement relative to its geometry.

var symbolPlacement: SymbolPlacement?
symbolSpacing
Link copied to clipboard

The SymbolSpacing property

Distance between two symbol anchors.

var symbolSpacing: Double?
textAllowOverlap
Link copied to clipboard

The TextAllowOverlap property

If true, the text will be visible even if it collides with other previously drawn symbols.

var textAllowOverlap: Boolean?
textFont
Link copied to clipboard

The TextFont property

Font stack to use for displaying text.

var textFont: List<String>?
textIgnorePlacement
Link copied to clipboard

The TextIgnorePlacement property

If true, other symbols can be visible even if they collide with the text.

var textIgnorePlacement: Boolean?
textKeepUpright
Link copied to clipboard

The TextKeepUpright property

If true, the text may be flipped vertically to prevent it from being rendered upside-down.

var textKeepUpright: Boolean?
textLineHeight
Link copied to clipboard

The TextLineHeight property

Text leading value for multi-line text.

var textLineHeight: Double?
textMaxAngle
Link copied to clipboard

The TextMaxAngle property

Maximum angle change between adjacent characters.

var textMaxAngle: Double?
textOptional
Link copied to clipboard

The TextOptional property

If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.

var textOptional: Boolean?
textPadding
Link copied to clipboard

The TextPadding property

Size of the additional area around the text bounding box used for detecting symbol collisions.

var textPadding: Double?
textPitchAlignment
Link copied to clipboard

The TextPitchAlignment property

Orientation of text when map is pitched.

var textPitchAlignment: TextPitchAlignment?
textRotationAlignment
Link copied to clipboard

The TextRotationAlignment property

In combination with {@link Property.SYMBOL_PLACEMENT}, determines the rotation behavior of the individual glyphs forming the text.

var textRotationAlignment: TextRotationAlignment?
textTranslate
Link copied to clipboard

The TextTranslate property

Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.

var textTranslate: List<Double>?
textTranslateAnchor
Link copied to clipboard

The TextTranslateAnchor property

Controls the frame of reference for {@link PropertyFactory#textTranslate}.

var textTranslateAnchor: TextTranslateAnchor?
textVariableAnchor
Link copied to clipboard

The TextVariableAnchor property

To increase the chance of placing high-priority labels on the map, you can provide an array of {@link Property.TEXT_ANCHOR} locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use text-justify: auto to choose justification based on anchor position. To apply an offset, use the {@link PropertyFactory#textRadialOffset} or the two-dimensional {@link PropertyFactory#textOffset}.

var textVariableAnchor: List<String>?
textWritingMode
Link copied to clipboard

The TextWritingMode property

The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.

var textWritingMode: List<String>?
width
Link copied to clipboard
override var width: Int