AnnotationOrchestrator
public final class AnnotationOrchestrator
AnnotationOrchestrator
provides a way to create annotation managers of different types.
-
Dictionary of annotation managers keyed by their identifiers.
Declaration
Swift
public var annotationManagersById: [String : AnnotationManager] { get }
-
Creates a
PointAnnotationManager
which is used to manage a collection ofPointAnnotation
s. Annotations persist across style changes. If an annotation manager with the sameid
has already been created, the old one will be removed as ifremoveAnnotationManager(withId:)
had been called.AnnotationOrchestrator
keeps a strong reference to anyPointAnnotationManager
until it is removed.Declaration
Swift
public func makePointAnnotationManager(id: String = String(UUID().uuidString.prefix(5)), layerPosition: LayerPosition? = nil, clusterOptions: ClusterOptions? = nil) -> PointAnnotationManager
Parameters
id
Optional string identifier for this manager.
layerPosition
Optionally set the
LayerPosition
of the layer managed.clusterOptions
Optionally set the
ClusterOptions
to cluster the Point AnnotationsReturn Value
An instance of
PointAnnotationManager
-
Creates a
PolygonAnnotationManager
which is used to manage a collection ofPolygonAnnotation
s. Annotations persist across style changes. If an annotation manager with the sameid
has already been created, the old one will be removed as ifremoveAnnotationManager(withId:)
had been called.AnnotationOrchestrator
keeps a strong reference to anyPolygonAnnotationManager
until it is removed.Declaration
Swift
public func makePolygonAnnotationManager(id: String = String(UUID().uuidString.prefix(5)), layerPosition: LayerPosition? = nil) -> PolygonAnnotationManager
Parameters
id
Optional string identifier for this manager..
layerPosition
Optionally set the
LayerPosition
of the layer managed.Return Value
An instance of
PolygonAnnotationManager
-
Creates a
PolylineAnnotationManager
which is used to manage a collection ofPolylineAnnotation
s. Annotations persist across style changes. If an annotation manager with the sameid
has already been created, the old one will be removed as ifremoveAnnotationManager(withId:)
had been called.AnnotationOrchestrator
keeps a strong reference to anyPolylineAnnotationManager
until it is removed.Declaration
Swift
public func makePolylineAnnotationManager(id: String = String(UUID().uuidString.prefix(5)), layerPosition: LayerPosition? = nil) -> PolylineAnnotationManager
Parameters
id
Optional string identifier for this manager.
layerPosition
Optionally set the
LayerPosition
of the layer managed.Return Value
An instance of
PolylineAnnotationManager
-
Creates a
CircleAnnotationManager
which is used to manage a collection ofCircleAnnotation
s. Annotations persist across style changes. If an annotation manager with the sameid
has already been created, the old one will be removed as ifremoveAnnotationManager(withId:)
had been called.AnnotationOrchestrator
keeps a strong reference to anyCircleAnnotationManager
until it is removed.Declaration
Swift
public func makeCircleAnnotationManager(id: String = String(UUID().uuidString.prefix(5)), layerPosition: LayerPosition? = nil) -> CircleAnnotationManager
Parameters
id
Optional string identifier for this manager.
layerPosition
Optionally set the
LayerPosition
of the layer managed.Return Value
An instance of
CircleAnnotationManager
-
Removes an annotation manager, this will remove the underlying layer and source from the style. A removed annotation manager will not be able to reuse anymore, you will need to create new annotation manger to add annotations.
Declaration
Swift
public func removeAnnotationManager(withId id: String)
Parameters
id
Identifer of annotation manager to remove