AMLMapViewState
public class AMLMapViewState : ObservableObject
Object to track state changes.
-
The underlying
MGLMapViewDeclaration
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
AMLMapViewStateobject 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
mapViewThe underlying
MGLMapViewheadingThe current heading of the map in degrees. Default is
0(North).zoomLevelCurrent zoom level of the map. Default is
14.boundsThe coordinate bounds of the currently displayed area of the map. Default is an empty
MGLCoordinateBounds.centerThe center coordinates of the currently displayed area of the map. Default is an empty
CLLOcationCoordinate2D.userLocationThe user’s current location. Default is
nil. Setting this will trigger an OS prompt for location sharing permission.featuresFeatures that are displayed on the map. Default is
[]attributionThe attribution string for the map data providers. Default is
nil.
View on GitHub
AMLMapViewState Class Reference