AnnotationsActions
public protocol AnnotationsActions : AnyObject
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 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()
-
Selects an annotation. You can provide view for selected annotation in
TomTomMapDataSource
.Declaration
Swift
func select(annotation: Annotation)
-
Deselects an annotation. You can provide view for selected annotation in
TomTomMapDataSource
.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. Creates coordinate bounds and passes it to
FitToCoordinatesOptions
to update camera with a one-second animation duration.Declaration
Swift
func zoomToMarkers()
-
Toggle fading effect for markers.
Declaration
Swift
var isMarkersFadingEnabled: Bool { get set }
-
Sets the parameters of markers’ fading with distance effect.
@param minimum Distance in meters at which fading starts. Should be less than or equal to maximum. @param maximum Distance in meters at which a marker is fully transparent. Should be greater than or equal to minimum.
Declaration
Swift
func setMarkerDistanceFadingRange(minimum: Int, maximum: Int)
-
Toggle shrinking effect for markers.
Declaration
Swift
var isMarkersShrinkingEnabled: Bool { get set }
-
Sets the parameters of markers’ shrinking with distance effect.
@param minimum Distance in meters at which fading starts. Should be less than or equal to maximum. @param maximum Distance in meters at which a marker is fully transparent. Should be greater than or equal to minimum.
Declaration
Swift
func setMarkerDistanceShrinkingRange(minimum: Int, maximum: Int)