Map Display

  • Declaration

    Swift

    extension AggregatingMapMetricsMonitorService: MapMetricsMonitorService
    extension AggregatingMapMetricsMonitorService: MapMetricsObserver
    extension AggregatingMapMetricsMonitorService: ContinuousMapMetricsMonitorService
  • Base protocol for any Annotation: polygon, line, circle, marker etc.

    See more

    Declaration

    Swift

    public protocol Annotation
  • Base protocol for AnnotationOptions

    Declaration

    Swift

    public protocol AnnotationOptions
  • A protocol that defines map annotation actions.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol AnnotationsActions
  • Annotation service error.

    See more

    Declaration

    Swift

    public enum AnnotationServiceError : Error
    extension AnnotationServiceError: LocalizedError
  • Cache configuration for caching both tiles and styles.

    It provides control over the system memory and disk capacity used for caching, as well as the maximum cache duration for style resources and a mapping of cache durations to corresponding request URL filters. Unlike style caching, the tiles’ cache duration is handled by the server, utilizing the max-age header.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct CacheConfiguration
    extension CacheConfiguration: Equatable
  • A protocol that defines camera actions.

    See more

    Declaration

    Swift

    public protocol CameraActions
  • Represents camera events.

    See more

    Declaration

    Swift

    public enum CameraEvent
    extension CameraEvent: Event
  • A type that represents CameraProperties: position, zoom, tilt and rotation

    See more

    Declaration

    Swift

    public struct CameraProperties
  • A type that represents camera tracking modes.

    See more

    Declaration

    Swift

    public enum CameraTrackingMode : Equatable
  • The CameraUpdate class specifies the map view’s camera position, zoom, tilt, rotation and more.

    There are two ways to set a camera update:

    • Call TomTomMap.applyCamera(_:, animationDuration:, completion:) or TomTomMap.moveCamera(_:) which sets the camera update with a corresponding animation for the former or no animation for the latter.

    • Set it directly through the MapView, i.e.: mapView.cameraUpdate = CameraUpdate(position: .AMSTERDAM, zoom: 11).

    Each method has its limitations:

    • When calling applyCamera(_:, animationDuration:, completion:) and moveCamera(_:) through the TomTomMap, there are certain CameraUpate properties that can and cannot be used in conjunction with others:

    init(position:zoom:tilt:rotation:positionMarkerVerticalOffset:scale:fieldOfView:):

    • zoom - cannot be used together with scale.
    • scale - cannot be used together with zoom.

    init(zoomBy:zoomIn:zoomOut:tiltBy:rotateBy:moveBy:fieldOfViewChangeBy:):

    • zoomBy - cannot be used together with zoomIn or zoomOut.
    • zoomIn- cannot be used together with zoomOut or zoomBy.
    • zoomOut- cannot be used together with zoomIn or zoomBy.
    • moveBy - cannot be used together with any of the other properties.

      • When setting directly the cameraUpdate field through the MapView, no animation is applied and only these specific properties can be set:
    • position.

    • zoom - cannot be used together with scale.

    • tilt.

    • rotation.

    • scale - cannot be used together with zoom.

    • fieldOfView.

    • moveBy - cannot be used together with any of the other properties.

    See more

    Declaration

    Swift

    public struct CameraUpdate : Equatable
  • Represents the circle on the map.

    See more

    Declaration

    Swift

    public class Circle : Annotation
  • A type that represents circle options.

    See more

    Declaration

    Swift

    public struct CircleOptions : AnnotationOptions, Equatable
  • View Model for CompassButton.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public class CompassButtonViewModel
  • The camera configuration for a given distance to the next instruction on the route. Intermediate values are obtained by linear interpolation between the corresponding points.

    See more

    Declaration

    Swift

    public struct ControlPoint : Equatable
  • Coordinate along line.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct CoordinateAlongLine : Equatable
  • The coordinate region.

    See more

    Declaration

    Swift

    public struct CoordinateBounds
  • CopyrightsServiceProtocol defines a method used to obtain the copyright informations.

    See more

    Declaration

    Swift

    public protocol CopyrightsService
  • Provides control over current location button, use it to manage visibility and the icon of it.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public class CurrentLocationButtonViewModel
  • Declaration

    Swift

    extension DaichiRouteService: MapInteractionObserver
  • Dash length units.

    Declaration

    Swift

    public typealias DashLengthUnits = Double
  • Declaration

    Swift

    extension DefaultLocationService: LocationUpdateObserver
    extension DefaultLocationService: CLLocationManagerDelegate
  • Declaration

    Swift

    extension DefaultMapMetricsMonitorService: MapMetricsMonitorService
    extension DefaultMapMetricsMonitorService: MapMetricsObserver
  • Declaration

    Swift

    extension DefaultRouteService: MapInteractionObserver
  • Declaration

    Swift

    extension DoubleTapAndPanGestureContainer: UIGestureRecognizerDelegate
  • Declaration

    Swift

    extension DoubleTapGestureContainer: UIGestureRecognizerDelegate
  • A type that represents a set of coordinates and the padding around them.

    See more

    Declaration

    Swift

    public struct FitToCoordinatesOptions : Equatable
  • The configuration for follow camera operators.

    See more

    Declaration

    Swift

    public struct FollowCameraOperatorConfig : Equatable
  • Declaration

    Swift

    extension GeoJSONInnerPolygonOptions: Equatable
  • Declaration

    Swift

    extension GeoJSONMarkerOptions: Equatable
  • Declaration

    Swift

    extension GeoJSONRouteInstruction: Equatable
  • Declaration

    Swift

    extension GestureMessage: Equatable
  • Defines the gesture state.

    See more

    Declaration

    Swift

    public enum GestureState
  • An OptionSet that defines available gestures for ExclusiveGestureManager.

    See more

    Declaration

    Swift

    public struct GestureType : OptionSet, Hashable
  • Options that defines inner polygon. Can be used with PolygonOverlayOptions.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public class InnerPolygonOptions : AnnotationOptions
  • The Layer protocol that represents map layer.

    See more

    Declaration

    Swift

    public class Layer
  • Type of this layer.

    See more

    Declaration

    Swift

    public enum LayerType
  • Represents the line on the map.

    See more

    Declaration

    Swift

    public class Line : Annotation
  • Line cap placement

    See more

    Declaration

    Swift

    public enum LineCapPlacement
  • Line cap type.

    See more

    Declaration

    Swift

    public enum LineCapType
  • Line join type.

    See more

    Declaration

    Swift

    public enum LineJoinType
  • Line options.

    See more

    Declaration

    Swift

    public struct LineOptions : AnnotationOptions, Equatable
  • Line outline style.

    See more

    Declaration

    Swift

    public enum LineOutlineStyle
  • Line pattern.

    See more

    Declaration

    Swift

    public struct LinePattern : Equatable
  • Line pattern repeat.

    See more

    Declaration

    Swift

    public enum LinePatternRepeat
  • Line pattern type.

    See more

    Declaration

    Swift

    public enum LinePatternType
  • Line unit.

    See more

    Declaration

    Swift

    public enum LineUnit
  • Type to control location features.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol LocationActions
  • Types of the location marker visualization.

    See more

    Declaration

    Swift

    public enum LocationIndicator : Equatable
  • LogoViewModel is responsible for managing the visibility state of a logo within a user interface.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public final class LogoViewModel
  • Declaration

    Swift

    extension LongPressGestureContainer: UIGestureRecognizerDelegate
  • MapActions defines a set of methods closely connected to the map.

    See more

    Declaration

    Swift

    public protocol MapActions
  • Provides methods to fetch copyrights and caption.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    final public class MapCopyrights
  • The methods that an object adopts to manage callout views for a MapView.

    See more

    Declaration

    Swift

    public protocol MapDataSource : AnyObject
  • Methods for managing map interactions and events.

    See more

    Declaration

    Swift

    public protocol MapDelegate : AnyObject
  • The MapDisplayDataProvider protocol that can be used to add custom data providers. FileOutput - Default logger output - prints logs using Swift.print

    Important

    This API has to be implemented in a thread-safe way.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol MapDisplayDataProvider
  • A cancellable task of a data provider which gathers the resource.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol MapDisplayDataRequestToken
  • MapGestureDisableOption An option set defining the map gestures to be disabled.

    See more

    Declaration

    Swift

    public enum MapGestureDisableOption
  • Describes possible cases of MapInteractionEvent.

    See more

    Declaration

    Swift

    public enum MapInteraction
    extension MapInteraction: Event
  • Allows the user to configure the initial parameters of the map.

    MapOptions is used in conjunction with MapViewinitialization, i.e: When creating a MapView, it is possible to pass a MapOptions object to configure the MapView before it is showing on the screen, for example, creating a MapView object with the default TomTom style, and a dark style mode: let mapOptions = MapOptions(mapStyle: .defaultStyle, apiKey: "your-key", styleMode: .dark) let mapView = MapView(mapOptions: mapOptions)

    Creating a MapView without passing a MapOptions object, will result in the MapView being created using the deafult values. In such case, the API Key that will be used for the map will be taken from MapsDisplayService.apiKey.

    See more

    Declaration

    Swift

    public class MapOptions : NSObject
  • MapMetalRendererFrameCaptureDelegate exposes possibility to get currently drawn frame as a texture. Using this delegate may have impact of performance rendering.

    See more

    Declaration

    Swift

    public protocol MapRendererFrameCaptureDelegate : AnyObject
  • Class to add a key for the map. The key must be injected before a MapView can be used.

    • Example: “” func application(_: UIApplication, didFinishLaunchingWithOptions _: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { MapsDisplayService.apiKey = “MAP_KEY” […] return true }
    - Important: This is a Public Preview API. It may be changed or removed at any time.
    
    See more

    Declaration

    Swift

    final public class MapsDisplayService
  • Protobuf-encoded map tile data. The format of the tile data is formally described using the protobuf schema available on: https://developer.tomtom.com/map-display-api/documentation/vector/content#schema-data

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct MapTile
  • Describes options to request map tiles for given zoom and coordinate.

    Detailed explanation of values can be found on: https://developer.tomtom.com/map-display-api/documentation/zoom-levels-and-tile-grid

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct MapTileOptions : Equatable
  • The MapView object to wrap the underlying map renderer.

    It contains the map created by the renderer in the view hierarchy and provides UI and view life-cycle functionalities. The view can be created programmatically, via xib or storyboards.

    For example, displaying a simple MapView programmatically using a constraints-based layout:

    Initialization:

    lazy var mapView: MapView = {
      let mapOptions = MapOptions(mapStyle: .defaultStyle, apiKey: "your-key")
      let mapView = MapView(mapOptions: mapOptions)
      return mapView
    }()
    

    Layout:

    mapView.translatesAutoresizingMaskIntoConstraints = false
    view.addSubview(mapView)
    NSLayoutConstraint.activate([
      mapView.widthAnchor.constraint(equalTo: view.widthAnchor),
      mapView.heightAnchor.constraint(equalTo: view.heightAnchor),
    ])
    

    Setting up the receival of life-cycle events and updates, as well as setting the initial zoom and position of the map view:

    mapView.delegate = self
    mapView.cameraUpdate = .init(position: .AMSTERDAM, zoom: 13)
    

    There will also be a need to conform your UIViewController to MapViewDelegate and implement the required methods.

    See more

    Declaration

    Swift

    @objc
    @MainActor
    open class MapView : UIView
  • The MapViewDelegate protocol defines a set of methods that can be implemented to receive events and updates related to the MapView life cycle.

    See more

    Declaration

    Swift

    public protocol MapViewDelegate : AnyObject
  • Enumeration of TomTomMap View errors.

    See more

    Declaration

    Swift

    public enum MapViewError : LocalizedError
  • Represents the marker on the map.

    See more

    Declaration

    Swift

    public class Marker : Annotation
  • Options that define label inside marker. Can be used with MarkerOptions.

    See more

    Declaration

    Swift

    public struct MarkerLabelOptions : AnnotationOptions, Equatable
  • A type that represents marker options.

    See more

    Declaration

    Swift

    public struct MarkerOptions : AnnotationOptions, Equatable
  • The Metadata is used to carry extra information.

    See more

    Declaration

    Swift

    public struct Metadata
  • Declaration

    Swift

    extension MichiCameraClient: NKTCameraOperatorDelegate
  • Declaration

    Swift

    extension MichiLocationClient: NKTPositionMarkerClickedDelegate
  • The offset of the line to be created.

    Declaration

    Swift

    public typealias OffsetUnits = Double
  • The OnDiskCachePolicy sets rules for caching: time interval of storing the cache, maximum cache size, etc.

    See more

    Declaration

    Swift

    public enum OnDiskCachePolicy : Equatable
  • The cache which is being used while fetching map tiles.

    See more

    Declaration

    Swift

    public enum OnlineCachePolicy
    extension OnlineCachePolicy: Equatable
  • Responsible for creating instances of MapDisplayDataProvider for handling online map tile requests.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public enum OnlineTileDataProviderFactory
  • Outline width scene.

    See more

    Declaration

    Swift

    public struct OutlineWidthScene : Equatable
  • Declaration

    Swift

    extension PanGestureContainer: UIGestureRecognizerDelegate
  • Pattern begin offset scene.

    See more

    Declaration

    Swift

    public struct PatternBeginOffsetScene : Equatable
  • Pattern length scene.

    See more

    Declaration

    Swift

    public struct PatternLengthScene : Equatable
  • Declaration

    Swift

    extension PinchGestureContainer: UIGestureRecognizerDelegate
  • Represents the polygon on the map.

    See more

    Declaration

    Swift

    public class Polygon : Annotation
  • The PolygonError enum contains possible errors that can occurs during Polygon init.

    See more

    Declaration

    Swift

    public enum PolygonError : Error
    extension PolygonError: LocalizedError
  • Polygon options.

    See more

    Declaration

    Swift

    public struct PolygonOptions : AnnotationOptions, Equatable
  • A polygon overlay can be built by setting the outer area color and adding inner polygons. Only one inner polygon is supported, but the inner polygons can be nested. Example:

       let innerOptions = InnerPolygonOptions(fillColor: .red
                                          coordinates: coordinates)
    
       innerOptions.nestedPolygonOptions = InnerPolygonOptions(
           fillColor: UIColor.blue,
           coordinates: coordinates
       )
    
       let polygonOptions = PolygonOverlayOptions(outerColor: .green,
                                              innerPolygonOptions: innerOptions)
    
       try? mapView.map.addPolygonOverlay(options: polygonOptions)
    

    }

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public class PolygonOverlay : Annotation
  • Options for creating a PolygonOverlay.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public class PolygonOverlayOptions : AnnotationOptions
  • Defines size for chevron or pointer for particular zoom level.

    See more

    Declaration

    Swift

    public struct PositionMarkerSize
    extension PositionMarkerSize: Equatable
  • RenderedFeature class

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public struct RenderedFeature
  • Rendered Feature Actions protocol.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol RenderedFeatureActions
  • Rendered features query.

    See more

    Declaration

    Swift

    public struct RenderedFeatureQueryOptions
  • Reserve coordinate.

    See more

    Declaration

    Swift

    public struct ReserveCoordinate : Equatable
  • Declaration

    Swift

    extension RotateGestureContainer: UIGestureRecognizerDelegate
  • A Route representation which can be added and displayed on the map.

    To show a Route on the map, call the TomTomMap.addRoute(RouteOptions) method. You can configure its shape and appearance with the RouteOptions class. Drawing a Route on the map requires a list with coordinates of the Route points.

    See more

    Declaration

    Swift

    public class Route
  • Protocol allowing management of the route representation on the map.

    See more

    Declaration

    Swift

    public protocol RouteActions
  • RouteDelegate.

    See more

    Declaration

    Swift

    public protocol RouteDelegate : AnyObject
  • Enumeration of route errors.

    See more

    Declaration

    Swift

    public enum RouteError : LocalizedError
  • Route instruction.

    See more

    Declaration

    Swift

    public struct RouteInstruction
  • Class that contains configuration of the route that will be drawn on the map.

    Example:

    let routeOption: RouteOptions = RouteOptions(coordinates: route.geometry)
    guard let mapRoute = try? self.mapView.map.addRoute(routeOption) else { return }
    
    See more

    Declaration

    Swift

    public struct RouteOptions
  • A model that represents a part of the road under some special conditions, i.e., a tunnel or a non-drivable road, with a respective range. This model describes these road segments, and then passes these segments to RouteOptions as part of the route’s configuration that is drawn on the map.

    See more

    Declaration

    Swift

    public struct RouteSection
  • Defines the properties for scale view. Whenever the map is zoomed in or out, the scale appears and is visible until there are no interactions with the map for at least 5 seconds. The scale view also disappears when the map is tilted or when the scale is out of range. Range for metric measurement system: 10m-1000km Range for imperial measurement system: 30ft-600mi

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public class ScaleViewModel
  • Scene color.

    See more

    Declaration

    Swift

    public struct SceneColor : Equatable
  • Scene level where the specified color should be used.

    Declaration

    Swift

    public typealias SceneLevel = Double
  • The SourceCollection

    See more

    Declaration

    Swift

    public struct SourceCollection
  • This class provides a container for tiles sources information and map layers.

    See more

    Declaration

    Swift

    public final class Style
  • Holder struct for main and dark version of the style definition. If darkStyle is not provided, setting TomTomMap.styleMode has no effect.

    See more

    Declaration

    Swift

    public struct StyleContainer
    extension StyleContainer: Equatable
  • The map style definition. For style file format see map style specification. Style Specification is a formal definition of all properties that define the map’s appearance.

    See more

    Declaration

    Swift

    public enum StyleDefinition
    extension StyleDefinition: Equatable
  • Declaration

    Swift

    extension StyleFetcherError: Equatable
    extension StyleFetcherError: LocalizedError
  • Defines the map styles available to the user.

    See more

    Declaration

    Swift

    public enum StyleMode
  • Declaration

    Swift

    extension TapGestureContainer: UIGestureRecognizerDelegate
  • Text anchoring

    See more

    Declaration

    Swift

    public enum TextAnchoring
  • Type that represents texture options.

    See more

    Declaration

    Swift

    public struct TextureOptions : Equatable
  • Tile source definition. Details can be found: https://github.com/mapbox/tilejson-spec

    Declaration

    Swift

    public struct TilesDefinition
  • Declaration

    Swift

    extension TiltGestureContainer: UIGestureRecognizerDelegate
  • Default implementation of CopyrightsService.

    See more

    Declaration

    Swift

    final public class TomTomCopyrightsService : CopyrightsService
  • The TomTomMap class serves as the foundational class, acting as the primary gateway for integrating a multitude of map-related features. It offers a rich set of functionalities enabling developer interaction with the map and customizing its behavior.

    TomTomMap can be accessed in several ways through the MapView class:

    • Through the property mapView.map.
    • By calling mapView.getMapAsync, i.e., mapView.getMapAsync { map in // do something with map }
    • By assigning mapView.onMapReadyCallback, i.e., mapView.onMapReadyCallback = { map in // do something with map }
    • By defining mapView(_:, onMapReady:) through the MapDelegate, i.e., func mapView(_: MapView, onMapReady map: TomTomMap) { // do something with the map } In most cases, the preferred way to access the map would be through the property mapView.map, but in some cases where the map should be ready first, such as when calling showVehicleRestrictions(vehicle:) the preferred way would be mapView.getMapAsync or mapView.onMapReadyCallback.
    See more

    Declaration

    Swift

    public class TomTomMap : AnnotationsActions, RouteActions, MapActions
    extension TomTomMap: CameraActions
    extension TomTomMap: RenderedFeatureActions
    extension TomTomMap: VehicleActions, LocationActions
  • The traffic category icon.

    See more

    Declaration

    Swift

    public enum TrafficIconCategory
  • Represents traffic incident details.

    See more

    Declaration

    Swift

    public struct TrafficIncident
  • Protocol that defines method that will be performed when user clicked on traffic incidents icon.

    See more

    Declaration

    Swift

    public protocol TrafficIncidentObserver : Observer
  • The traffic magnitude.

    See more

    Declaration

    Swift

    public enum TrafficMagnitude
  • Declaration

    Swift

    extension TwoFingerTapGestureContainer: UIGestureRecognizerDelegate
  • Defines available actions according to vehicle restriction feature.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public protocol VehicleActions
  • Defines map visible region as CLLocationCoordinate2D coordinates.

    See more

    Declaration

    Swift

    public struct VisibleRegion
  • Width scene.

    See more

    Declaration

    Swift

    public struct WidthScene : Equatable
  • ZoomControlsViewModel serves as the view model layer for managing the zoom controls within a map interface.

    Important

    This is a Public Preview API. It may be changed or removed at any time.
    See more

    Declaration

    Swift

    public final class ZoomControlsViewModel