-
Undocumented
Declaration
Swift
public private(set) weak var styleManager: StyleManager! { get }
-
Adds a
layerto the mapThrows
StyleError or type conversion errors
Declaration
Swift
public func addLayer(_ layer: Layer, layerPosition: LayerPosition? = nil) throwsParameters
layerThe layer to apply on the map
layerPositionPosition at which to add the map.
-
Gets a
layerfrom the mapThrows
StyleError or type conversion errors
Declaration
Swift
public func layer<T>(withId id: String) throws -> T where T : LayerParameters
layerIDThe id of the layer to be fetched
typeThe type of the layer that will be fetched
Return Value
The fully formed
layerobject of type equal totype -
Gets a
layerfrom 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
layerIDThe id of the layer to be fetched
typeThe type of the layer that will be fetched
Return Value
The fully formed
layerobject 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 : LayerParameters
ididentifier of layer to update
typeType of the layer
updateClosure that mutates a layer passed to it
-
Gets the value of style layer property.
Declaration
Swift
public func layerProperty(for layerId: String, property: String) -> AnyParameters
layerIdStyle layer identifier.
propertyStyle 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) throwsParameters
sourceThe source to add to the map.
identifierA 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 : SourceParameters
identifierThe id of the source to retrieve
typeThe type of the source
Return Value
The fully formed
sourceobject 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
identifierThe id of the source to retrieve
typeThe type of the source
Return Value
The fully formed
sourceobject of type equal totype. -
Gets the value of style source property.
Declaration
Swift
public func sourceProperty(for sourceId: String, property: String) -> AnyParameters
sourceIdStyle source identifier.
propertyStyle source property name.
Return Value
The value of the property in the source with sourceId.
-
Updates the
dataproperty of a givenGeoJSONSourcewith a new value conforming to theGeoJSONObjectprotocol.Throws
StyleError or type conversion errors
Attention
This method is only effective with sources of
GeoJSONSourcetype, and cannot be used to update other source types.Declaration
Swift
public func updateGeoJSONSource<T>(withId id: String, geoJSON: T) throws where T : GeoJSONObjectParameters
idThe identifier representing the GeoJSON source.
geoJSONThe 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) -> AnyParameters
propertyStyle light property name.
Return Value
Style light property value.
-
Gets the value of a style terrain property.
Declaration
Swift
public func terrainProperty(_ property: String) -> AnyParameters
propertyStyle terrain property name.
Return Value
Style terrain property value.
-
This function creates an expression that will localize the
textFieldproperty of aSymbolLayerDeclaration
Swift
public func localizeLabels(into locale: Locale, forLayerIds layerIds: [String]? = nil) throwsParameters
localeThe
Localeto update the map tolayerIdsAn optional list of ids that need to be localized. If
nilis 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
Style Class Reference