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 moreDeclaration
Swift
public struct ControlPoint : Equatable
-
The configuration for follow camera operators.
See moreDeclaration
Swift
public struct FollowCameraOperatorConfig : 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:)
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 certainCameraUpate
properties 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 withzoomIn
orzoomOut
.zoomIn
- cannot be used together withzoomOut
orzoomBy
.zoomOut
- cannot be used together withzoomIn
orzoomBy
.moveBy
- cannot be used together with any of the other properties.- When setting directly the
cameraUpdate
field 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 moreCLLocationCoordinate2D
coordinates.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.
Important
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 OnlineCachePolicy
extension OnlineCachePolicy: Equatable
-
See moreMapActions
defines a set of methods closely connected to the map.Declaration
Swift
public protocol MapActions
-
See moreMapGestureDisableOption
An 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.
MapOptions
is used in conjunction withMapView
initialization, i.e: When creating aMapView
, it is possible to pass aMapOptions
object to configure theMapView
before it is showing on the screen, for example, creating aMapView
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
See moreMapView
without passing aMapOptions
object, will result in theMapView
being 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 moreOnDiskCachePolicy
sets 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 moredarkStyle
is not provided, settingTomTomMap.styleMode
has no effect.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 moreDeclaration
Swift
public enum StyleDefinition
extension StyleDefinition: Equatable
-
The
See moreMetadata
is 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: Equatable
extension StyleFetcherError: LocalizedError
-
Base protocol for
AnnotationOptions
Declaration
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.
Important
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
.Important
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)
}
Important
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
.Important
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 moreDeclaration
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.
Important
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 : Error
extension AnnotationServiceError: LocalizedError
-
Rendered Feature Actions protocol.
Important
This is a Public Preview API. It may be changed or removed at any time.Declaration
Swift
public protocol RenderedFeatureActions
-
A
Route
representation which can be added and displayed on the map.To show a
See moreRoute
on the map, call theTomTomMap.addRoute(RouteOptions)
method. You can configure its shape and appearance with theRouteOptions
class. Drawing aRoute
on the map requires a list with coordinates of theRoute
points.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 moreRouteOptions
as 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.
Important
This is a Public Preview API. It may be changed or removed at any time.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
See moreUIViewController
toMapViewDelegate
and implement the required methods.Declaration
Swift
@objc open class MapView : UIView
-
Enumeration of TomTomMap View errors.
See moreDeclaration
Swift
public enum MapViewError : LocalizedError
-
See moreMapMetalRendererFrameCaptureDelegate
exposes 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 AggregatingMapMetricsMonitorService: MapMetricsMonitorService
extension AggregatingMapMetricsMonitorService: MapMetricsObserver
extension AggregatingMapMetricsMonitorService: ContinuousMapMetricsMonitorService
-
Declaration
Swift
extension DefaultMapMetricsMonitorService: MapMetricsMonitorService
extension DefaultMapMetricsMonitorService: MapMetricsObserver
-
The
MapDisplayDataProvider
protocol that can be used to add custom data providers.FileOutput
- Default logger output - prints logs usingSwift.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.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.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
Important
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
Important
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
MapDisplayDataProvider
for handling online map tile requests.Important
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
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 theMapView
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 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.getMapAsync
ormapView.onMapReadyCallback
.
Declaration
Swift
public class TomTomMap : AnnotationsActions, RouteActions, MapActions
extension TomTomMap: CameraActions
extension TomTomMap: RenderedFeatureActions
extension TomTomMap: VehicleActions, LocationActions
- Through the property