MTTextPopup
public class MTTextPopup : MTAnnotation, MTMapViewContent, @unchecked Sendable
Basic text popup.
Can be attached to MTMarker or standalone.
-
Unique id of the popup.
Declaration
Swift
public private(set) var identifier: String { get }
-
Position of the popup on the map.
Declaration
Swift
public private(set) var coordinates: CLLocationCoordinate2D { get }
-
Text content of the popup.
Declaration
Swift
public private(set) var text: String { get }
-
The pixel distance from the popup’s coordinates.
Declaration
Swift
public private(set) var offset: Double? { get }
-
Initializes the popup with the specified position and text.
Declaration
Swift
public init( coordinates: CLLocationCoordinate2D, text: String, offset: Double = 0.0 )
Parameters
coordinates
Position of the popup.
text
Text content of the popup.
-
Sets coordinates for the popup.
Declaration
Parameters
coordinates
Position of the popup
mapView
Map view to apply to.
completionHandler
A handler block to execute when function finishes.
-
setCoordinates(_:
Asynchronousin: ) Sets coordinates for the popup.
Declaration
Swift
@MainActor public func setCoordinates(_ coordinates: CLLocationCoordinate2D, in mapView: MTMapView) async
Parameters
coordinates
Position of the popup.
mapView
Map view to apply to.
-
Adds popup to map DSL style.
Prefer
addTextPopup(_:)
instead.Declaration
Swift
public func addToMap(_ mapView: MTMapView)