SymbolManager

The symbol manager allows to add symbols to a map.

class SymbolManager(delegateProvider: MapDelegateProvider, belowLayerId: String?, touchAreaShiftX: Int, touchAreaShiftY: Int) : AnnotationManagerImpl<Point, Symbol, SymbolOptions, OnSymbolDragListener, OnSymbolClickListener, OnSymbolLongClickListener, SymbolLayer>

Constructors

SymbolManager
Link copied to clipboard
fun SymbolManager(delegateProvider: MapDelegateProvider, belowLayerId: String?, touchAreaShiftX: Int, touchAreaShiftY: Int)

Types

Companion
Link copied to clipboard

Static variables and methods.

object Companion

Functions

addClickListener
Link copied to clipboard
open override fun addClickListener(u: OnSymbolClickListener): Boolean
addDragListener
Link copied to clipboard
open override fun addDragListener(d: OnSymbolDragListener): Boolean
addLongClickListener
Link copied to clipboard
open override fun addLongClickListener(v: OnSymbolLongClickListener): Boolean
create
Link copied to clipboard

Create a list of symbols on the map.

<p> Symbols are going to be created only for features with a matching geometry. <p> All supported properties are:<br> SymbolOptions.PROPERTY_SYMBOL_SORT_KEY - Double<br> SymbolOptions.PROPERTY_ICON_SIZE - Double<br> SymbolOptions.PROPERTY_ICON_IMAGE - String<br> SymbolOptions.PROPERTY_ICON_ROTATE - Double<br> SymbolOptions.PROPERTY_ICON_OFFSET - List<Double><br> SymbolOptions.PROPERTY_ICON_ANCHOR - IconAnchor<br> SymbolOptions.PROPERTY_TEXT_FIELD - String<br> SymbolOptions.PROPERTY_TEXT_FONT - List<String><br> SymbolOptions.PROPERTY_TEXT_SIZE - Double<br> SymbolOptions.PROPERTY_TEXT_MAX_WIDTH - Double<br> SymbolOptions.PROPERTY_TEXT_LETTER_SPACING - Double<br> SymbolOptions.PROPERTY_TEXT_JUSTIFY - TextJustify<br> SymbolOptions.PROPERTY_TEXT_RADIAL_OFFSET - Double<br> SymbolOptions.PROPERTY_TEXT_ANCHOR - TextAnchor<br> SymbolOptions.PROPERTY_TEXT_ROTATE - Double<br> SymbolOptions.PROPERTY_TEXT_TRANSFORM - TextTransform<br> SymbolOptions.PROPERTY_TEXT_OFFSET - List<Double><br> SymbolOptions.PROPERTY_ICON_OPACITY - Double<br> SymbolOptions.PROPERTY_ICON_COLOR - String<br> SymbolOptions.PROPERTY_ICON_HALO_COLOR - String<br> SymbolOptions.PROPERTY_ICON_HALO_WIDTH - Double<br> SymbolOptions.PROPERTY_ICON_HALO_BLUR - Double<br> SymbolOptions.PROPERTY_TEXT_OPACITY - Double<br> SymbolOptions.PROPERTY_TEXT_COLOR - String<br> SymbolOptions.PROPERTY_TEXT_HALO_COLOR - String<br> SymbolOptions.PROPERTY_TEXT_HALO_WIDTH - Double<br> SymbolOptions.PROPERTY_TEXT_HALO_BLUR - Double<br> Learn more about above properties in the <a href="https://www.mapbox.com/mapbox-gl-js/style-spec/">Style specification</a>. <p> Out of spec properties:<br> "is-draggable" - Boolean, true if the symbol should be draggable, false otherwise

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

Create an annotation with the option

open override fun create(option: SymbolOptions): Symbol

Create some annotations with the options

open override fun create(options: List<SymbolOptions>): List<Symbol>
createLayer
Link copied to clipboard

Create the layer for managed annotations

open override fun createLayer(): SymbolLayer
createSource
Link copied to clipboard

Create the source for managed annotations

open override fun createSource(): GeoJsonSource
delete
Link copied to clipboard

Delete the annotation

open override fun delete(annotation: Symbol)

Delete annotations in the list

open override fun delete(annotations: List<Symbol>)
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
onDestroy
Link copied to clipboard

Invoked when Mapview 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)
queryMapForFeatures
Link copied to clipboard

Query the rendered annotation around the point

override fun queryMapForFeatures(point: Point, callback: QueryAnnotationCallback<Symbol>)
override fun queryMapForFeatures(screenCoordinate: ScreenCoordinate, callback: QueryAnnotationCallback<Symbol>)
removeClickListener
Link copied to clipboard
open override fun removeClickListener(u: OnSymbolClickListener): Boolean
removeDragListener
Link copied to clipboard
open override fun removeDragListener(d: OnSymbolDragListener): Boolean
removeLongClickListener
Link copied to clipboard
open override fun removeLongClickListener(v: OnSymbolLongClickListener): Boolean
toString
Link copied to clipboard
open override fun toString(): String
update
Link copied to clipboard

Update the annotation

open override fun update(annotation: Symbol)

Update annotations in the list

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

Trigger an update to the underlying source

override fun updateSource()

Properties

annotations
Link copied to clipboard

The added annotations

open override val annotations: MutableMap<Long, Symbol>
belowLayerId
Link copied to clipboard
override val belowLayerId: String?
clickListeners
Link copied to clipboard

The Added clickListeners

open override val clickListeners: MutableList<OnSymbolClickListener>
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: Symbol?
dragListeners
Link copied to clipboard

The added dragListensers

open override val dragListeners: MutableList<OnSymbolDragListener>
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

<p> 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

<p> 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

<p> 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

<p> 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

<p> 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

<p> Orientation of icon when map is pitched.

var iconPitchAlignment: IconPitchAlignment?
iconRotationAlignment
Link copied to clipboard

The IconRotationAlignment property

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

var iconRotationAlignment: IconRotationAlignment?
iconTextFit
Link copied to clipboard

The IconTextFit property

<p> Scales the icon to fit around the associated text.

var iconTextFit: IconTextFit?
iconTextFitPadding
Link copied to clipboard

The IconTextFitPadding property

<p> 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

<p> 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

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

var iconTranslateAnchor: IconTranslateAnchor?
layerFilter
Link copied to clipboard

The filter on the managed symbols.

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

The added longClickListeners

open override val longClickListeners: MutableList<OnSymbolLongClickListener>
mapFeatureQueryDelegate
Link copied to clipboard
override var mapFeatureQueryDelegate: MapFeatureQueryDelegate
mapProjectionDelegate
Link copied to clipboard
override var mapProjectionDelegate: MapProjectionDelegate
styleStateDelegate
Link copied to clipboard
override var styleStateDelegate: MapStyleStateDelegate
symbolAvoidEdges
Link copied to clipboard

The SymbolAvoidEdges property

<p> 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

<p> Label placement relative to its geometry.

var symbolPlacement: SymbolPlacement?
symbolSpacing
Link copied to clipboard

The SymbolSpacing property

<p> Distance between two symbol anchors.

var symbolSpacing: Double?
textAllowOverlap
Link copied to clipboard

The TextAllowOverlap property

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

var textAllowOverlap: Boolean?
textIgnorePlacement
Link copied to clipboard

The TextIgnorePlacement property

<p> 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

<p> 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

<p> Text leading value for multi-line text.

var textLineHeight: Double?
textMaxAngle
Link copied to clipboard

The TextMaxAngle property

<p> Maximum angle change between adjacent characters.

var textMaxAngle: Double?
textOptional
Link copied to clipboard

The TextOptional property

<p> 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

<p> 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

<p> Orientation of text when map is pitched.

var textPitchAlignment: TextPitchAlignment?
textRotationAlignment
Link copied to clipboard

The TextRotationAlignment property

<p> 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

<p> 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

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

var textTranslateAnchor: TextTranslateAnchor?
textVariableAnchor
Link copied to clipboard

The TextVariableAnchor property

<p> 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

<p> 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>?
touchAreaShiftX
Link copied to clipboard
override val touchAreaShiftX: Int
touchAreaShiftY
Link copied to clipboard
override val touchAreaShiftY: Int
width
Link copied to clipboard
override var width: Int