MTCustomAnnotationView
@MainActor
open class MTCustomAnnotationView : UIView, @preconcurrency MTAnnotation
extension MTCustomAnnotationView: @preconcurrency MTMapViewContent
Subclassable view for adding custom annotations to the map.
-
Unique id of the view.
Declaration
Swift
@MainActor public private(set) var identifier: String { get } -
Position of the view on the map.
Declaration
Swift
@MainActor public private(set) var coordinates: CLLocationCoordinate2D { get } -
Offset from the center.
Declaration
Swift
@MainActor public private(set) var offset: MTPoint { get } -
Declaration
Swift
@MainActor public init( size: CGSize, coordinates: CLLocationCoordinate2D )Parameters
sizeSize of the annotation view.
coordinatesPosition of the annotation.
-
Declaration
Swift
@MainActor public init( size: CGSize, coordinates: CLLocationCoordinate2D, offset: MTPoint )Parameters
sizeSize of the annotation view.
coordinatesPosition of the annotation.
offsetOffset from the center.
-
Not implemented code init.
Declaration
Swift
@MainActor required public init?(coder: NSCoder) -
Sets the offset of the annotation view in pixels.
Declaration
Swift
@MainActor public func setOffset(_ offset: MTPoint)Parameters
offsetDesired offset.
-
Sets coordinates for the view.
Declaration
Parameters
coordinatesPosition of the view
completionHandlerA handler block to execute when function finishes.
mapViewMap view to apply to.
-
Adds custom annotation view to the map.
Declaration
Parameters
mapViewMap view to add annotation to.
completionHandlerA handler block to execute when function finishes.
-
Removes custom annotation view from the map.
Declaration
Swift
@MainActor public func remove() -
setCoordinates(_:Asynchronousin: ) Sets coordinates for the view.
Declaration
Swift
@MainActor public func setCoordinates(_ coordinates: CLLocationCoordinate2D, in mapView: MTMapView) asyncParameters
coordinatesPosition of the view.
-
addTo(_:Asynchronous) Adds custom annotation view to the map.
Declaration
Swift
@MainActor public func addTo(_ mapView: MTMapView) asyncParameters
mapViewMap view to add annotation to.