AnnotationsActions
public protocol AnnotationsActions
A protocol that defines map annotation actions.
Important
This is a Public Preview API. It may be changed or removed at any time.-
Adds a new marker on the map using the
MarkerOptions
.Throws
Throws anAnnotationServiceError
.Declaration
Swift
func addMarker(options: MarkerOptions) throws -> Marker
Parameters
options
The marker options.
-
Adds a new line on the map using the
LineOptions
.Throws
Throws anAnnotationServiceError
.Declaration
Swift
func addLine(options: LineOptions) throws -> Line
Parameters
options
The line options.
-
Adds a new polygon on the map using the
PolygonOptions
.Throws
Throws anAnnotationServiceError
.Declaration
Swift
func addPolygon(options: PolygonOptions) throws -> Polygon
Parameters
options
The polygon options.
-
Adds a new polygon overlay (nested polygons) on the map using the
PolygonOverlayOptions
.Throws
Throws anAnnotationServiceError
.Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
func addPolygonOverlay(options: PolygonOverlayOptions) throws -> PolygonOverlay
Parameters
options
The polygon options.
-
Adds a new circle on the map using the
CircleOptions
.Throws
Throws anAnnotationServiceError
.Declaration
Swift
func addCircle(options: CircleOptions) throws -> Circle
Parameters
options
The circle options.
-
Removes a given annotation from the map.
Declaration
Swift
func remove(annotation: Annotation)
Parameters
annotation
The annotation that will be removed.
-
Removes all annotations from the map.
Declaration
Swift
func removeAnnotations()
-
Removes annotation having a particular tag from the map.
Declaration
Swift
func removeAnnotations(tag: String)
Parameters
tag
Describing the annotation group.
-
Selects an annotation. You can provide view for selected annotation in
MapDataSource
.Declaration
Swift
func select(annotation: Annotation)
-
Deselects an annotation. You can provide view for selected annotation in
MapDataSource
.Declaration
Swift
func deselect(annotation: Annotation)
-
Zooms to a view containing all markers on the map with padding in px. Creates coordinate bounds and passes them to
FitToCoordinatesOptions
to update the camera with a one-second animation duration.Declaration
Swift
func zoomToMarkers(marginPx: UInt)
-
Zooms to a view containing all markers on the map with padding in px. Creates coordinate bounds and passes them to
FitToCoordinatesOptions
to update the camera with a one-second animation duration.Declaration
Swift
func zoomToMarkers(marginPx: UInt, tag: String)
Parameters
tag
Describing the annotation group.
-
Zooms to a view containing all markers on the map. Creates coordinate bounds and passes it to
FitToCoordinatesOptions
to update camera with a one-second animation duration.Declaration
Swift
func zoomToMarkers()
-
Zooms to a view containing all markers on the map.
Declaration
Swift
func zoomToMarkers(tag: String)
Parameters
tag
Describing the annotation group.
-
Toggle fading effect for markers.
Declaration
Swift
var isMarkersFadingEnabled: Bool { get set }
-
Sets the parameters of markers’ fading with distance effect.
Declaration
Swift
func setMarkerDistanceFadingRange(range: ClosedRange<Measurement<UnitLength>>)
Parameters
range
Minimum range distance when fading starts. It should be less than or equal to the maximum. Maximum range distance when a marker is fully transparent. It should be greater than or equal to the minimum.
-
Toggle shrinking effect for markers.
Declaration
Swift
var isMarkersShrinkingEnabled: Bool { get set }
-
Sets the parameters of markers’ shrinking with distance effect.
Declaration
Swift
func setMarkerDistanceShrinkingRange(range: ClosedRange<Measurement<UnitLength>>)
Parameters
range
Minimum range distance when fading starts. It should be less than or equal to the maximum. Maximum range distance when a marker is fully transparent. It should be greater than or equal to the minimum.