---
title: "MTMarker | Mobile sdk | Mobile sdk ios | Ios"
description: "Annotation element that can be added to the map."
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# MTMarker

```
public class MTMarker : MTAnnotation, MTMapViewContent, @unchecked Sendable
```

Annotation element that can be added to the map.

-   `[identifier](#/s:11MapTilerSDK8MTMarkerC10identifierSSvp)`
    
    Unique id of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    public private(set) var identifier: String { get }
    ```
    
-   `[coordinates](#/s:11MapTilerSDK8MTMarkerC11coordinatesSo22CLLocationCoordinate2DVvp)`
    
    Position of the marker on the map.
    
    #### Declaration
    
    Swift
    
    ```
    public private(set) var coordinates: CLLocationCoordinate2D { get }
    ```
    
-   `[color](#/s:11MapTilerSDK8MTMarkerC5colorSo7UIColorCSgvp)`
    
    Color of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    public var color: UIColor?
    ```
    
-   `[opacity](#/s:11MapTilerSDK8MTMarkerC7opacitySdvp)`
    
    Opacity of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    public var opacity: Double
    ```
    
-   `[opacityWhenCovered](#/s:11MapTilerSDK8MTMarkerC18opacityWhenCoveredSdvp)`
    
    Opacity applied when the marker is covered by another object.
    
    #### Declaration
    
    Swift
    
    ```
    public var opacityWhenCovered: Double
    ```
    
-   `[draggable](#/s:11MapTilerSDK8MTMarkerC9draggableSbSgvp)`
    
    Boolean indicating whether marker is draggable.
    
    #### Declaration
    
    Swift
    
    ```
    public var draggable: Bool?
    ```
    
-   `[icon](#/s:11MapTilerSDK8MTMarkerC4iconSo7UIImageCSgvp)`
    
    Custom icon to use for marker.
    
    #### Declaration
    
    Swift
    
    ```
    public var icon: UIImage?
    ```
    
-   `[anchor](#/s:11MapTilerSDK8MTMarkerC6anchorAA8MTAnchorOvp)`
    
    Anchor position of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    public var anchor: MTAnchor
    ```
    
-   `[offset](#/s:11MapTilerSDK8MTMarkerC6offsetSdvp)`
    
    Offset distance from the marker’s anchor, applied on both axes in pixels.
    
    #### Declaration
    
    Swift
    
    ```
    public var offset: Double
    ```
    
-   `[scale](#/s:11MapTilerSDK8MTMarkerC5scaleSdvp)`
    
    Scale factor applied to the marker.
    
    #### Declaration
    
    Swift
    
    ```
    public var scale: Double
    ```
    
-   `[subpixelPositioning](#/s:11MapTilerSDK8MTMarkerC19subpixelPositioningSbvp)`
    
    Enables subpixel positioning when rendering the marker.
    
    #### Declaration
    
    Swift
    
    ```
    public var subpixelPositioning: Bool
    ```
    
-   `[rotation](#/s:11MapTilerSDK8MTMarkerC8rotationSdvp)`
    
    Rotation of the marker in degrees.
    
    #### Declaration
    
    Swift
    
    ```
    public var rotation: Double
    ```
    
-   `[rotationAlignment](#/s:11MapTilerSDK8MTMarkerC17rotationAlignmentAA0d8RotationF0Ovp)`
    
    Alignment of the marker rotation relative to the map or viewport.
    
    #### Declaration
    
    Swift
    
    ```
    public var rotationAlignment: MTMarkerRotationAlignment
    ```
    
-   `[pitchAlignment](#/s:11MapTilerSDK8MTMarkerC14pitchAlignmentAA0d5PitchF0Ovp)`
    
    Alignment of the marker pitch relative to the map or viewport.
    
    #### Declaration
    
    Swift
    
    ```
    public var pitchAlignment: MTMarkerPitchAlignment
    ```
    
-   `[popup](#/s:11MapTilerSDK8MTMarkerC5popupAA11MTTextPopupCSgvp)`
    
    Optional attached popup.
    
    #### Declaration
    
    Swift
    
    ```
    public private(set) var popup: MTTextPopup? { get }
    ```
    
-   `[annotationView](#/s:11MapTilerSDK8MTMarkerC14annotationViewAA018MTCustomAnnotationF0CSgvp)`
    
    Optional attached custom annotation.
    
    #### Declaration
    
    Swift
    
    ```
    weak public private(set) var annotationView: MTCustomAnnotationView? { get }
    ```
    
-   `[init(coordinates:anchor:offset:opacity:opacityWhenCovered:rotation:rotationAlignment:pitchAlignment:scale:subpixelPositioning:)](#/s:11MapTilerSDK8MTMarkerC11coordinates6anchor6offset7opacity0H11WhenCovered8rotation0K9Alignment05pitchL05scale19subpixelPositioningACSo22CLLocationCoordinate2DV_AA8MTAnchorOS4dAA0d8RotationL0OAA0d5PitchL0OSdSbtcfc)`
    
    Initializes the marker with the specified position.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        coordinates: CLLocationCoordinate2D,
        anchor: MTAnchor = .center,
        offset: Double = 0.0,
        opacity: Double = 1.0,
        opacityWhenCovered: Double = 0.2,
        rotation: Double = 0.0,
        rotationAlignment: MTMarkerRotationAlignment = .auto,
        pitchAlignment: MTMarkerPitchAlignment = .auto,
        scale: Double = 1.0,
        subpixelPositioning: Bool = true
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>Position of the marker.</p></div></td></tr><tr><td><code><em>anchor</em></code></td><td><div><p>Anchor position for the marker.</p></div></td></tr><tr><td><code><em>offset</em></code></td><td><div><p>Pixel offset from the anchor applied on both axes.</p></div></td></tr></tbody></table>
    
-   `[init(coordinates:popup:anchor:offset:opacity:opacityWhenCovered:rotation:rotationAlignment:pitchAlignment:scale:subpixelPositioning:)](#/s:11MapTilerSDK8MTMarkerC11coordinates5popup6anchor6offset7opacity0I11WhenCovered8rotation0L9Alignment05pitchM05scale19subpixelPositioningACSo22CLLocationCoordinate2DV_AA11MTTextPopupCSgAA8MTAnchorOS4dAA0d8RotationM0OAA0d5PitchM0OSdSbtcfc)`
    
    Initializes the marker with the specified position and text popup.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        coordinates: CLLocationCoordinate2D,
        popup: MTTextPopup?,
        anchor: MTAnchor = .center,
        offset: Double = 0.0,
        opacity: Double = 1.0,
        opacityWhenCovered: Double = 0.2,
        rotation: Double = 0.0,
        rotationAlignment: MTMarkerRotationAlignment = .auto,
        pitchAlignment: MTMarkerPitchAlignment = .auto,
        scale: Double = 1.0,
        subpixelPositioning: Bool = true
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>Position of the marker.</p></div></td></tr><tr><td><code><em>popup</em></code></td><td><div><p>Popup to attach to the marker.</p></div></td></tr><tr><td><code><em>anchor</em></code></td><td><div><p>Anchor position for the marker.</p></div></td></tr><tr><td><code><em>offset</em></code></td><td><div><p>Pixel offset from the anchor applied on both axes.</p></div></td></tr></tbody></table>
    
-   `[init(coordinates:color:icon:draggable:anchor:offset:opacity:opacityWhenCovered:rotation:rotationAlignment:pitchAlignment:scale:subpixelPositioning:)](#/s:11MapTilerSDK8MTMarkerC11coordinates5color4icon9draggable6anchor6offset7opacity0K11WhenCovered8rotation0N9Alignment05pitchO05scale19subpixelPositioningACSo22CLLocationCoordinate2DV_So7UIColorCSgSo7UIImageCSgSbSgAA8MTAnchorOS4dAA0d8RotationO0OAA0d5PitchO0OSdSbtcfc)`
    
    Initializes the marker with the specified position, color/icon and behaviour.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        coordinates: CLLocationCoordinate2D,
        color: UIColor? = .blue,
        icon: UIImage? = nil,
        draggable: Bool? = false,
        anchor: MTAnchor = .center,
        offset: Double = 0.0,
        opacity: Double = 1.0,
        opacityWhenCovered: Double = 0.2,
        rotation: Double = 0.0,
        rotationAlignment: MTMarkerRotationAlignment = .auto,
        pitchAlignment: MTMarkerPitchAlignment = .auto,
        scale: Double = 1.0,
        subpixelPositioning: Bool = true
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>Position of the marker.</p></div></td></tr><tr><td><code><em>color</em></code></td><td><div><p>Color of the marker.</p></div></td></tr><tr><td><code><em>icon</em></code></td><td><div><p>Icon for the marker.</p></div></td></tr><tr><td><code><em>draggable</em></code></td><td><div><p>Boolean indicating whether the marker is draggable.</p></div></td></tr><tr><td><code><em>anchor</em></code></td><td><div><p>Anchor position for the marker.</p></div></td></tr><tr><td><code><em>offset</em></code></td><td><div><p>Pixel offset from the anchor applied on both axes.</p></div></td></tr></tbody></table>
    
-   `[init(coordinates:color:icon:draggable:popup:anchor:offset:opacity:opacityWhenCovered:rotation:rotationAlignment:pitchAlignment:scale:subpixelPositioning:)](#/s:11MapTilerSDK8MTMarkerC11coordinates5color4icon9draggable5popup6anchor6offset7opacity0L11WhenCovered8rotation0O9Alignment05pitchP05scale19subpixelPositioningACSo22CLLocationCoordinate2DV_So7UIColorCSgSo7UIImageCSgSbSgAA11MTTextPopupCSgAA8MTAnchorOS4dAA0d8RotationP0OAA0d5PitchP0OSdSbtcfc)`
    
    Initializes the marker with the specified position, color/icon and popup.
    
    #### Declaration
    
    Swift
    
    ```
    public init(
        coordinates: CLLocationCoordinate2D,
        color: UIColor? = .blue,
        icon: UIImage? = nil,
        draggable: Bool? = false,
        popup: MTTextPopup?,
        anchor: MTAnchor = .center,
        offset: Double = 0.0,
        opacity: Double = 1.0,
        opacityWhenCovered: Double = 0.2,
        rotation: Double = 0.0,
        rotationAlignment: MTMarkerRotationAlignment = .auto,
        pitchAlignment: MTMarkerPitchAlignment = .auto,
        scale: Double = 1.0,
        subpixelPositioning: Bool = true
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>Position of the marker.</p></div></td></tr><tr><td><code><em>color</em></code></td><td><div><p>Color of the marker.</p></div></td></tr><tr><td><code><em>icon</em></code></td><td><div><p>Icon for the marker.</p></div></td></tr><tr><td><code><em>draggable</em></code></td><td><div><p>Boolean indicating whether the marker is draggable.</p></div></td></tr><tr><td><code><em>popup</em></code></td><td><div><p>Popup to attach to the marker.</p></div></td></tr><tr><td><code><em>anchor</em></code></td><td><div><p>Anchor position for the marker.</p></div></td></tr><tr><td><code><em>offset</em></code></td><td><div><p>Pixel offset from the anchor applied on both axes.</p></div></td></tr></tbody></table>
    
-   `[setCoordinates(_:in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC14setCoordinates_2in17completionHandlerySo22CLLocationCoordinate2DV_AA9MTMapViewCys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets coordinates for the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setCoordinates(
        _ coordinates: CLLocationCoordinate2D,
        in mapView: MTMapView,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>Position of the marker.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setDelegate(to:)](#/s:11MapTilerSDK8MTMarkerC11setDelegate2toyAA9MTMapViewC_tF)`
    
    Sets marker as map’s delegate.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setDelegate(to mapView: MTMapView)
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view for which to subscribe to.</p></div></td></tr></tbody></table>
    
-   `[attachAnnotationView(_:)](#/s:11MapTilerSDK8MTMarkerC20attachAnnotationViewyyAA08MTCustomfG0CF)`
    
    Attaches custom annotation view to the marker.
    
    Note
    
    Does not add the custom view to the map. Use customAnnotationView.addTo.
    
    #### Declaration
    
    Swift
    
    ```
    public func attachAnnotationView(_ view: MTCustomAnnotationView)
    ```
    
-   `[detachAnnotationView()](#/s:11MapTilerSDK8MTMarkerC20detachAnnotationViewyyF)`
    
    Detaches custom annotation view from the marker.
    
    #### Declaration
    
    Swift
    
    ```
    public func detachAnnotationView()
    ```
    
-   `[setDraggable(_:in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC12setDraggable_2in17completionHandlerySb_AA9MTMapViewCys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets whether the marker is draggable.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setDraggable(
        _ draggable: Bool,
        in mapView: MTMapView,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>draggable</em></code></td><td><div><p>Boolean indicating whether the marker should be draggable.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setOffset(_:in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC9setOffset_2in17completionHandlerySd_AA9MTMapViewCys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets the offset distance from the marker’s anchor.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setOffset(
        _ offset: Double,
        in mapView: MTMapView,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>offset</em></code></td><td><div><p>Pixel offset applied on both axes.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setRotation(_:in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC11setRotation_2in17completionHandlerySd_AA9MTMapViewCys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets the rotation of the marker in degrees.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setRotation(
        _ rotation: Double,
        in mapView: MTMapView,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>rotation</em></code></td><td><div><p>Rotation in degrees.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setRotationAlignment(_:in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC20setRotationAlignment_2in17completionHandleryAA0dfG0O_AA9MTMapViewCys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Sets the rotation alignment of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func setRotationAlignment(
        _ alignment: MTMarkerRotationAlignment,
        in mapView: MTMapView,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>alignment</em></code></td><td><div><p>Rotation alignment relative to map or viewport.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[togglePopup(in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC11togglePopup2in17completionHandleryAA9MTMapViewC_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Toggles the popup bound to the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func togglePopup(
        in mapView: MTMapView,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[remove(from:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC6remove4from17completionHandleryAA9MTMapViewC_ys6ResultOyytAA7MTErrorOGcSgtF)`
    
    Removes the marker from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func remove(
        from mapView: MTMapView,
        completionHandler: ((Result<Void, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getCoordinates(in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC14getCoordinates2in17completionHandleryAA9MTMapViewC_ys6ResultOySo22CLLocationCoordinate2DVAA7MTErrorOGcSgtF)`
    
    Returns current coordinates of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getCoordinates(
        in mapView: MTMapView,
        completionHandler: ((Result<CLLocationCoordinate2D, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getPitchAlignment(in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC17getPitchAlignment2in17completionHandleryAA9MTMapViewC_ys6ResultOyAA0dfG0OAA7MTErrorOGcSgtF)`
    
    Returns the marker’s pitch alignment.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getPitchAlignment(
        in mapView: MTMapView,
        completionHandler: ((Result<MTMarkerPitchAlignment, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getRotation(in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC11getRotation2in17completionHandleryAA9MTMapViewC_ys6ResultOySdAA7MTErrorOGcSgtF)`
    
    Returns the marker’s rotation value.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getRotation(
        in mapView: MTMapView,
        completionHandler: ((Result<Double, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getRotationAlignment(in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC20getRotationAlignment2in17completionHandleryAA9MTMapViewC_ys6ResultOyAA0dfG0OAA7MTErrorOGcSgtF)`
    
    Returns the marker’s rotation alignment.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getRotationAlignment(
        in mapView: MTMapView,
        completionHandler: ((Result<MTMarkerRotationAlignment, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[getOffset(in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC9getOffset2in17completionHandleryAA9MTMapViewC_ys6ResultOySdAA7MTErrorOGcSgtF)`
    
    Returns the marker’s offset value in pixels.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func getOffset(
        in mapView: MTMapView,
        completionHandler: ((Result<Double, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[isDraggable(in:completionHandler:)](#/s:11MapTilerSDK8MTMarkerC11isDraggable2in17completionHandleryAA9MTMapViewC_ys6ResultOySbAA7MTErrorOGcSgtF)`
    
    Returns whether the marker is draggable.
    
    #### Declaration
    
    Swift
    
    ```
    @available(iOS, deprecated: 16.0, message: "Prefer the async version for modern concurrency handling")
    @MainActor
    public func isDraggable(
        in mapView: MTMapView,
        completionHandler: ((Result<Bool, MTError>) -> Void)? = nil
    )
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr><tr><td><code><em>completionHandler</em></code></td><td><div><p>A handler block to execute when function finishes.</p></div></td></tr></tbody></table>
    
-   `[setCoordinates(_:in:)](#/s:11MapTilerSDK8MTMarkerC14setCoordinates_2inySo22CLLocationCoordinate2DV_AA9MTMapViewCtYaF)` Asynchronous
    
    Sets coordinates for the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setCoordinates(_ coordinates: CLLocationCoordinate2D, in mapView: MTMapView) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>coordinates</em></code></td><td><div><p>Position of the marker.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr></tbody></table>
    
-   `[setDraggable(_:in:)](#/s:11MapTilerSDK8MTMarkerC12setDraggable_2inySb_AA9MTMapViewCtYaF)` Asynchronous
    
    Sets whether the marker is draggable.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setDraggable(_ draggable: Bool, in mapView: MTMapView) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>draggable</em></code></td><td><div><p>Boolean indicating whether the marker should be draggable.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr></tbody></table>
    
-   `[setOffset(_:in:)](#/s:11MapTilerSDK8MTMarkerC9setOffset_2inySd_AA9MTMapViewCtYaF)` Asynchronous
    
    Sets the offset distance from the marker’s anchor.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setOffset(_ offset: Double, in mapView: MTMapView) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>offset</em></code></td><td><div><p>Pixel offset applied on both axes.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr></tbody></table>
    
-   `[setRotation(_:in:)](#/s:11MapTilerSDK8MTMarkerC11setRotation_2inySd_AA9MTMapViewCtYaF)` Asynchronous
    
    Sets the rotation of the marker in degrees.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setRotation(_ rotation: Double, in mapView: MTMapView) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>rotation</em></code></td><td><div><p>Rotation in degrees.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr></tbody></table>
    
-   `[setRotationAlignment(_:in:)](#/s:11MapTilerSDK8MTMarkerC20setRotationAlignment_2inyAA0dfG0O_AA9MTMapViewCtYaF)` Asynchronous
    
    Sets the rotation alignment of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func setRotationAlignment(_ alignment: MTMarkerRotationAlignment, in mapView: MTMapView) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>alignment</em></code></td><td><div><p>Rotation alignment relative to map or viewport.</p></div></td></tr><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr></tbody></table>
    
-   `[togglePopup(in:)](#/s:11MapTilerSDK8MTMarkerC11togglePopup2inyAA9MTMapViewC_tYaF)` Asynchronous
    
    Toggles the popup bound to the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func togglePopup(in mapView: MTMapView) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr></tbody></table>
    
-   `[remove(from:)](#/s:11MapTilerSDK8MTMarkerC6remove4fromyAA9MTMapViewC_tYaF)` Asynchronous
    
    Removes the marker from the map.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func remove(from mapView: MTMapView) async
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to apply to.</p></div></td></tr></tbody></table>
    
-   `[getCoordinates(in:)](#/s:11MapTilerSDK8MTMarkerC14getCoordinates2inSo22CLLocationCoordinate2DVAA9MTMapViewC_tYaF)` Asynchronous
    
    Returns current coordinates of the marker.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getCoordinates(in mapView: MTMapView) async -> CLLocationCoordinate2D
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr></tbody></table>
    
-   `[getPitchAlignment(in:)](#/s:11MapTilerSDK8MTMarkerC17getPitchAlignment2inAA0dfG0OAA9MTMapViewC_tYaF)` Asynchronous
    
    Returns the marker’s pitch alignment.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getPitchAlignment(in mapView: MTMapView) async -> MTMarkerPitchAlignment
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr></tbody></table>
    
-   `[getRotation(in:)](#/s:11MapTilerSDK8MTMarkerC11getRotation2inSdAA9MTMapViewC_tYaF)` Asynchronous
    
    Returns the marker’s rotation value.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getRotation(in mapView: MTMapView) async -> Double
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr></tbody></table>
    
-   `[getRotationAlignment(in:)](#/s:11MapTilerSDK8MTMarkerC20getRotationAlignment2inAA0dfG0OAA9MTMapViewC_tYaF)` Asynchronous
    
    Returns the marker’s rotation alignment.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getRotationAlignment(in mapView: MTMapView) async -> MTMarkerRotationAlignment
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr></tbody></table>
    
-   `[getOffset(in:)](#/s:11MapTilerSDK8MTMarkerC9getOffset2inSdAA9MTMapViewC_tYaF)` Asynchronous
    
    Returns the marker’s offset value in pixels.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func getOffset(in mapView: MTMapView) async -> Double
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr></tbody></table>
    
-   `[isDraggable(in:)](#/s:11MapTilerSDK8MTMarkerC11isDraggable2inSbAA9MTMapViewC_tYaF)` Asynchronous
    
    Returns whether the marker is draggable.
    
    #### Declaration
    
    Swift
    
    ```
    @MainActor
    public func isDraggable(in mapView: MTMapView) async -> Bool
    ```
    
    #### Parameters
    
    <table class="graybox"><tbody><tr><td><code><em>mapView</em></code></td><td><div><p>Map view to query.</p></div></td></tr></tbody></table>
    
-   `[addToMap(_:)](#/s:11MapTilerSDK8MTMarkerC05addToA0yyAA9MTMapViewCF)`
    
    Adds marker to map DSL style.
    
    Prefer `[addMarker(_:)](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTMapView/#/s:11MapTilerSDK9MTMapViewC9addMarkeryyAA8MTMarkerCYaF)` instead.
    
    #### Declaration
    
    Swift
    
    ```
    public func addToMap(_ mapView: MTMapView)
    ```
    
-   `[popup(_:)](#/s:11MapTilerSDK8MTMarkerC5popupyACXDAA11MTTextPopupCF)`
    
    Modifier. Sets the `[popup](https://docs.maptiler.com/mobile-sdk/ios/api/Classes/MTMarker/#/s:11MapTilerSDK8MTMarkerC5popupAA11MTTextPopupCSgvp)`.
    
    Note
    
    Not to be used outside of DSL.
    
    #### Declaration
    
    Swift
    
    ```
    @discardableResult
    public func popup(_ value: MTTextPopup) -> Self
    ```
