TomTomSDKMapDisplay
-
Declaration
Swift
extension MichiCameraClient: NKTCameraOperatorDelegate
-
A protocol that defines camera actions.
See moreDeclaration
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 moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct ControlPointextension ControlPoint: Equatable
-
The configuration for follow camera operators.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct FollowCameraOperatorConfigextension FollowCameraOperatorConfig: Equatable
-
The
CameraUpdateclass 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:)orTomTomMap.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:)andmoveCamera(_:)through theTomTomMap, there are certainCameraUpateproperties that can and cannot be used in conjunction with others:
init(position:zoom:tilt:rotation:positionMarkerVerticalOffset:scale:fieldOfView:):zoom- cannot be used together withscale.scale- cannot be used together withzoom.
init(zoomBy:zoomIn:zoomOut:tiltBy:rotateBy:moveBy:fieldOfViewChangeBy:):zoomBy- cannot be used together withzoomInorzoomOut.zoomIn- cannot be used together withzoomOutorzoomBy.zoomOut- cannot be used together withzoomInorzoomBy.moveBy- cannot be used together with any of the other properties.- When setting directly the
cameraUpdatefield through theMapView, no animation is applied and only these specific properties can be set:
- When setting directly the
position.zoom- cannot be used together withscale.tilt.rotation.scale- cannot be used together withzoom.fieldOfView.moveBy- cannot be used together with any of the other properties.
Declaration
Swift
public struct CameraUpdate : Equatable -
A type that represents a set of coordinates and the padding around them.
See moreDeclaration
Swift
public struct FitToCoordinatesOptions : Equatable -
Defines map visible region as
See moreCLLocationCoordinate2Dcoordinates.Declaration
Swift
public struct VisibleRegion
-
Defines the gesture state.
See moreDeclaration
Swift
public enum GestureState
-
Declaration
Swift
extension GestureMessage: Equatable
-
An OptionSet that defines available gestures for
See moreExclusiveGestureManager.Declaration
Swift
public struct GestureType : OptionSet, Hashable
-
Declaration
Swift
extension DoubleTapAndPanGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension DoubleTapGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension LongPressGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension PanGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension PinchGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension RotateGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension TapGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension TiltGestureContainer: UIGestureRecognizerDelegate -
Declaration
Swift
extension TwoFingerTapGestureContainer: UIGestureRecognizerDelegate
-
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 }
See more- Important: This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
final public class MapsDisplayService
-
CopyrightsServiceProtocol defines a method used to obtain the copyright informations.
See moreDeclaration
Swift
public protocol CopyrightsService
-
Default implementation of
See moreCopyrightsService.Declaration
Swift
final public class TomTomCopyrightsService : CopyrightsService
-
Declaration
Swift
extension MichiLocationClient: NKTPositionMarkerClickedDelegate
-
Types of the location marker visualization.
See moreDeclaration
Swift
public enum LocationIndicator : Equatable
-
Type to control location features.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol LocationActions
-
Declaration
Swift
extension DefaultLocationService: LocationProviderObservable
-
The cache which is being used while fetching map tiles.
See moreDeclaration
Swift
public enum OnlineCachePolicyextension OnlineCachePolicy: Equatable -
See moreMapActionsdefines a set of methods closely connected to the map.Declaration
Swift
public protocol MapActions -
See moreMapGestureDisableOptionAn option set defining the map gestures to be disabled.Declaration
Swift
public enum MapGestureDisableOption -
Allows the user to configure the initial parameters of the map.
MapOptionsis used in conjunction withMapViewinitialization, i.e: When creating aMapView, it is possible to pass aMapOptionsobject to configure theMapViewbefore it is showing on the screen, for example, creating aMapViewobject 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
See moreMapViewwithout passing aMapOptionsobject, will result in theMapViewbeing created using the deafult values. In such case, the API Key that will be used for the map will be taken fromMapsDisplayService.apiKey.Declaration
Swift
public class MapOptions : NSObject
-
The
See moreOnDiskCachePolicysets rules for caching: time interval of storing the cache, maximum cache size, etc.Declaration
Swift
public enum OnDiskCachePolicy : Equatable
-
Holder struct for main and dark version of the style definition. If
See moredarkStyleis not provided, settingTomTomMap.styleModehas no effect.Declaration
Swift
public struct StyleContainerextension 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 moreDeclaration
Swift
public enum StyleDefinitionextension StyleDefinition: Equatable
-
The
See moreMetadatais used to carry extra information.Declaration
Swift
public struct Metadata
-
Tile source definition. Details can be found: https://github.com/mapbox/tilejson-spec
Declaration
Swift
public struct TilesDefinition
-
The SourceCollection
See moreDeclaration
Swift
public struct SourceCollection
-
This class provides a container for tiles sources information and map layers.
See moreDeclaration
Swift
public final class Style
-
Declaration
Swift
extension StyleFetcherError: Equatableextension StyleFetcherError: LocalizedError
-
Base protocol for
AnnotationOptionsDeclaration
Swift
public protocol AnnotationOptions
-
Base protocol for any
See moreAnnotation: polygon, line, circle, marker etc.Declaration
Swift
public protocol Annotation
-
A type that represents circle options.
See moreDeclaration
Swift
public struct CircleOptions : AnnotationOptions, Equatable
-
Represents the circle on the map.
See moreDeclaration
Swift
public class Circle : 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
-
Line cap placement
See moreDeclaration
Swift
public enum LineCapPlacement
-
Line join type.
See moreDeclaration
Swift
public enum LineJoinType
-
Line pattern type.
See moreDeclaration
Swift
public enum LinePatternType
-
Line pattern repeat.
See moreDeclaration
Swift
public enum LinePatternRepeat
-
Line outline style.
See moreDeclaration
Swift
public enum LineOutlineStyle
-
Line cap type.
See moreDeclaration
Swift
public enum LineCapType
-
Scene color.
See moreDeclaration
Swift
public struct SceneColor : Equatable
-
Width scene.
See moreDeclaration
Swift
public struct WidthScene : Equatable
-
Outline width scene.
See moreDeclaration
Swift
public struct OutlineWidthScene : Equatable
-
Reserve coordinate.
See moreDeclaration
Swift
public struct ReserveCoordinate : Equatable
-
Coordinate along line.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct CoordinateAlongLine : Equatable
-
Line pattern.
See moreDeclaration
Swift
public struct LinePattern : Equatable
-
Pattern length scene.
See moreDeclaration
Swift
public struct PatternLengthScene : Equatable
-
Pattern begin offset scene.
See moreDeclaration
Swift
public struct PatternBeginOffsetScene : Equatable
-
Represents the line on the map.
See moreDeclaration
Swift
public class Line : Annotation
-
Line options.
See moreDeclaration
Swift
public struct LineOptions : AnnotationOptions, Equatable
-
A type that represents marker options.
See moreDeclaration
Swift
public struct MarkerOptions : AnnotationOptions, Equatable
-
Represents the marker on the map.
See moreDeclaration
Swift
public class Marker : Annotation
-
Text anchoring
See moreDeclaration
Swift
public enum TextAnchoring
-
Options that define label inside marker. Can be used with
See moreMarkerOptions.Declaration
Swift
public struct MarkerLabelOptions : AnnotationOptions, Equatable
-
Options that defines inner polygon. Can be used with
PolygonOverlayOptions.See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public class InnerPolygonOptions : AnnotationOptions
-
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)}
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public class PolygonOverlay : Annotation
-
Options for creating a
PolygonOverlay.See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public class PolygonOverlayOptions : AnnotationOptions
-
Type that represents texture options.
See moreDeclaration
Swift
public struct TextureOptions : Equatable
-
Polygon options.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct PolygonOptions : AnnotationOptions, Equatable
-
Represents the polygon on the map.
See moreDeclaration
Swift
public class Polygon : Annotation
-
A protocol that defines map annotation actions.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol AnnotationsActions
-
Annotation service error.
See moreDeclaration
Swift
public enum AnnotationServiceError : Errorextension AnnotationServiceError: LocalizedError
-
Rendered Feature Actions protocol.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol RenderedFeatureActions
-
A
Routerepresentation which can be added and displayed on the map.To show a
See moreRouteon the map, call theTomTomMap.addRoute(RouteOptions)method. You can configure its shape and appearance with theRouteOptionsclass. Drawing aRouteon the map requires a list with coordinates of theRoutepoints.Declaration
Swift
public class Route
-
RouteDelegate.
See moreDeclaration
Swift
public protocol RouteDelegate : AnyObject
-
The coordinate region.
See moreDeclaration
Swift
public struct CoordinateBounds
-
Class that contains configuration of the route that will be drawn on the map.
Example:
See morelet routeOption: RouteOptions = RouteOptions(coordinates: route.geometry) guard let mapRoute = try? self.mapView.map.addRoute(routeOption) else { return }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
See moreRouteOptionsas part of the route’s configuration that is drawn on the map.Declaration
Swift
public struct RouteSection
-
Declaration
Swift
extension DefaultRouteService: MapInteractionObserver
-
The traffic category icon.
See moreDeclaration
Swift
public enum TrafficIconCategory
-
The traffic magnitude.
See moreDeclaration
Swift
public enum TrafficMagnitude
-
Represents traffic incident details.
See moreDeclaration
Swift
public struct TrafficIncident -
Defines available actions according to vehicle restriction feature.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol VehicleActions
-
The
MapViewobject 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
MapViewprogrammatically 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
See moreUIViewControllertoMapViewDelegateand implement the required methods.Declaration
Swift
@objc open class MapView : UIView
-
Enumeration of TomTomMap View errors.
See moreDeclaration
Swift
public enum MapViewError : LocalizedError
-
See moreMapMetalRendererFrameCaptureDelegateexposes possibility to get currently drawn frame as a texture. Using this delegate may have impact of performance rendering.Declaration
Swift
public protocol MapRendererFrameCaptureDelegate : AnyObject
-
Declaration
Swift
extension CurrentLocationButtonViewModel: LocationProviderObservable
-
Declaration
Swift
extension AggregatingMapMetricsMonitorService: MapMetricsMonitorServiceextension AggregatingMapMetricsMonitorService: MapMetricsObserverextension AggregatingMapMetricsMonitorService: ContinuousMapMetricsMonitorService -
Declaration
Swift
extension DefaultMapMetricsMonitorService: MapMetricsMonitorServiceextension DefaultMapMetricsMonitorService: MapMetricsObserver
-
The
MapDisplayDataProviderprotocol that can be used to add custom data providers.FileOutput- Default logger output - prints logs usingSwift.printImportant
This API has to be implemented in a thread-safe way.See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol MapDisplayDataProvider -
A cancellable task of a data provider which gathers the resource.
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol MapDisplayDataRequestToken -
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
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.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
See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public struct MapTileOptions : Equatable -
Responsible for creating instances of
MapDisplayDataProviderfor handling online map tile requests.See moreImportant
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public enum OnlineTileDataProviderFactory
-
Methods for managing map interactions and events.
See moreDeclaration
Swift
public protocol MapDelegate : AnyObject
-
The methods that an object adopts to manage callout views for a MapView.
See moreDeclaration
Swift
public protocol MapDataSource : AnyObject
-
The
TomTomMapclass 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.TomTomMapcan be accessed in several ways through theMapViewclass:- 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 theMapDelegate, 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 propertymapView.map, but in some cases where the map should be ready first, such as when callingshowVehicleRestrictions(vehicle:)the preferred way would bemapView.getMapAsyncormapView.onMapReadyCallback.
Declaration
Swift
public class TomTomMap : AnnotationsActions, RouteActions, MapActionsextension TomTomMap: CameraActionsextension TomTomMap: RenderedFeatureActionsextension TomTomMap: VehicleActions, LocationActions - Through the property
TomTom SDK for iOS (TomTomSDKMapMatchingEngineHybrid 0.38.0-rc01 Docs)
TomTomSDKMapDisplay