MapView

@MainActor
public class MapView : MLNMapView

MapLibre methods

  • Show the attribution action sheet.

    This action is performed when the user taps on the attribution button provided by default via the attributionButton property. If you implement a custom attribution button, you should add this action to the button.

    Declaration

    Swift

    @MainActor
    override func showAttribution(_ sender: Any)
  • Changes the center coordinate and zoom level of the map with some additional padding on each side and animates the change. For animated changes, wait until the map view has finished loading before calling this method.

    Note

    The behavior of this method is undefined if called in response to UIApplicationWillTerminateNotification.

    Declaration

    Swift

    @MainActor
    func setCenter(_ coordinate: CLLocationCoordinate2D, zoomLevel: Double, edgePadding: UIEdgeInsets, direction: CLLocationDirection? = nil, animated: Bool = true)

    Parameters

    coordinate

    The new center coordinate for the map.

    zoomLevel

    The new zoom level for the map.

    edgePadding

    The minimum padding (in screen points) that will be visible around the given coordinate.

    direction

    The new direction for the map, measured in degrees relative to true north. A negative value as well as nil leaves the map’s direction unchanged. Default is nil

    animated

    Specify true if you want the map view to animate scrolling and zooming to the new location or false if you want the map to display the new location immediately. Default is true