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?) asyncParameters
urlURL pointing to the glyphs resource.
optionsStyle 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) asyncParameters
languageThe language to be applied.
-
setLight(_:Asynchronousoptions: ) Sets the any combination of light values.
Declaration
Swift
@MainActor func setLight(_ light: MTLight, options: MTStyleSetterOptions?) asyncParameters
lightLight options.
optionsStyle setter options.
-
setSpace(_:Asynchronous) Sets the space background for globe projection (cubemap/spacebox).
Note
Make sure space is enabled and projection is set to Globe before initializing the map via MTMapOptions.
Declaration
Swift
@MainActor func setSpace(_ space: MTSpaceOption) asyncParameters
spaceSpace configuration or a boolean to enable default.
-
setHalo(_:Asynchronous) Sets the atmospheric halo (glow) around the globe.
Note
Make sure halo is enabled and projection is set to Globe before initializing the map via MTMapOptions.Declaration
Swift
@MainActor func setHalo(_ halo: MTHaloOption) asyncParameters
haloHalo configuration or a boolean to enable default.
-
disableHaloAnimations()AsynchronousDisables state transitions/animations for halo updates.
Declaration
Swift
@MainActor func disableHaloAnimations() async -
disableSpaceAnimations()AsynchronousDisables state transitions/animations for space updates.
Declaration
Swift
@MainActor func disableSpaceAnimations() async -
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) asyncParameters
shouldRenderWorldCopiesBoolean indicating whether world copies should be rendered.
-
addMarker(_:Asynchronous) Adds the marker to the map.
Declaration
Swift
@MainActor func addMarker(_ marker: MTMarker) asyncParameters
markerMarker 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?) asyncParameters
markersMarkers to be added to the map.
withSingleIconOptional single image to use for all markers.
-
removeMarker(_:Asynchronous) Removes a marker from the map.
Declaration
Swift
@MainActor func removeMarker(_ marker: MTMarker) asyncParameters
markerMarker 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]) asyncParameters
markersMarkers 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) asyncParameters
exaggerationFactorFactor 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) asyncParameters
degreesThe 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 -> BoolParameters
idThe id of the source.