TomTomSDKMapDisplay

  • Declaration

    Swift

    extension MichiCameraClient: NKTCameraOperatorDelegate
  • A protocol that defines camera actions.

    See more

    Declaration

    Swift

    public protocol CameraActions
  • 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
  • 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
  • A type that represents a set of coordinates and the padding around them.

    See more

    Declaration

    Swift

    public struct FitToCoordinatesOptions : Equatable
  • Defines map visible region as CLLocationCoordinate2D coordinates.

    See more

    Declaration

    Swift

    public struct VisibleRegion
  • 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
  • Declaration

    Swift

    extension GestureMessage: Equatable
  • An OptionSet that defines available gestures for ExclusiveGestureManager.

    See more

    Declaration

    Swift

    public struct GestureType : OptionSet, Hashable
  • Describes possible cases of MapInteractionEvent.

    See more

    Declaration

    Swift

    public enum MapInteraction
    extension MapInteraction: Event
  • 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
  • CopyrightsServiceProtocol defines a method used to obtain the copyright informations.

    See more

    Declaration

    Swift

    public protocol CopyrightsService
  • Declaration

    Swift

    extension MichiLocationClient: NKTPositionMarkerClickedDelegate
  • Types of the location marker visualization.

    See more

    Declaration

    Swift

    public enum LocationIndicator : Equatable
  • 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
  • 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
  • The cache which is being used while fetching map tiles.

    See more

    Declaration

    Swift

    public enum OnlineCachePolicy
    extension OnlineCachePolicy: Equatable
  • MapActions defines a set of methods closely connected to the map.

    See more

    Declaration

    Swift

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

    See more

    Declaration

    Swift

    public enum MapGestureDisableOption
  • 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
  • The OnDiskCachePolicy sets rules for caching: time interval of storing the cache, maximum cache size, etc.

    See more

    Declaration

    Swift

    public enum OnDiskCachePolicy : Equatable
  • 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
  • Defines size for chevron or pointer for particular zoom level.

    See more

    Declaration

    Swift

    public struct PositionMarkerSize
    extension PositionMarkerSize: Equatable
  • Defines the map styles available to the user.

    See more

    Declaration

    Swift

    public enum StyleMode
  • The Layer protocol that represents map layer.

    See more

    Declaration

    Swift

    public class Layer
  • The Metadata is used to carry extra information.

    See more

    Declaration

    Swift

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

    See more

    Declaration

    Swift

    public final class Style
  • Declaration

    Swift

    extension StyleFetcherError: Equatable
    extension StyleFetcherError: LocalizedError
  • Base protocol for AnnotationOptions

    Declaration

    Swift

    public protocol AnnotationOptions
  • Base protocol for any Annotation: polygon, line, circle, marker etc.

    See more

    Declaration

    Swift

    public protocol Annotation
  • Declaration

    Swift

    extension GeoJSONMarkerOptions: Equatable
  • Scene level where the specified color should be used.

    Declaration

    Swift

    public typealias SceneLevel = Double
  • The offset of the line to be created.

    Declaration

    Swift

    public typealias OffsetUnits = Double
  • Dash length units.

    Declaration

    Swift

    public typealias DashLengthUnits = Double
  • 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
  • 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
  • Type that represents texture options.

    See more

    Declaration

    Swift

    public struct TextureOptions : Equatable
  • The PolygonError enum contains possible errors that can occurs during Polygon init.

    See more

    Declaration

    Swift

    public enum PolygonError : Error
    extension PolygonError: LocalizedError
  • 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
  • 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 features query.

    See more

    Declaration

    Swift

    public struct RenderedFeatureQueryOptions
  • 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
  • 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
  • Enumeration of route errors.

    See more

    Declaration

    Swift

    public enum RouteError : LocalizedError
  • Protocol allowing management of the route representation on the map.

    See more

    Declaration

    Swift

    public protocol RouteActions
  • 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
  • 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
  • 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
  • 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
    open class MapView : UIView
  • Enumeration of TomTomMap View errors.

    See more

    Declaration

    Swift

    public enum MapViewError : LocalizedError
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Declaration

    Swift

    extension AggregatingMapMetricsMonitorService: MapMetricsMonitorService
    extension AggregatingMapMetricsMonitorService: MapMetricsObserver
    extension AggregatingMapMetricsMonitorService: ContinuousMapMetricsMonitorService
  • Declaration

    Swift

    extension DefaultMapMetricsMonitorService: MapMetricsMonitorService
    extension DefaultMapMetricsMonitorService: MapMetricsObserver
  • Methods for managing map interactions and events.

    See more

    Declaration

    Swift

    public protocol MapDelegate : AnyObject
  • The methods that an object adopts to manage callout views for a MapView.

    See more

    Declaration

    Swift

    public protocol MapDataSource : AnyObject
  • 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