MapView
extension MapView
An extension on MapView that allows for toggling traffic on a map style that contains a Mapbox Traffic source.
-
Returns a Boolean value indicating whether data from the given tile set layers is currently all visible in the map view’s style.
Declaration
Swift
public func showsTileSet(with tileSetIdentifiers: Set<String>, layerIdentifier: String) -> BoolParameters
tileSetIdentifiersIdentifiers of the tile sets in the form
user.tileset.layerIdentifierIdentifier of the layer in the tile set; in other words, a source layer identifier. Not to be confused with a style layer.
-
Shows or hides data from the given tile set layers.
Declaration
Swift
public func setShowsTileSet(_ isVisible: Bool, with tileSetIdentifiers: Set<String>, layerIdentifier: String)Parameters
isVisibleParameter, which controls whether layer should be visible or not.
tileSetIdentifiersIdentifiers of the tile sets in the form
user.tileset.layerIdentifierIdentifier of the layer in the tile set; in other words, a source layer identifier. Not to be confused with a style layer.
-
A Boolean value indicating whether traffic congestion lines are visible in the map view’s style.
Declaration
Swift
public var showsTraffic: Bool { get set } -
A Boolean value indicating whether incidents, such as road closures and detours, are visible in the map view’s style.
Declaration
Swift
public var showsIncidents: Bool { get set }
Install in Dash
MapView Extension Reference