MTStylable
@MainActor
public protocol MTStylable
Defines methods for map styling methods.
-
setGlyphs(url:
Asynchronousoptions: ) Sets the value of the style’s glyphs property.
Declaration
Swift
@MainActor func setGlyphs(url: URL, options: MTStyleSetterOptions?) async
Parameters
url
URL pointing to the glyphs resource.
options
Style setter options.
-
setLanguage(_:
Asynchronous) Sets the map labels language.
The language generally depends on the style. Whenever a label is not supported in the defined language, it falls back to
Latin
.Declaration
Swift
@MainActor func setLanguage(_ language: MTLanguage) async
Parameters
language
The language to be applied.
-
setLight(_:
Asynchronousoptions: ) Sets the any combination of light values.
Declaration
Swift
@MainActor func setLight(_ light: MTLight, options: MTStyleSetterOptions?) async
Parameters
light
Light options.
options
Style setter options.
-
setShouldRenderWorldCopies(_:
Asynchronous) Sets the state where multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude.
Declaration
Swift
@MainActor func setShouldRenderWorldCopies(_ shouldRenderWorldCopies: Bool) async
Parameters
shouldRenderWorldCopies
Boolean indicating whether world copies should be rendered.
-
addMarker(_:
Asynchronous) Adds the marker to the map.
Declaration
Swift
@MainActor func addMarker(_ marker: MTMarker) async
Parameters
marker
Marker to add to the map.
-
addMarkers(_:
AsynchronouswithSingleIcon: ) Adds multiple markers to the map.
Batch adding is preferred way of adding multiple markers to the map.
Declaration
Swift
@MainActor func addMarkers(_ markers: [MTMarker], withSingleIcon: UIImage?) async
Parameters
markers
Markers to be added to the map.
withSingleIcon
Optional single image to use for all markers.
-
removeMarker(_:
Asynchronous) Removes a marker from the map.
Declaration
Swift
@MainActor func removeMarker(_ marker: MTMarker) async
Parameters
marker
Marker to be removed from the map.
-
removeMarkers(_:
Asynchronous) Removes multiple markers from the map.
Batch removing is preferred way of removing multiple markers from the map.
Declaration
Swift
@MainActor func removeMarkers(_ markers: [MTMarker]) async
Parameters
markers
Markers to be removed from the map.
-
enableGlobeProjection()
AsynchronousEnables the globe projection visualization.
Declaration
Swift
@MainActor func enableGlobeProjection() async
-
enableMercatorProjection()
AsynchronousEnables the mercator projection visualization.
Declaration
Swift
@MainActor func enableMercatorProjection() async
-
enableTerrain(exaggerationFactor:
Asynchronous) Enables the 3D terrain visualization.
Note
Default is 1.Declaration
Swift
@MainActor func enableTerrain(exaggerationFactor: Double) async
Parameters
exaggerationFactor
Factor for volume boosting.
-
disableTerrain()
AsynchronousDisables the 3D terrain visualization.
Declaration
Swift
@MainActor func disableTerrain() async
-
setVerticalFieldOfView(degrees:
Asynchronous) Sets the map’s vertical field of view, in degrees.
The internal camera has a default vertical field of view of a wide ~36.86 degrees. In globe mode, such a large FOV reduces the amount of the Earth that can be seen at once and exaggerates the central part, comparably to a fisheye lens. In many cases, a narrower FOV is preferable.
Note
Default is 36.87.Declaration
Swift
@MainActor func setVerticalFieldOfView(degrees: Double) async
Parameters
degrees
The vertical field of view to set, in degrees (0-180).
-
isSourceLoaded(id:
Asynchronous) Returns boolean value indicating whether the source with provided id is loaded.
Declaration
Swift
@MainActor func isSourceLoaded(id: String) async -> Bool
Parameters
id
The id of the source.