MapTiler SDK Swift API Reference
Actors
The following actors are available globally.
Classes
The following classes are available globally.
-
Subclassable view for adding custom annotations to the map.
See moreDeclaration
Swift
@MainActor open class MTCustomAnnotationView : UIView, @preconcurrency MTAnnotationextension MTCustomAnnotationView: @preconcurrency MTMapViewContent -
Annotation element that can be added to the map.
See moreDeclaration
Swift
public class MTMarker : MTAnnotation, MTMapViewContent, @unchecked Sendable -
Declaration
Swift
public class MTTextPopup : MTAnnotation, MTMapViewContent, @unchecked Sendable -
Basic benchmarking class.
See moreDeclaration
Swift
@MainActor public final class MTBenchmark : MTMapViewDelegate -
Object representing the map on the screen.
Exposes methods and properties that enable changes to the map, and fires events that can be interacted with.
See moreDeclaration
Swift
@MainActor open class MTMapView : UIView, Sendableextension MTMapView: MTControllableextension MTMapView: MTNavigableextension MTMapView: MTRenderingextension MTMapView: MTStylableextension MTMapView: MTZoomableextension MTMapView: MTLocationManagerDelegate -
Helper for creating a heatmap visualization layer from data and styling options.
See moreDeclaration
Swift
public final class MTHeatmapLayerHelper : MTVectorLayerHelper, @unchecked Sendable -
Helper for creating a point visualization layer from data and styling options.
Uses the current style to create the underlying source and layers.
See moreDeclaration
Swift
public final class MTPointLayerHelper : MTVectorLayerHelper, @unchecked Sendable -
Helper for creating a polygon (fill) visualization layer from data and styling options.
See moreDeclaration
Swift
public final class MTPolygonLayerHelper : MTVectorLayerHelper, @unchecked Sendable -
Helper for creating a polyline (line) visualization layer from data and styling options.
See moreDeclaration
Swift
public final class MTPolylineLayerHelper : MTVectorLayerHelper, @unchecked Sendable -
Logger class used for SDK logs.
See moreDeclaration
Swift
public class MTLogger -
Class responsible for location updates.
See moreDeclaration
Swift
public class MTLocationManager : NSObject, @preconcurrency CLLocationManagerDelegate -
Service responsible for gesture handling and state.
See moreDeclaration
Swift
@MainActor public class MTGestureService -
Sets combination of center, bearing and pitch, as well as roll and elevation.
See moreDeclaration
Swift
public class MTMapCameraHelper -
The proxy object for the current map style.
Set of convenience methods for style, sources and layers manipulation. MTStyle is nil until map loading is complete. Since it is loaded asynchronously it should be manipulated only after
See moreMTEvent.didLoadtriggers.Declaration
Swift
@MainActor public class MTStyle -
The background style layer covers the entire map. Use a background style layer to configure a color or pattern to show below all other map content. If the background layer is transparent or omitted from the style, any part of the map view that does not show another style layer is transparent.
See moreDeclaration
Swift
public class MTBackgroundLayer : MTLayer, @unchecked Sendable, Codable -
An image source.
The
See moreurlvalue contains the image location. Thecoordinatesarray contains [longitude, latitude] pairs for the image corners listed in clockwise order: top left, top right, bottom right, bottom left.Declaration
Swift
public class MTImageSource : MTSource, @unchecked Sendable -
A raster DEM source. Only supports Terrain RGB.
See moreDeclaration
Swift
public class MTRasterDEMSource : MTTileSource, @unchecked Sendable -
A raster tile source.
For raster tiles hosted by MapTiler, the “url” value should be of the form https://api.maptiler.com/tiles/[tilesetid]/tiles.json?key=
See moreDeclaration
Swift
public class MTRasterTileSource : MTTileSource, @unchecked Sendable -
Undocumented
See moreDeclaration
Swift
public class MTVectorTileSource : MTTileSource, @unchecked Sendable -
A video source.
The
See moreurlsvalue is an array. For each URL in the array, a video element source will be created. Thecoordinatesarray contains [longitude, latitude] pairs for the video corners listed in clockwise order: top left, top right, bottom right, bottom left.Declaration
Swift
public class MTVideoSource : MTSource, @unchecked Sendable -
Swift wrapper over the MapTiler SDK ColorRamp class.
See moreDeclaration
Swift
@MainActor public final class MTColorRamp : @unchecked Sendable
Enumerations
The following enumerations are available globally.
-
Anchor positions for marker placement.
See moreDeclaration
Swift
public enum MTAnchor : String, Sendable, Codable -
Alignment for marker rotation relative to map or viewport.
See moreDeclaration
Swift
public enum MTMarkerRotationAlignment : String, Sendable, Codable -
Alignment for marker pitch relative to map or viewport.
See moreDeclaration
Swift
public enum MTMarkerPitchAlignment : String, Sendable, Codable -
Represents all the errors that can occur in the MapTiler SDK.
All methods within the SDK throw MTError.
See moreDeclaration
Swift
public enum MTError : Error -
SDK log level.
See moreDeclaration
Swift
public enum MTLogLevel : Sendable, Equatable -
Type of log messages in the SDK.
See moreDeclaration
Swift
public enum MTLogType : Sendable -
Events triggered by the SDK
See moreDeclaration
Swift
public enum MTEvent : String -
Language of the map labels.
See moreDeclaration
Swift
public enum MTLanguage : Sendable, Codable -
Custom language options.
See moreDeclaration
Swift
public enum MTSpecialLanguage : String, Sendable, Codable -
Languages available for MTMapView object.
See moreDeclaration
Swift
public enum MTCountryLanguage : String, Sendable, Codable, CaseIterable -
Enum representing MTLocationManager errors.
See moreDeclaration
Swift
public enum MTLocationError : Error -
Units of measurement used in MTMapView object.
See moreDeclaration
Swift
public enum MTUnit : String, Sendable -
Gesture types available in the SDK.
See moreDeclaration
Swift
@MainActor public enum MTGestureType -
Controls which map events are forwarded from the map object.
- essential: Low-frequency lifecycle events only (ready, load, moveend, etc.) plus taps.
- cameraOnly: Forwards only camera events (move, zoom) in addition to minimal lifecycle.
- all: Default. Forwards all events including high-frequency move/zoom/touch/render (use with caution on low-end devices).
- off: Minimal wiring to keep internal lifecycle (ready/load) functioning; all other events are suppressed.
Declaration
Swift
public enum MTEventLevel : String, Codable, Sendable -
Performance-oriented presets for MapTiler Swift SDK.
See moreDeclaration
Swift
public enum MTPerformancePresets -
Padding values accepted by
See moreMTFitBoundsOptions.Declaration
Swift
public enum MTFitBoundsPadding : Sendable, Codable, Equatable -
Helper to construct common style expressions without raw strings.
See moreDeclaration
Swift
public enum MTExpression -
Commonly-used feature keys
See moreDeclaration
Swift
public enum MTFeatureKey : String, Sendable -
Helper to construct common filter expressions without raw strings.
See moreDeclaration
Swift
public enum MTFilter -
Typed keys for circle paint properties.
See moreDeclaration
Swift
public enum MTCirclePaintProperty : String, Sendable -
Typed keys for symbol layout properties.
See moreDeclaration
Swift
public enum MTSymbolLayoutProperty : String, Sendable -
Typed keys for symbol paint properties.
See moreDeclaration
Swift
public enum MTSymbolPaintProperty : String, Sendable -
Orientation of the circle when map is pitched.
See moreDeclaration
Swift
public enum MTCirclePitchAlignment : String -
Controls the scaling behavior of the circle when the map is pitched.
See moreDeclaration
Swift
public enum MTCirclePitchScale : String -
Controls the frame of reference for circle translate.
See moreDeclaration
Swift
public enum MTCircleTranslateAnchor : String -
Enum controlling the frame of reference for fill translate.
See moreDeclaration
Swift
public enum MTFillTranslateAnchor : String -
Controls the frame of reference for fill-extrusion translate.
See moreDeclaration
Swift
public enum MTFillExtrusionTranslateAnchor : String -
Direction of light source when map is rotated.
See moreDeclaration
Swift
public enum MTHillshadeIlluminationAnchor : String -
The display of line endings.
See moreDeclaration
Swift
public enum MTLineCap : String -
The display of lines when joining.
See moreDeclaration
Swift
public enum MTLineJoin : String -
Controls the frame of reference for line translate.
See moreDeclaration
Swift
public enum MTLineTranslateAnchor : String -
Types of layers.
See moreDeclaration
Swift
public enum MTLayerType : String, Codable -
Enum representing the visibility of the layer.
See moreDeclaration
Swift
public enum MTLayerVisibility : String -
Resampling/interpolation method to use for overscaling.
See moreDeclaration
Swift
public enum MTRasterResampling : String, Codable, Sendable -
Defines purpose and guidelines on what information is displayed.
See moreDeclaration
Swift
public enum MTMapReferenceStyle : Identifiable, Hashable, Sendable -
Variants of the reference styles.
See moreDeclaration
Swift
public enum MTMapStyleVariant : String, Sendable, CaseIterable, Identifiable -
A typed value container
See moreDeclaration
Swift
public enum MTPropertyValue : Sendable -
Represents the exceptions raised by the MTStyle object.
See moreDeclaration
Swift
public enum MTStyleError : Error -
A unified style value that may be a constant or an expression.
See moreDeclaration
Swift
public enum MTStyleValue : Sendable -
A scheme used for tiles.
See moreDeclaration
Swift
public enum MTTileScheme : String -
Encoding used by the Raster DEM source.
See moreDeclaration
Swift
public enum MTRasterDEMEncoding : String, Sendable -
Declaration
Swift
public enum MTSourceType : String, Codable -
Symbol text anchor positions.
See moreDeclaration
Swift
public enum MTTextAnchor : String, Sendable -
Common text field tokens
See moreDeclaration
Swift
public enum MTTextToken : String, Sendable -
Representing the control of the change rate of the animation.
See moreDeclaration
Swift
public enum MTEasing : String, Sendable, Codable -
Option that can enable default halo or configure it.
See moreDeclaration
Swift
public enum MTHaloOption : Sendable, Codable -
Sets whether extruded geometries are lit relative to the map or viewport.
See moreDeclaration
Swift
public enum MTLightAnchor : String, Sendable, Codable -
Represents corners of the map.
See moreDeclaration
Swift
public enum MTMapCorner : String, Sendable, Codable -
Type of projection the map uses.
See moreDeclaration
Swift
public enum MTProjectionType : String, Sendable, Codable -
Predefined cubemap presets for space backgrounds.
See moreDeclaration
Swift
public enum MTSpacePreset : String, Sendable, Codable, CaseIterable -
Option that can enable default space or configure it.
See moreDeclaration
Swift
public enum MTSpaceOption : Sendable, Codable -
Resampling methods supported by MapTiler SDK.
See moreDeclaration
Swift
public enum MTColorRampResampleMethod : String, Sendable, Codable, CaseIterable -
Built-in presets shipped with the SDK.
See moreDeclaration
Swift
public enum MTColorRampPreset : String, Sendable, Codable, CaseIterable
-
Either a numeric value or zoom-ramped numeric values.
See moreDeclaration
Swift
public enum MTNumberOrZoomNumberValues : Codable, Sendable -
Either a string value or zoom-ramped string values.
See moreDeclaration
Swift
public enum MTStringOrZoomStringValues : Codable, Sendable -
Either a numeric value or property-mapped numeric values.
See moreDeclaration
Swift
public enum MTNumberOrPropertyValues : Codable, Sendable -
Heatmap radius can be a number, zoom-ramped numbers, or property-mapped numbers.
See moreDeclaration
Swift
public enum MTRadiusOption : Codable, Sendable
-
Represents a dash pattern that can be provided as an array of numbers or as a string pattern composed of underscores and spaces (e.g. “___ _ ”).
See moreDeclaration
Swift
public enum MTDashArrayValue : Codable, Sendable -
Expression element used to build MapTiler style expressions for sky values.
See moreDeclaration
Swift
public enum MTSkyExpression : Sendable, Codable, Equatable -
Represents a color or expression for the sky configuration.
See moreDeclaration
Swift
public enum MTSkyColorValue : Sendable, Codable, Equatable -
Represents a numeric value or expression for the sky configuration.
See moreDeclaration
Swift
public enum MTSkyNumberValue : Sendable, Codable, Equatable
Extensions
The following extensions are available globally.
-
Declaration
Swift
extension UIColor -
Declaration
Swift
extension CLLocationCoordinate2D: @retroactive Equatableextension CLLocationCoordinate2D: Codable
Protocols
The following protocols are available globally.
-
Protocol requirements for all annotation objects.
See moreDeclaration
Swift
public protocol MTAnnotation : Sendable -
Base protocol adopted by vector layer helpers to share defaults and common option normalization logic.
See moreDeclaration
Swift
public protocol MTVectorLayerHelper : AnyObject -
Protocol requirement for all Logger objects.
See moreDeclaration
Swift
public protocol MTLoggable : Sendable -
Protocol requirements for location manager.
See moreDeclaration
Swift
@MainActor public protocol MTLocationManagerDelegate : AnyObject -
Defines methods for adding the map controls.
See moreDeclaration
Swift
@MainActor public protocol MTControllable -
Defines methods for navigating the map.
See moreDeclaration
Swift
@MainActor public protocol MTNavigable -
Defines methods for adjusting rendering parameters.
See moreDeclaration
Swift
@MainActor public protocol MTRendering -
Defines methods for map styling methods.
See moreDeclaration
Swift
@MainActor public protocol MTStylable -
Defines methods for manipulating zoom level.
See moreDeclaration
Swift
@MainActor public protocol MTZoomable -
Defines gestures behaviour.
See moreDeclaration
Swift
@MainActor public protocol MTGesture -
Map view content requirements.
See moreDeclaration
Swift
public protocol MTMapViewContent -
Delegate responsible for map event propagation
See moreDeclaration
Swift
@MainActor public protocol MTMapViewDelegate : AnyObject -
Protocol requirements for all types of Layers.
See moreDeclaration
Swift
public protocol MTLayer : AnyObject, MTMapViewContent, Sendable -
Protocol requirements for all types of Sources.
See moreDeclaration
Swift
public protocol MTSource : AnyObject, MTMapViewContent, Sendable
Structures
The following structures are available globally.
-
Represents body of the MTError exception.
See moreDeclaration
Swift
public struct MTException : Sendable -
Color wrapper.
See moreDeclaration
Swift
public struct MTColor : Sendable, Codable, Equatable -
Options for building a heatmap visualization layer through the helper.
See moreDeclaration
Swift
public struct MTHeatmapLayerOptions : Codable, Sendable -
Options for building a point visualization layer through the helper.
Mirrors the available configuration including common shape options.
See moreDeclaration
Swift
public struct MTPointLayerOptions : Codable, Sendable -
Options for building a polygon (fill) visualization layer through the helper.
See moreDeclaration
Swift
public struct MTPolygonLayerOptions : Codable, Sendable -
Options for building a polyline (line) visualization layer through the helper.
See moreDeclaration
Swift
public struct MTPolylineLayerOptions : Codable, Sendable -
Log object used with MTLogger.
See moreDeclaration
Swift
public struct MTLog -
Map view content builder.
See moreDeclaration
Swift
@resultBuilder public struct MTMapContentBuilder -
Parameters of the map object.
See moreDeclaration
Swift
public struct MTMapOptions : Sendableextension MTMapOptions: Codable -
Declarative Map view for use in SwiftUI
See moreDeclaration
Swift
@MainActor public struct MTMapViewContainer : View -
Provides animation options for navigation functions.
See moreDeclaration
Swift
public struct MTAnimationOptions : Sendable, Codable -
Options for controlling the desired location, zoom, bearing, and pitch of the camera.
See moreDeclaration
Swift
public struct MTCameraOptions : Sendableextension MTCameraOptions: Codable -
Options for drag and pan gesstures.
See moreDeclaration
Swift
public struct MTDragPanOptions : Sendable, Codable -
Options that configure how the map fits to a set of bounds.
See moreDeclaration
Swift
public struct MTFitBoundsOptions : Sendable, Codable -
Options describing the destination and animation of the flyTo transition.
See moreDeclaration
Swift
public struct MTFlyToOptions : Sendable, Codable -
Options for setting padding on calls to map methods.
See moreDeclaration
Swift
public struct MTPaddingOptions : Sendable, Codable, Equatable -
Supporting type to add validation to another style related type.
See moreDeclaration
Swift
public struct MTStyleSetterOptions : Sendable, Codable -
Configuration that controls how an image is registered within the MapTiler style.
See moreDeclaration
Swift
public struct MTStyleImageOptions : Codable, Equatable, Sendable -
Represents rectangular geographic bounds defined by southwest and northeast corners.
See moreDeclaration
Swift
public struct MTBounds : Sendable, Codable, Equatable -
Object sent together with MTEvent.
See moreDeclaration
Swift
public struct MTData : Codable -
One stop in the halo radial gradient: position in [0,1] and color.
See moreDeclaration
Swift
public struct MTHaloStop : Sendable, Codable -
Configuration for the atmospheric glow (halo).
See moreDeclaration
Swift
public struct MTHalo : Sendable, Codable -
A style’s light property provides a global light source for that style.
See moreDeclaration
Swift
public struct MTLight : Sendable, Codable -
Two numbers representing x and y screen coordinates in pixels.
See moreDeclaration
Swift
public struct MTPoint : Codable, Sendable -
The style spec representation of the source if the event has a dataType of source .
See moreDeclaration
Swift
public struct MTSourceData : Codable -
Faces definition for a custom cubemap.
See moreDeclaration
Swift
public struct MTSpaceFaces : Sendable, Codable -
Path-based configuration for cubemap files.
This fetches all images from a path, this assumes all files are named px, nx, py, ny, pz, nz and suffixed with the appropriate extension specified in format.
See moreDeclaration
Swift
public struct MTSpacePath : Sendable, Codable -
Configuration for the “space” background.
See moreDeclaration
Swift
public struct MTSpace : Sendable, Codable -
RGBA color represented by 0…255 components.
See moreDeclaration
Swift
public struct MTRGBAColor : Sendable, Codable -
A stop describing the value and color to apply.
See moreDeclaration
Swift
public struct MTColorRampStop : Sendable, Codable -
Bounds of a color ramp.
See moreDeclaration
Swift
public struct MTColorRampBounds : Sendable, Codable -
Options used when instantiating a color ramp.
See moreDeclaration
Swift
public struct MTColorRampOptions : Sendable, Codable -
Options for rendering the ramp to a canvas strip.
See moreDeclaration
Swift
public struct MTColorRampCanvasStripOptions : Sendable, Codable -
Array-based stop definition for
See morefromArrayDefinition.Declaration
Swift
public struct MTColorRampArrayStop : Sendable, Codable -
A single string value at a given zoom level.
See moreDeclaration
Swift
public struct MTZoomStringValue : Codable, Sendable -
A single numeric value at a given zoom level.
See moreDeclaration
Swift
public struct MTZoomNumberValue : Codable, Sendable -
A single mapping from a property value to an associated numeric value.
See moreDeclaration
Swift
public struct MTHelperPropertyValue : Codable, Sendable
-
Encodes a color to a hex string when converted to JSON. Accepts either a hex color string (e.g. “#RRGGBB”) or a UIColor.
See moreDeclaration
Swift
public struct MTColorValue : Codable, Sendable -
Sky configuration used by
See moremap.setSky.Declaration
Swift
public struct MTSky : Sendable, Codable, Equatable