MTMapOptions

public struct MTMapOptions : @unchecked Sendable
extension MTMapOptions: Codable

Parameters of the map object.

  • The language of the map.

    This applies only for the map instance, supersedes the primaryLanguage from config.

    Declaration

    Swift

    public private(set) var language: MTLanguage? { get }
  • The geographical centerpoint of the map.

    If center is not specified, SDK will look for it in the map style object. If it is not specified in the style, it will default to (latitude: 0.0, longitude: 0.0).

    Declaration

    Swift

    public private(set) var center: CLLocationCoordinate2D? { get }
  • Projection type of the map object.

    This will overwrite the projection property from the style (if any).

    Declaration

    Swift

    public private(set) var projection: MTProjectionType? { get }
  • The zoom level of the map.

    If zoom is not specified, SDK will look for it in the map style object. If it is not specified in the style, it will default to 0.0.

    Declaration

    Swift

    public private(set) var zoom: Double? { get }
  • The maximum zoom level of the map (0-24).

    Declaration

    Swift

    public private(set) var maxZoom: Double? { get }
  • The minimum zoom level of the map (0-24).

    Declaration

    Swift

    public private(set) var minZoom: Double? { get }
  • The bearing of the map, measured in degrees counter-clockwise from north.

    If bearing is not specified, SDK will look for it in the map style object. If it is not specified in the style, it will default to 0.0.

    Declaration

    Swift

    public private(set) var bearing: Double? { get }
  • The threshold, measured in degrees, that determines when the map’s bearing will snap to north.

    Declaration

    Swift

    public private(set) var bearingSnap: Double? { get }
  • The pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-85).

    If pitch is not specified, SDK will look for it in the map style object. If it is not specified in the style, it will default to 0.0.

    Declaration

    Swift

    public private(set) var pitch: Double? { get }
  • The maximum pitch of the map (0-180).

    Declaration

    Swift

    public private(set) var maxPitch: Double? { get }
  • The minimum pitch of the map (0-85).

    Declaration

    Swift

    public private(set) var minPitch: Double? { get }
  • The roll angle of the map, measured in degrees counter-clockwise about the camera boresight.

    If roll is not specified, SDK will look for it in the map style object. If it is not specified in the style, it will default to 0.0.

    Declaration

    Swift

    public private(set) var roll: Double? { get }
  • Boolean indicating whether the map’s roll control with “drag to rotate” interaction is enabled.

    Declaration

    Swift

    public private(set) var rollIsEnabled: Bool? { get }
  • The elevation of the geographical centerpoint of the map, in meters above sea level.

    If elevation is not specified, SDK will look for it in the map style object. If it is not specified in the style, it will default to 0.0.

    Declaration

    Swift

    public private(set) var elevation: Double? { get }
  • Boolean indicating whether 3D terrain is enabled.

    Declaration

    Swift

    public private(set) var terrainIsEnabled: Bool? { get }
  • 3D terrain exaggeration factor.

    Declaration

    Swift

    public private(set) var terrainExaggeration: Double? { get }
  • Determines whether to cancel, or retain, tiles from the current viewport which are still loading but which belong to a farther (smaller) zoom level than the current one.

    If true, when zooming in, tiles which didn’t manage to load for previous zoom levels will become canceled. This might save some computing resources for slower devices, but the map details might appear more abruptly at the end of the zoom. If false, when zooming in, the previous zoom level(s) tiles will progressively appear, giving a smoother map details experience. However, more tiles will be rendered in a short period of time.

    Declaration

    Swift

    public private(set) var cancelPendingTileRequestsWhileZooming: Bool? { get }
  • Boolen indicating whether center is clamped to the ground.

    If true, the elevation of the center point will automatically be set to the terrain elevation (or zero if terrain is not enabled). If false, the elevation of the center point will default to sea level and will not automatically update. Needs to be set to false to keep the camera above ground when pitch > 90 degrees.

    Declaration

    Swift

    public private(set) var isCenterClampedToGround: Bool? { get }
  • Boolean indicating whether Resource Timing API information will be collected.

    Declaration

    Swift

    public private(set) var shouldCollectResourceTiming: Bool? { get }
  • Boolean indicating whether cross source collisions are enabled.

    If true, symbols from multiple sources can collide with each other during collision detection. If false, collision detection is run separately for the symbols in each source.

    Declaration

    Swift

    public private(set) var crossSourceCollisionsAreEnabled: Bool? { get }
  • The duration of the fade-in/fade-out animation for label collisions, in milliseconds.

    This setting affects all symbol layers. This setting does not affect the duration of runtime styling transitions or raster tile cross-fading.

    Declaration

    Swift

    public private(set) var fadeDuration: Double? { get }
  • Undocumented

    Declaration

    Swift

    public private(set) var isInteractionEnabled: Bool? { get }
  • A value representing the position of the MapTiler wordmark on the map.

    Declaration

    Swift

    public private(set) var logoPosition: MTMapCorner? { get }
  • Boolean indicating whether MapTiler logo is visible on the map.

    If true, the MapTiler logo will be shown. false will only work on premium accounts

    Declaration

    Swift

    public private(set) var maptilerLogoIsVisible: Bool? { get }
  • The maximum number of tiles stored in the tile cache for a given source.

    If omitted, the cache will be dynamically sized based on the current viewport.

    Declaration

    Swift

    public private(set) var maxTileCacheSize: Double? { get }
  • The maximum number of zoom levels for which to store tiles for a given source.

    Tile cache dynamic size is calculated by multiplying maxTileCacheZoomLevels with the approximate number of tiles in the viewport for a given source.

    Declaration

    Swift

    public private(set) var maxTileCacheZoomLevels: Double? { get }
  • Boolean indicating whether the map’s pitch control with drag to rotate interaction will be disabled.

    Declaration

    Swift

    public private(set) var shouldPitchWithRotate: Bool? { get }
  • Boolean indicating whether the map won’t attempt to re-request tiles once they expire.

    Declaration

    Swift

    public private(set) var shouldRefreshExpiredTiles: Bool? { get }
  • Boolean indicating whether multiple copies of the world will be rendered side by side beyond -180 and 180 degrees longitude.

    Declaration

    Swift

    public private(set) var shouldRenderWorldCopies: Bool? { get }
  • Boolean indicating whether the drag to pitch" nteraction is enabled.

    Declaration

    Swift

    public private(set) var shouldDragToPitch: Bool? { get }
  • Boolean indicating whether the pinch to rotate and zoom interaction is enabled.

    Declaration

    Swift

    public private(set) var shouldPinchToRotateAndZoom: Bool? { get }
  • Boolean indicating whether the double tap to zoom interaction is enabled.

    Declaration

    Swift

    public private(set) var doubleTapShouldZoom: Bool? { get }
  • Boolean indicating whether the drag to pan interaction is enabled.

    Declaration

    Swift

    public private(set) var dragPanIsEnabled: Bool? { get }
  • Boolean indicating whether the drag to rotate interaction is enabled.

    Declaration

    Swift

    public private(set) var dragRotateIsEnabled: Bool? { get }
  • Boolean indicating whether style should be validated.

    Useful in production environment.

    Declaration

    Swift

    public private(set) var shouldValidateStyle: Bool? { get }
  • Boolean indicating whether minimap control is added directly to the map.

    Declaration

    Swift

    public private(set) var minimapIsVisible: Bool? { get }
  • Boolean indicating whether attribution control is added directly to the map.

    Declaration

    Swift

    public private(set) var attributionControlIsVisible: Bool? { get }
  • Boolean indicating whether geolocate control is added directly to the map.

    Declaration

    Swift

    public private(set) var geolocateControlIsVisible: Bool? { get }
  • Boolean indicating whether navigation control is added directly to the map.

    Declaration

    Swift

    public private(set) var navigationControlIsVisible: Bool? { get }
  • Boolean indicating whether projection control is added directly to the map.

    Declaration

    Swift

    public private(set) var projectionControlIsVisible: Bool? { get }
  • Boolean indicating whether scale control is added directly to the map.

    Declaration

    Swift

    public private(set) var scaleControlIsVisible: Bool? { get }
  • Boolean indicating whether terrain control is added directly to the map.

    Declaration

    Swift

    public private(set) var terrainControlIsVisible: Bool? { get }
  • Boolean indicating whether session logic is enabled.

    This allows MapTiler to enable “session based billing”.

    Note

    Defaults to true.

    See also

    https://docs.maptiler.com/guides/maps-apis/maps-platform/what-is-map-session-in-maptiler-cloud/

    Declaration

    Swift

    public private(set) var isSessionLogicEnabled: Bool { get }
  • Initializes the map options with center and zoom.

    Declaration

    Swift

    public init(center: CLLocationCoordinate2D?, zoom: Double?)
  • Initializes the map options with center, zoom and terrain.

    Declaration

    Swift

    public init(center: CLLocationCoordinate2D?, zoom: Double?, terrainIsEnabled: Bool?, terrainExaggeration: Double?)
  • Initializes the map options with center, zoom and projection.

    Declaration

    Swift

    public init(center: CLLocationCoordinate2D?, zoom: Double?, projection: MTProjectionType?)
  • Initializes the map options with center, zoom, bearing, and pitch.

    Declaration

    Swift

    public init(center: CLLocationCoordinate2D?, zoom: Double?, bearing: Double?, pitch: Double?)
  • Initializes the map options.

    Declaration

    Swift

    public init(
        language: MTLanguage? = nil,
        center: CLLocationCoordinate2D? = nil,
        projection: MTProjectionType? = nil,
        zoom: Double? = nil,
        maxZoom: Double? = nil,
        minZoom: Double? = nil,
        bearing: Double? = nil,
        bearingSnap: Double? = nil,
        pitch: Double? = nil,
        maxPitch: Double? = nil,
        minPitch: Double? = nil,
        roll: Double? = nil,
        rollIsEnabled: Bool? = nil,
        elevation: Double? = nil,
        terrainIsEnabled: Bool? = nil,
        terrainExaggeration: Double? = nil,
        cancelPendingTileRequestsWhileZooming: Bool? = nil,
        isCenterClampedToGround: Bool? = nil,
        shouldCollectResourceTiming: Bool? = nil,
        crossSourceCollisionsAreEnabled: Bool? = nil,
        fadeDuration: Double? = nil,
        isInteractionEnabled: Bool? = nil,
        logoPosition: MTMapCorner? = nil,
        maptilerLogoIsVisible: Bool? = nil,
        maxTileCacheSize: Double? = nil,
        maxTileCacheZoomLevels: Double? = nil,
        shouldPitchWithRotate: Bool? = nil,
        shouldRefreshExpiredTiles: Bool? = nil,
        shouldRenderWorldCopies: Bool? = nil,
        shouldDragToPitch: Bool? = nil,
        shouldPinchToRotateAndZoom: Bool? = nil,
        doubleTapShouldZoom: Bool? = nil,
        dragPanIsEnabled: Bool? = nil,
        dragRotateIsEnabled: Bool? = nil,
        shouldValidateStyle: Bool? = nil,
        minimapIsVisible: Bool? = false,
        attributionControlIsVisible: Bool? = nil,
        geolocateControlIsVisible: Bool? = false,
        navigationControlIsVisible: Bool? = false,
        projectionControlIsVisible: Bool? = false,
        scaleControlIsVisible: Bool? = false,
        terrainControlIsVisible: Bool? = false,
        isSessionLogicEnabled: Bool = true
    )