-
Undocumented
Declaration
Swift
public private(set) weak var styleManager: StyleManager! { get }
-
Adds a
layer
to the mapThrows
StyleError or type conversion errors
Declaration
Swift
public func addLayer(_ layer: Layer, layerPosition: LayerPosition? = nil) throws
Parameters
layer
The layer to apply on the map
layerPosition
Position at which to add the map.
-
Gets a
layer
from the mapThrows
StyleError or type conversion errors
Declaration
Swift
public func layer<T>(withId id: String) throws -> T where T : Layer
Parameters
layerID
The id of the layer to be fetched
type
The type of the layer that will be fetched
Return Value
The fully formed
layer
object of type equal totype
-
Gets a
layer
from the map.This function is useful if you do not know the concrete type of the layer you are fetching, or don’t need to know for your situation.
Throws
StyleError or type conversion errors
Parameters
layerID
The id of the layer to be fetched
type
The type of the layer that will be fetched
Return Value
The fully formed
layer
object of type equal totype
-
Updates a layer that exists in the style already
Throws
StyleError or type conversion errors
Declaration
Swift
public func updateLayer<T>(withId id: String, update: (inout T) throws -> Void) throws where T : Layer
Parameters
id
identifier of layer to update
type
Type of the layer
update
Closure that mutates a layer passed to it
-
Gets the value of style layer property.
Declaration
Swift
public func layerProperty(for layerId: String, property: String) -> Any
Parameters
layerId
Style layer identifier.
property
Style layer property name.
Return Value
The value of the property in the layer with layerId.
-
Adds a source to the map
Throws
StyleError or type conversion errors
Declaration
Swift
public func addSource(_ source: Source, id: String) throws
Parameters
source
The source to add to the map.
identifier
A unique source identifier.
-
Retrieves a source from the map
Throws
StyleError or type conversion errorsDeclaration
Swift
public func source<T>(withId id: String) throws -> T where T : Source
Parameters
identifier
The id of the source to retrieve
type
The type of the source
Return Value
The fully formed
source
object of type equal totype
. -
Retrieves a source from the map
This function is useful if you do not know the concrete type of the source you are fetching, or don’t need to know for your situation.
Throws
StyleError or type conversion errorsParameters
identifier
The id of the source to retrieve
type
The type of the source
Return Value
The fully formed
source
object of type equal totype
. -
Gets the value of style source property.
Declaration
Swift
public func sourceProperty(for sourceId: String, property: String) -> Any
Parameters
sourceId
Style source identifier.
property
Style source property name.
Return Value
The value of the property in the source with sourceId.
-
Updates the
data
property of a givenGeoJSONSource
with a new value conforming to theGeoJSONObject
protocol.Throws
StyleError or type conversion errors
Attention
This method is only effective with sources of
GeoJSONSource
type, and cannot be used to update other source types.Declaration
Swift
public func updateGeoJSONSource<T>(withId id: String, geoJSON: T) throws where T : GeoJSONObject
Parameters
id
The identifier representing the GeoJSON source.
geoJSON
The new GeoJSON to be associated with the source data. i.e. a feature or feature collection.
-
Gets the value of a style light property.
Declaration
Swift
public func lightProperty(_ property: String) -> Any
Parameters
property
Style light property name.
Return Value
Style light property value.
-
Gets the value of a style terrain property.
Declaration
Swift
public func terrainProperty(_ property: String) -> Any
Parameters
property
Style terrain property name.
Return Value
Style terrain property value.
-
This function creates an expression that will localize the
textField
property of aSymbolLayer
Declaration
Swift
public func localizeLabels(into locale: Locale, forLayerIds layerIds: [String]? = nil) throws
Parameters
locale
The
Locale
to update the map tolayerIds
An optional list of ids that need to be localized. If
nil
is provided, all layers will be updated
-
Declaration
Swift
public var isLoaded: Bool { get }
-
Declaration
Swift
public var uri: StyleURI? { get set }
-
Declaration
Swift
public var JSON: String { get set }
-
Declaration
Swift
public var defaultCamera: CameraOptions { get }
-
Declaration
Swift
public var transition: TransitionOptions { get set }
-
Declaration
Swift
public func addLayer(with properties: [String : Any], layerPosition: LayerPosition?) throws
-
Declaration
Swift
public func _addPersistentLayer(with properties: [String : Any], layerPosition: LayerPosition?) throws
-
Declaration
Swift
public func _isPersistentLayer(id: String) throws -> Bool
-
Declaration
Swift
public func _addPersistentCustomLayer(withId id: String, layerHost: CustomLayerHost, layerPosition: LayerPosition?) throws
-
Declaration
Swift
public func addCustomLayer(withId id: String, layerHost: CustomLayerHost, layerPosition: LayerPosition?) throws
-
Declaration
Swift
public func removeLayer(withId id: String) throws
-
Declaration
Swift
public func layerExists(withId id: String) -> Bool
-
Declaration
Swift
public var allLayerIdentifiers: [LayerInfo] { get }
-
Declaration
Swift
public func _layerProperty(for layerId: String, property: String) -> StylePropertyValue
-
Declaration
Swift
public func setLayerProperty(for layerId: String, property: String, value: Any) throws
-
Declaration
Swift
public static func _layerPropertyDefaultValue(for layerType: String, property: String) -> StylePropertyValue
-
Declaration
Swift
public func layerProperties(for layerId: String) throws -> [String : Any]
-
Declaration
Swift
public func setLayerProperties(for layerId: String, properties: [String : Any]) throws
-
Declaration
Swift
public func addSource(withId id: String, properties: [String : Any]) throws
-
Declaration
Swift
public func removeSource(withId id: String) throws
-
Declaration
Swift
public func sourceExists(withId id: String) -> Bool
-
Declaration
Swift
public var allSourceIdentifiers: [SourceInfo] { get }
-
Declaration
Swift
public func _sourceProperty(for sourceId: String, property: String) -> StylePropertyValue
-
Declaration
Swift
public func setSourceProperty(for sourceId: String, property: String, value: Any) throws
-
Declaration
Swift
public func sourceProperties(for sourceId: String) throws -> [String : Any]
-
Declaration
Swift
public func setSourceProperties(for sourceId: String, properties: [String : Any]) throws
-
Declaration
Swift
public static func _sourcePropertyDefaultValue(for sourceType: String, property: String) -> StylePropertyValue
-
Declaration
Swift
public func updateImageSource(withId id: String, image: UIImage) throws
-
Declaration
Swift
public func addImage(_ image: UIImage, id: String, sdf: Bool = false, stretchX: [ImageStretches] = [], stretchY: [ImageStretches] = [], content: ImageContent? = nil) throws
-
Declaration
Swift
public func removeImage(withId id: String) throws
-
Declaration
Swift
public func image(withId id: String) -> UIImage?
-
Declaration
Swift
public func setLight(properties: [String : Any]) throws
-
Declaration
Swift
public func _lightProperty(_ property: String) -> StylePropertyValue
-
Declaration
Swift
public func setLightProperty(_ property: String, value: Any) throws
-
Declaration
Swift
public func setTerrain(properties: [String : Any]) throws
-
Declaration
Swift
public func _terrainProperty(_ property: String) -> StylePropertyValue
-
Declaration
Swift
public func setTerrainProperty(_ property: String, value: Any) throws
-
Declaration
Swift
public func addCustomGeometrySource(withId id: String, options: CustomGeometrySourceOptions) throws
-
Declaration
Swift
public func _setCustomGeometrySourceTileData(forSourceId sourceId: String, tileId: CanonicalTileID, features: [Turf.Feature]) throws
-
Declaration
Swift
public func invalidateCustomGeometrySourceTile(forSourceId sourceId: String, tileId: CanonicalTileID) throws
-
Declaration
Swift
public func invalidateCustomGeometrySourceRegion(forSourceId sourceId: String, bounds: CoordinateBounds) throws