AMLMapViewState

public class AMLMapViewState : ObservableObject

Object to track state changes.

  • The underlying MGLMapView

    Declaration

    Swift

    @Published
    public var mapView: MGLMapView? { get set }
  • The current heading of the map in degrees.

    Declaration

    Swift

    @Published
    public var heading: CLLocationDirection { get set }
  • Current zoom level of the map.

    Declaration

    Swift

    @Published
    public var zoomLevel: Double { get set }
  • The coordinate bounds of the currently displayed area of the map.

    Declaration

    Swift

    @Published
    public var bounds: MGLCoordinateBounds { get set }
  • The center coordinates of the currently displayed area of the map.

    Declaration

    Swift

    @Published
    public var center: CLLocationCoordinate2D { get set }
  • The user’s current location. Setting this will trigger an OS prompt for location sharing permission.

    Declaration

    Swift

    @Published
    public var userLocation: CLLocationCoordinate2D? { get set }
  • Features that are displayed on the map.

    Declaration

    Swift

    @Published
    public var features: [MGLPointFeature] { get set }
  • The attribution string for the map data providers.

    Declaration

    Swift

    @Published
    public var attribution: String? { get set }
  • Whether the attribution test is currently being displayed.

    Declaration

    Swift

    @Published
    internal(set) public var isAttributionTextDisplayed: Bool { get set }
  • Create an AMLMapViewState object to track state changes.

    Declaration

    Swift

    public init(
        mapView: MGLMapView? = nil,
        heading: CLLocationDirection = 0,
        zoomLevel: Double = 14,
        bounds: MGLCoordinateBounds = .init(),
        center: CLLocationCoordinate2D = .init(
            latitude: 47.62246,
            longitude: -122.336775
        ),
        userLocation: CLLocationCoordinate2D? = nil,
        features: [MGLPointFeature] = [],
        attribution: String? = nil
    )

    Parameters

    mapView

    The underlying MGLMapView

    heading

    The current heading of the map in degrees. Default is 0 (North).

    zoomLevel

    Current zoom level of the map. Default is 14.

    bounds

    The coordinate bounds of the currently displayed area of the map. Default is an empty MGLCoordinateBounds.

    center

    The center coordinates of the currently displayed area of the map. Default is an empty CLLOcationCoordinate2D.

    userLocation

    The user’s current location. Default is nil. Setting this will trigger an OS prompt for location sharing permission.

    features

    Features that are displayed on the map. Default is []

    attribution

    The attribution string for the map data providers. Default is nil.