AnnotationSourceOptions

Configure class for composing GeoJsonSource objects that included in Annotation

data class AnnotationSourceOptions(maxZoom: Long?, buffer: Long?, lineMetrics: Boolean?, tolerance: Double?, cluster: Boolean?, clusterMaxZoom: Long?, clusterProperties: HashMap<String, Any>?)

See also

<a href="https://docs.mapbox.com/mapbox-gl-js/style-spec/sources/#geojson">The online documentation</a>

Constructors

AnnotationSourceOptions
Link copied to clipboard
fun AnnotationSourceOptions(maxZoom: Long?, buffer: Long?, lineMetrics: Boolean?, tolerance: Double?, cluster: Boolean?, clusterMaxZoom: Long?, clusterProperties: HashMap<String, Any>?)

Functions

component1
Link copied to clipboard
operator fun component1(): Long?
component2
Link copied to clipboard
operator fun component2(): Long?
component3
Link copied to clipboard
operator fun component3(): Boolean?
component4
Link copied to clipboard
operator fun component4(): Double?
component5
Link copied to clipboard
operator fun component5(): Boolean?
component6
Link copied to clipboard
operator fun component6(): Long?
component7
Link copied to clipboard
operator fun component7(): HashMap<String, Any>?
copy
Link copied to clipboard
fun copy(maxZoom: Long?, buffer: Long?, lineMetrics: Boolean?, tolerance: Double?, cluster: Boolean?, clusterMaxZoom: Long?, clusterProperties: HashMap<String, Any>?): AnnotationSourceOptions
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
open override fun hashCode(): Int
toString
Link copied to clipboard
open override fun toString(): String

Properties

buffer
Link copied to clipboard

Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance.

val buffer: Long?
cluster
Link copied to clipboard

If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new Point features in the source with additional properties:

  • cluster Is true if the point is a cluster

  • cluster_id A unqiue id for the cluster to be used in conjunction with the cluster inspection methods

  • point_count Number of original points grouped into this cluster

  • point_count_abbreviated An abbreviated point count

val cluster: Boolean?
clusterMaxZoom
Link copied to clipboard

Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15.

val clusterMaxZoom: Long?
clusterProperties
Link copied to clipboard

An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form {"property_name": [operator, map_expression]}. operator is any expression function that accepts at least 2 operands (e.g. "+" or "max") — it accumulates the property value from clusters/points the cluster contains; map_expression produces the value of a single point.

Example: {"sum": ["+", ["get", "scalerank"]]}.

For more advanced use cases, in place of operator, you can use a custom reduce expression that references a special ["accumulated"] value, e.g.: {"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}

val clusterProperties: HashMap<String, Any>?
lineMetrics
Link copied to clipboard

Whether to calculate line distance metrics. This is required for line layers that specify line-gradient values.

val lineMetrics: Boolean?
maxZoom
Link copied to clipboard

Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels).

val maxZoom: Long?
tolerance
Link copied to clipboard

Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance).

val tolerance: Double?