MapViewDelegate

public protocol MapViewDelegate : AnyObject

Delegate for receiving map view lifecycle and interaction events.

  • mapView(_:didTouchAtPoint:) Default implementation

    Called when the user taps the map at the given screen point.

    Default Implementation

    Declaration

    Swift

    func mapView(_ mapView: MapView, didTouchAtPoint point: CGPoint)

    Parameters

    mapView

    The map view that received the touch.

    point

    The screen coordinate of the touch.

  • mapViewLoaded(_:style:data:) Default implementation

    Called when the map view finishes loading its style and map data.

    Note

    This signals that the map’s content (style and points of interest) is ready. The initial camera is applied once the view has a non-zero size - i.e. after it has been laid out in the view hierarchy. If the view is not yet attached or sized when this fires, centerCoordinate may still reflect the default until the first layout pass completes.

    Default Implementation

    Declaration

    Swift

    func mapViewLoaded(_ mapView: MapView, style: MLNStyle, data: MapData)

    Parameters

    mapView

    The map view that finished loading.

    style

    The MapLibre style that was applied.

    data

    The map data loaded from the Wemap platform.