interface
CameraMoveController
Allows you to control the camera position for animation needs
The class must be thread-safe.
The class must be thread-safe.
Methods
func animationTime() -> TimeInterval
Returns
TimeInterval
CustomFollowController
Interface that can be implemented on the platform to create a custom parameter tracking controller. To add a controller to the camera, implement this interface and create a FollowController object by passing an object that implements this interface as an argument.
Methods
func availableValues() -> FollowValueOptionSet
Returns
func coordinates() -> GeoPoint?
Returns
func bearing() -> Bearing?
Returns
func tilt() -> Tilt?
Returns
func styleZoom() -> StyleZoom?
Returns
ICancellable
Token to cancel the operation, at the start of which it was obtained.
Methods
func cancel()
IDirectoryViewsFactory
Factory of directory SwiftUI elements.
Methods
func makeVoiceAssistantView(speechService: (any IVoiceAssistantService)?) -> VoiceAssistantView
SwiftUI element for voice input.
Returns
func makeSearchResultItemView(
object: DirectoryObject,
onTap: @escaping (DirectoryObject) -> Void,
lastLocation: GeoPoint?
) -> SearchResultItemView
SwiftUI element of an object card in search results.
Parameters
IDoubleTapAndPanGestureRecognizer
Properties
var scaleDoublingTranslation
Number of vertical shift points resulting in a twofold change in scale.
The default value for the gesture handler is `-100`. Shifting down (increasing `y`) increases the scale. Shifting up (decreasing `y`) decreases the scale. To scale up by 2x, at this scaling speed value, you need to swipe down by `100 pt`.
The default value for the gesture handler is `-100`. Shifting down (increasing `y`) increases the scale. Shifting up (decreasing `y`) decreases the scale. To scale up by 2x, at this scaling speed value, you need to swipe down by `100 pt`.
IEnergyConsumption
Protocol for setting the power saving of the device.
Methods
func setFpsCallback(_ fpsCallback: FpsCallback?)
Sets the callback function for changing FPS.
Parameters
fpsCallback
FpsCallback?
IHTTPClient
Network client interface for sending HTTP requests.
Methods
func send(
request: URLRequest,
callback: @escaping RequestDataCompletionCallback
)
Sends a request and getting the result through the callback. The results will be processed in the callback.
Parameters
request
URLRequest
HTTP request.
callback
RequestDataCompletionCallback
Callback function when obtaining the result of a request.
IImageFactory
Methods
func make(imageFactory: @escaping () -> UIImage) -> Image
Creates an image based on a deferred UIImage object. The passed closure is called with delay at the moment when data is needed. The `make(pngData:size:)` method works more efficiently with ready PNG data.
Returns
ILocationProvider
Geoposition source interface that the platform implements.
Methods
func setCallbacks(
locationCallback: LocationCallback?,
availabilityCallback: AvailabilityCallback?
)
Set the callback functions to update the current geoposition and change the availability of the geoposition source. Calling this method again overwrites the previously set callback functions. If both parameters are `nil`, geoposition update tracking must be disabled.
Parameters
locationCallback
LocationCallback?
Updates the current geoposition. If the provider is available ( calling `availabilityCallback` returns true), this source always delivers a valid geoposition. A valid geoposition is a geoposition in which all fields have the current value at the time it was sent to this channel (i.e. if the accuracy of the geoposition >= half the length of the Earth's equator, the geoposition is valid for any of the correct coordinates specified in it). If the accuracy value <= 0, the position is considered unreliable even if `isAvailable` == true. See the `CLLocationManagerDelegate.locationManager(didUpdateLocations:)` method.
availabilityCallback
AvailabilityCallback?
Changes the availability of the geoposition source. If this function is called with the value true, all subsequent `locationCallback` calls will contain a valid (up-to-date) geoposition. Even if tracking of geoposition changes is unavailable, the `ILocationProvider` implementation may send a new geoposition, but it will be considered unreliable. See the `CLLocationManagerDelegate.locationManager(didFailWithError:)` method.
func setDesiredAccuracy(_ accuracy: DesiredAccuracy)
Sets the desired accuracy of the positioning. If the device cannot return a location with the desired accuracy, it may return a location with a lower accuracy. If the platform does not provide a method with similar functionality, this method must have an empty implementation.
See the `CLLocationManager.desiredAccuracy` method and \ .
See the `CLLocationManager.desiredAccuracy` method and \ .
Parameters
accuracy
IMagneticHeadingProvider
Protocol that provides the direction of the device relative to the direction to magnetic north. All methods of this interface must be called from the `IPositioningServicesFactory.positiningQueueue` queue.
Methods
func setCallbacks(
headingCallback: HeadingCallback?,
availabilityCallback: AvailabilityCallback?
)
Sets the callback functions to update the current direction and change the availability of the direction source. Calling this method again overwrites previous callback functions. If both parameters are `nil`, direction update tracking must be disabled.
Parameters
headingCallback
HeadingCallback?
Callback function to update the current direction. See the `CLLocationManagerDelegate.locationManager(didUpdateHeading:)` method.
availabilityCallback
AvailabilityCallback?
Changes the availability of the direction source. Even if direction change tracking is not available, the implementation can send a new direction, but it will be considered invalid. See the `CLLocationManagerDelegate.locationManager(didFailWithError)` method.
IMapCoordinateSpace
Map coordinate space. If the map does not exist, coordinate transformations return them unchanged, and `bounds` equals `.zero`. Methods and properties can only be accessed from the main queue.
Implements: INativeScaleProvider
IMapEventProcessor
Map gesture handler. All coordinates are taken in physical points (pixels).
Methods
IMapFactory
Matching map object factory.
Properties
var initialMapOptions
Initial map settings. Not changed after map creation. Can be read from any queue.
var map
Map and camera control. Can be accessed from any queue, but synchronization is required in case of simultaneous access.
var mapUIView
any UIView & IMapUIView
Map layer. Can be read only from the main queue.
var mapView
Card layer. Can only be read from the main queue.
var gestureUIView
(any UIView & IMapGestureUIView)?
Gesture processing layer using the `initialMapOptions.gestureViewFactory` property. Can only be read from the main queue.
var mapEventProcessor
any IMapEventProcessor
Map gestures handler.
Used by `gestureView` to control map events. Using in combination with `gestureView` may break the transactional nature of gestures and lead to undefined behavior.
Used by `gestureView` to control map events. Using in combination with `gestureView` may break the transactional nature of gestures and lead to undefined behavior.
var mapCoordinateSpace
any IMapCoordinateSpace
Map coordinates space.
var mapUIControlsFactory
any IMapUIControlsFactory
Factory of standard UI map controls using the inline style.
var mapViewsFactory
any IMapViewsFactory
Factory of standard SwiftUI map controls using the inline style.
var snapshotter
any IMapSnapshotter
Map image capture tool. Images are made based on the current state. Can be read from any queue.
var energyConsumption
any IEnergyConsumption
An object for adjusting the power saving of a device.
var markerOverlayUIView
any IMarkerOverlayUIView
Object for working with UIView markers on the map.
var markerOverlayView
Object for working with SwiftUI View markers on the map.
IMapGestureUIView
Default gesture recognizing.
Properties
var doubleTapGestureRecognizer
Double-tap recognizing. Used to zoom out the map by a fixed ratio.
var panGestureRecognizer
Drag detection. Used to move the map. Single-tap drag detection is recognized by default.
var twoFingerPanGestureRecognizer
Two-finger pan recognizing. Used to tilt the map.
var rotationGestureRecognizer
Map rotation recognizing.
var pinchGestureRecognizer
Pinch recognizing. Used to scale the map.
var twoFingerTapGestureRecognizer
Two-finger tap recognizing. Used to zoom in the map by a fixed ratio.
var doubleTapAndPanGestureRecognizer
(any UIGestureRecognizer & IDoubleTapAndPanGestureRecognizer)?
Double-tap and the following shift recognizing. Used to scale the map.
IMapGestureUIViewFactory
Factory of a gesture processing layer. Methods are called only on the main queue.
Methods
@available(*, deprecated, message: "Please use makeGestureView(map:eventProcessor:coordinateSpace:)")
func makeGestureUIView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureUIView
Parameters
func makeGestureUIView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureUIView
Parameters
@available(*, deprecated, message: "Please use makeGestureView(map:eventProcessor:coordinateSpace:)")
func makeGestureUIView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureUIView
Parameters
func makeGestureUIView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureUIView
Creates a gesture processing layer.
Parameters
IMapSnapshotter
Map image capture tool.
Methods
func makeImage(
scale: CGFloat,
orientation: UIImage.Orientation
) -> Future<UIImage>
Gets an image of a map based on its current state. Can be called from any queue. The value is returned in `Future` in an undefined queue.
Before calling the method, ensure that the scene displaying the map is in the `UIScene.ActivationState.foregroundActive` state. For iOS 12, the application must be in the `UIApplication.State.active` state.
Before calling the method, ensure that the scene displaying the map is in the `UIScene.ActivationState.foregroundActive` state. For iOS 12, the application must be in the `UIApplication.State.active` state.
Parameters
func makeImage(
scale: CGFloat = 1,
orientation: UIImage.Orientation = .up
) -> Future<UIImage>
Gets an image of a map based on its current state. Can be called from any queue. The value is returned in `Future` in an undefined queue.
Before calling the method, ensure that the scene displaying the map is in the `UIScene.ActivationState.foregroundActive` state. For iOS 12, the application must be in the `UIApplication.State.active` state.
Before calling the method, ensure that the scene displaying the map is in the `UIScene.ActivationState.foregroundActive` state. For iOS 12, the application must be in the `UIApplication.State.active` state.
Parameters
IMapUIControlsFactory
Factory of UI map controls.
Methods
func makeZoomUIControl() -> ZoomUIControl
Returns
func makeCurrentLocationUIControl() -> CurrentLocationUIControl
Returns
func makeCompassUIControl() -> CompassUIControl
Returns
func makeTrafficUIControl() -> TrafficUIControl
Returns
func makeRoadEventCreatorButtonUIControl() -> RoadEventCreatorButtonUIControl
func makeIndoorUIControl(_ options: IndoorUIControlOptions) -> IndoorUIControl
Parameters
func makeIndoorUIControl(_ options: IndoorUIControlOptions = .default) -> IndoorUIControl
Parameters
IMapUIView
Map layer.
Methods
func addObjectTappedCallback(callback: MapObjectTappedCallback)
Adds a callback function that is called after a long tap on the map.
Parameters
callback
func addObjectLongPressCallback(callback: MapObjectTappedCallback)
Parameters
callback
func removeObjectTappedCallback(callback: MapObjectTappedCallback)
Removes a callback function that is called after a long tap on the map.
Parameters
callback
func removeLongPressCallback(callback: MapObjectTappedCallback)
Parameters
callback
Properties
var gestureUIView
(any UIView & IMapGestureUIView)?
Adds a layer for intercepting gestures, placed above the map. When replacing with another layer, you need to implement event sending through the `IMapEventProcessor`. If the `nil` value is set, gesture handling is disabled.
var appearance
Sets the active theme set of the current style and enables automatic theme switching depending on the environment. If the `.automatic` value is set, the map switches between light and dark themes depending on system settings. Only available for iOS 13 and later. For iOS 13 and earlier, the `.universal` value is available, which uses only one active theme in any environment.
var showsAPIVersion
Whether to show an API version in a copyright. The default value is `false`.
var copyrightAlignment
Sets a copyright position on the map. The default value is `bottomRight`.
var copyrightInsets
Sets copyright paddings from map edges. The default value is `.zero`. During positioning, `safeAreaInsets` are considered. Values cannot be negative.
var urlOpener
((URL) -> ())?
Handles an URL opening when a user taps the copyright. Allows overriding default behavior when following the link is done without user confirmation.
IMapViewsFactory
Factory of SwiftUI map controls.
Methods
func makeCurrentLocationView() -> AnyView
Returns
AnyView
func makeZoomView() -> AnyView
Returns
AnyView
func makeTrafficView(colors: TrafficViewColors) -> AnyView
Parameters
func makeIndoorView() -> AnyView
Returns
AnyView
func makeCompassView(icon: UIImage?, highlightedIcon: UIImage?) -> AnyView
Parameters
func makeMiniMapView(mapFactory: IMapFactory) throws -> AnyView
Parameters
func makeRoadEventCreatorButtonView(callback: (() -> Void)?) -> AnyView
Returns
AnyView
func makeCompassView() -> AnyView
Returns
AnyView
IMarkerOverlayUIView
Managing UIView markers on the map.
Methods
func removeAll()
Removes all markers.
IMarkerUIView
UIView marker.
Properties
var id
UUID
Marker identifier.
var position
Point on the map to which the marker is attached.
var tapHandler
(() -> ())?
Handler for clicking the UIView marker.
IMarkerUIViewFactory
Factory for creating UIView markers.
Methods
func make(
/// Отображение маркера.
view: UIView,
/// Точка на карте, к которой осуществляется привязка.
position: GeoPointWithElevation,
/// Относительная точка на View, к которой осуществяется привязка.
anchor: Anchor,
/// Дополнительное смещение в пикселях по оси X.
offsetX: CGFloat,
/// Дополнительное смещение в пикселях по оси Y.
offsetY: CGFloat
) -> IMarkerUIView
Creates a marker.
Parameters
IModelFactory
Methods
func make(modelData: Data) -> ModelData
Creating a model based on binary data.
Parameters
INativeScaleProvider
Protocol describing the point-to-pixel conversion.
Properties
var nativeScale
Multiplier for conversion to pixels. If no map exists, the value is `1`. Can only be accessed from the main queue.
var toPixels
Point-to-pixel conversion matrix. The x and y multiplier is equal to `nativeScale`.
INavigationMapUIControlsFactory
Factory of UI map controls in the navigator.
Methods
func makeTrafficAndParkingMapUIControl() -> UIControl
UI control for managing the visibility of traffic jams and parking lots on the map.
Returns
func makeCompassUIControl(icon: UIImage?, highlightedIcon: UIImage?) -> UIControl
UI control for displaying the current map rotation angle relative to the north.
Parameters
func makeIndoorUIControl() -> IndoorUIControl
UI control for switching floors in the floor plan.
Returns
func makeTrafficUIControl() -> UIControl
UI control for managing the visibility of traffic jams on the map.
Returns
func makeParkingUIControl() -> UIControl
UI control for managing the visibility of parking lots on the map.
Returns
func makeCompassUIControl() -> UIControl
Returns
Properties
var followManager
any INavigatorFollowManager
Current object for switching tracking modes in the navigator.
INavigationMapViewsFactory
Factory of map SwiftUI controls in the navigator.
Methods
INavigationUIControl
Navigator UI control.
Properties
var isVisible
Element visibility.
var onDidChangeVisibility
(() -> ())?
Signal about the element visibility change.
INavigationUIControlsFactory
Factory of UI navigator controls.
Methods
func makeNextManeuverUIControl(
uiModel: Model
) -> UIView & INextManeuverUIControl
UI control with information about the next and additional maneuvers.
Parameters
func makeSpeedUIControl(
uiModel: Model
) -> (UIView & INavigationUIControl)
UI control with information about the current speed, the speed limit for the current route section, and a warning about passing a camera coverage area.
Parameters
uiModel
func makeRemainingRouteInfoUIControl(
navigationManager: NavigationManager
) -> UIView & INavigationUIControl
UI control with information about the remaining distance and estimated time of arrival or remaining travel time.
Parameters
func makeMessageBarUIControl(
uiModel: Model
) -> UIView & INavigationUIControl
UI control for displaying navigation status messages, such as route search and GPS signal loss.
Parameters
func makeBetterRouteUIControl(
uiModel: Model
) -> UIView & INavigationUIControl
UI control for switching to a route with a lower estimated time of arrival.
Parameters
INavigationUIView
Methods
Properties
var visibleAreaEdgeInsets
Visible map area with the navigator interface.
var visibleAreaEdgeInsetsChangedCallback
((UIEdgeInsets) -> ())?
Callback closure when the map visible area changes.
var finishButtonCallback
(() -> ())?
Callback closure when clicking the route completion.
INavigationUIViewFactory
Factory of UI navigator controls.
Methods
func makeRouteListUIView(_ routes: [TrafficRoute]) -> IRouteListUIView
Creates a UI of route preview list.
Parameters
func makeRouteUIView(_ route: TrafficRoute) -> IRouteUIView
Creates a route preview UI.
Parameters
func makeRouteDetailsUIView(
_ route: TrafficRoute,
startName: String?,
finishName: String?
) -> IRouteDetailsUIView
Creates a route details UI.
Parameters
route
Route.
startName
Name of the starting point of the route.
finishName
Name of the ending point of the route.
Returns
INavigationViewFactory
Navigator UI factory.
Methods
INavigationViewsFactory
Factory of SwiftUI elements to add to the map.
Methods
func makeFinishRouteDashboardView(
map: Map,
uiModel: Model
) -> AnyView
SwiftUI control with information about the end of the route.
Parameters
func makeNextManeuverView(
uiModel: Model
) -> AnyView
SwiftUI control with information about the next maneuver and the additional one.
Parameters
func makeRemainingRouteInfoView(
navigationManager: NavigationManager
) -> AnyView
SwiftUI control with information about the remaining distance and estimated time of arrival/remaining travel time.
Parameters
func makeSpeedView(
uiModel: Model
) -> AnyView
SwiftUI control with information about the current speed, the speed limit on the current section of the route, and the warning of passing the camera coverage area.
Parameters
func makeThermometerView(
uiModel: Model, isLeftSide: Bool
) -> AnyView
SwiftUI control for displaying vehicle speeds and traffic events on the route.
Parameters
func makeMessageBarView(
uiModel: Model,
onVisibilityChanged: @escaping (Bool) -> Void
) -> AnyView
SwiftUI element for displaying error messages during route building.
Parameters
func makeBetterRouteView(
uiModel: Model,
onVisibilityChanged: @escaping (Bool) -> Void
) -> AnyView
SwiftUI element for selecting a "better route".
Parameters
func makeMiniMapView(
navigationManager: NavigationManager,
miniMapFactory: IMapFactory
) throws -> AnyView
SwiftUI element for displaying a route as a mini-map.
Parameters
INavigatorFollowManager
Wrapper for switching tracking modes in the navigator.
Methods
func toggleFollowMode()
Switches the tracking mode to the next one available.
func addFollowModeObserver(_ observer: @escaping FollowModeObserver) -> INavigatorFollowManagerObservation
Parameters
Properties
INavigatorFollowManagerObservation
Methods
func invalidate()
INextManeuverUIControl
UI control with information about the next and additional maneuvers.
Implements: INavigationUIControl
Properties
var onDidRequestLayout
(() -> ())?
Signal about the need to update the layout.
InstallFallback
Behavior in case of an error during package installation or update.
Methods
IRoadEventCreatorUIView
Interface for creating a road event.
Properties
var visibleAreaEdgeInsets
Visible area based on the size of the card for creating a road event.
var visibleAreaEdgeInsetsChangedCallback
((UIEdgeInsets) -> ())?
Callback closure when the visible area changes.
var cancelButtonCallback
(() -> ())?
Callback closure when clicking the cancel button.
var createRoadEventRequestCallback
((Result<AddEventResult, any Error>) -> ())?
Callback closure with the result of a road event creating.
IRoadEventInfoUIView
UI control of the road event card.
Methods
func setRoadEvent(_ roadEvent: RoadEvent)
Updates the card contents with data from a new road event.
Parameters
roadEvent
Road event.
Properties
var closeButtonCallback
(() -> ())?
Callback closure when clicking the close button.
var roadEventActionResultCallback
((Result<(type: RoadEventActionType, result: ActionResult), any Error>) -> ())?
Callback closure when the traffic event action is completed.
var removeRoadEventActionResultCallback
((Result<ActionResult, any Error>) -> ())?
Callback closure when the traffic event action is completed.
IRoadEventUIViewFactory
Factory of a UIKit control of a road event card.
Methods
func makeRoadEventInfoUIView(_ roadEvent: RoadEvent) -> IRoadEventInfoUIView
Road event card.
Parameters
func makeRoadEventCreatorUIView(map: Map) -> IRoadEventCreatorUIView
Creates a road event.
Parameters
IRoadEventViewFactory
SwiftUI factory of a road event card.
Methods
func makeRoadEventInfoView(_ roadEvent: RoadEvent) -> RoadEventInfoView
Road event card.
Parameters
func makeRoadEventCreatorView(
map: Map,
visibleAreaEdgeInsets: Binding<EdgeInsets>?
) -> RoadEventCreatorView
SwiftUI element for creating a road event.
Parameters
IRouteDetailsUIView
Route details card.
IRouteEditorFactory
Map data source designer.
Methods
IRouteListUIView
Route preview list.
IRouteUIView
Route card preview.
Properties
var route
Route.
ISDKError
Prorocol for all MobileSDK exceptions.
ISearchManagerFactory
A search engine factory with different data sources.
Methods
func makeOnlineManager() throws -> SearchManager?
Creates a search engine working online.
Returns
func makeOfflineManager() throws -> SearchManager?
Creates a search engine working with preloaded data.
Returns
func makeSmartManager() throws -> SearchManager?
Creates a search engine working online or with preloaded data depending on the availability of internet connection.
Returns
ISearchResultItemViewFactory
Methods
func makeTitleView() -> AnyView
Returns
AnyView
func makeSubtitleView() -> AnyView
Returns
AnyView
func makeRatingView() -> AnyView
Returns
AnyView
func makeDistanceView() -> AnyView
Returns
AnyView
func makeAddressView() -> AnyView
Returns
AnyView
func makeAttributesView() -> AnyView
Returns
AnyView
func makeChargingStationView() -> AnyView
Returns
AnyView
func makeAlertView() -> AnyView
Returns
AnyView
ISourceFactory
Map data source designer.
Methods
func createOnlineDGISSource() -> Source
Creates a source that receives data from 2GIS servers.
Returns
func createGeometryMapObjectSourceBuilder() -> GeometryMapObjectSourceBuilder
Creates a data source with overlaid objects (for example, markers).
func createOfflineDGISSource() -> Source
Creates a source that uses preloaded 2GIS data.
Returns
func createHybridDGISSource() -> Source
Creates a source that uses data from 2GIS servers and preloaded 2GIS data.
Returns
func createRouteEditorSource(routeEditor: RouteEditor) -> RouteEditorSource
Creates a source of data for route editing.
Parameters
IStyleFactory
Style download tool interface.
Methods
func setAttribute(name: String, value: AttributeValue) -> Self
Parameters
func loadDefault() -> Future<Style>
Gets a preset style.
func loadFile(url: URL) -> Future<Style>
Loads a custom style from a specified file via URL. The URL must follow the “file:” scheme, otherwise an error is returned.
Parameters
url
URL
func loadResource(name: String, bundle: Bundle) -> Future<Style>
Loads a custom style by name from a specified package.
Parameters
IThermometerUIControl
Implements: INavigationUIControl
Properties
var eventsPosition
IVoiceAssistantService
Methods
func requestPermission(completion: @escaping ((VoicePermissionState) -> Void))
func startRecognition(
progress: @escaping ((VoiceRecognitionState) -> Void),
completion: @escaping ((VoiceRecognitionResult) -> Void)
)
func abortRecognition()
LogSink
Logging receiver.
Methods
SearchHistoryKeyStrategy
Strategy for creating a key for a search history item. The key determines the uniqueness of the record in history.
Methods
SimpleClusterRenderer
Customizes the appearance of a cluster in the IMapObjectManager.
Methods
func renderCluster(
cluster: SimpleClusterObject
) -> SimpleClusterOptions
Parameters