Skip to main content

interface

CameraMoveController

Allows you to control the camera position for animation needs
The class must be thread-safe.

Methods
func position(
time: TimeInterval
) -> CameraPosition
Parameters

time

TimeInterval
Returns
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
func requestValues(
values: FollowValueOptionSet
)
Parameters
func setNewValuesNotifier(
notifier: NewValuesNotifier?
)
Parameters
func coordinates() -> GeoPoint?
Returns
func satelliteBearing() -> Bearing?
Returns
func magneticBearing() -> Bearing?
Returns
func tilt() -> Tilt?
Returns
func styleZoom() -> StyleZoom?
Returns
func accuracy() -> Double?
Returns

HttpClient

Methods
func sendRequest(
request: HttpRequest,
callback: HttpResponseCallback
)
Parameters

IAudioSettings

Interface for changing sound settings.

Properties

var muteOtherSounds

Mute all sounds of other applications.

var audioVolume

Sound volume level.

IBatteryManagerDelegate

Battery tracking control methods. The implementation can turn battery tracking on and off by changing UIDevice.isBatteryMonitoringEnabled.

Methods
func startBatteryMonitoring()

Starts battery status tracking by setting UIDevice.current.isBatteryMonitoringEnabled to true. If UIDevice.current.isBatteryMonitoringEnabled is already true, changing the status is not necessary. If enabling tracking is undesirable, the implementation can be empty.

func stopBatteryMonitoring()

Disables battery status tracking by setting UIDevice.current.isBatteryMonitoringEnabled to true. If UIDevice.current.isBatteryMonitoringEnabled is already false, changing the status is not necessary. If battery tracking must be continued, the value of isBatteryMonitoringEnabled can be left unchanged.

ICancellable

Token to cancel the operation, at the start of which it was obtained.

Methods
func cancel()

ICreateRoadEventView

Traffic event creation interface protocol.

Properties

var visibleAreaEdgeInsets

Visible area given the size of the road event creation card.

var visibleAreaEdgeInsetsChangedCallback

((UIEdgeInsets) -> ())?

Callback closure when the visible area changes.

var cancelButtonCallback

(() -> ())?

Callback closure when the cancel button is pressed.

var createRoadEventRequestCallback

((Result<AddEventResult, Error>) -> ())?

Closes the callback with a road event creation result.

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.

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?
Properties

var maxFps

Maximum allowable map refresh frequency.
If not specified, it is equal to the screen refresh frequency.

var powerSavingMaxFps

Maximum allowable map refresh frequency in the power saving mode.
If not specified, it is equal to maxFps.

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(pngData: Data, size: CGSize) -> Image
Parameters

pngData

Data

size

Returns
func make(svgData: Data, size: CGSize) -> Image
Parameters

svgData

Data

size

Returns
func make(lottieData: Data, size: CGSize) -> Image
Parameters

lottieData

Data

size

Returns
func make(image: UIImage) -> Image
Parameters

image

Returns
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 \ .

Parameters
Properties

var lastLocation

Best currently known geoposition. If no currently known geoposition is available, nil is returned. The geoposition returned by this method may not be valid (see setCallbacks). This method must request the best currently known geoposition from the system and return it even if it is outdated and/or does not meet the required accuracy. If the platform API does not provide a method with similar functionality, this method must always return nil.
See the CLLocationManager.location method.

ILocationService

Geoposition source interface.

Properties

var lastLocation

Best currently known geoposition. If there is no currently known geoposition, nil is returned. The geoposition returned by this method may not be valid. This method must request the best currently known geoposition from the system and return it even if it is outdated and/or does not meet the required accuracy. If the platform API does not provide a method with similar functionality, this method will always return nil.
See the CLLocationManager.location method.

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.

IMapControlFactory

Button factory to add to the map.

Methods
func makeZoomControl() -> ZoomControl
func makeCurrentLocationControl() -> CurrentLocationControl
func makeCompassControl() -> CompassControl
func makeTrafficControl() -> TrafficControl
func makeCreateRoadEventControl() -> CreateRoadEventControl
func makeIndoorControl(_ options: IndoorControlOptions) -> IndoorControl
Parameters
func makeIndoorControl(_ options: IndoorControlOptions = .default) -> IndoorControl
Parameters

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.

IMapEventProcessor

Map gesture handler. All coordinates are taken in physical points (pixels).

Methods
func process(event: Event)

Processing the map control event.

Parameters

event

Map control event.

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 mapView

Card layer. Can only be read from the main queue.

var gestureView

(UIView & IMapGestureView)?

Gesture processing layer. The initialMapOptions.gestureViewFactory property is responsible for creating the layer. Can only be read from the main queue.

var mapEventProcessor

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.

var mapCoordinateSpace

Map coordinates space.

var mapControlFactory

A factory of standard map controls using inline style.

var snapshotter

Map image capture tool. Images are made based on the current state. Can be read from any queue.

var energyConsumption

An object for adjusting the power saving of a device.

var markerViewOverlay

Object for working with UIView markers on the map.

IMapGestureView

Default map gesture recognizers.

Properties

var doubleTapGestureRecognizer

Double tap recognizer. Used to zoom in on the map (zoom out) with a fixed factor.

var panGestureRecognizer

Drag recognizer. Used to move the map in the plane. By default, it recognizes drag with exactly one touch point.

var twoFingerPanGestureRecognizer

Two-finger drag. Used to tilt the map three-dimensionally relative to the horizon.

var rotationGestureRecognizer

Map rotation gesture in the plane.

var pinchGestureRecognizer

Change of scale by pinching.

var twoFingerTapGestureRecognizer

Short touch with two fingers. Used to move the map away (zoom in) by a fixed factor.

var doubleTapAndPanGestureRecognizer

(UIGestureRecognizer & IDoubleTapAndPanGestureRecognizer)?

Double tap followed by a shift. Used to control map scale.

IMapGestureViewFactory

Gesture processing layer factory. All methods are called only on the main queue.

Methods
@available(*, deprecated, message: "Please use makeGestureView(map:eventProcessor:coordinateSpace:)")

func makeGestureView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView

Parameters

map

coordinateSpace

Returns
func makeGestureView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
Parameters

map

eventProcessor

coordinateSpace

Returns
@available(*, deprecated, message: "Please use makeGestureView(map:eventProcessor:coordinateSpace:)")

func makeGestureView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView

Parameters

map

coordinateSpace

Returns
func makeGestureView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView

Creates a gesture processing layer.

Parameters

map

eventProcessor

coordinateSpace

Returns

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.

Parameters

scale

orientation

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.

Parameters

scale

Multiplier of the received image (see UIImage.scale). Default is 1.

orientation

Image orientation (see UIImage.orientation. Default is .up.

IMapView

Map layer protocol.

Methods
func addObjectTappedCallback(callback: MapObjectTappedCallback)

Adds a callback function that will be called upon a click or a long click on the map.

Parameters
func addObjectLongPressCallback(callback: MapObjectTappedCallback)
Parameters
func removeObjectTappedCallback(callback: MapObjectTappedCallback)

Removes the callback function that was called upon a click or a long click on the map.

Parameters
func removeLongPressCallback(callback: MapObjectTappedCallback)
Parameters
Properties

var gestureView

(UIView & IMapGestureView)?

Additional layer placed over the entire map surface. Used for intercepting gestures. If you replace this layer with another, you must also implement the sending of map events through IMapEventProcessor. If nil is set, the built-in gesture processing will stop.

var appearance

Set the active set of current style themes and the ability to switch themes automatically depending on the environment. If .automatic is selected, the card will switch to the selected theme pair based on the current display (light or dark). This feature has been available since iOS 13. If .universal is selected, only one active theme in any environment is used. This feature is available for iOS 13 or lower.

var showsAPIVersion

Whether to show the API version in copywriting. Default is false.

Default is bottomRight.

Copywriter's padding from map borders. The default is .zero. The safeAreaInsets of the map view are taken into account when positioning. Padding values must not be negative.

var urlOpener

((URL) -> ())?

Custom handler of opening URL on tap on copyright.
Allows to override the default behavior, which allows to follow the link without user confirmation.

IMarkerView

UIView marker protocol.

Properties

var id

UUID

Marker ID.

var position

Point on the map to which the anchoring is performed.

var tapHandler

(() -> ())?

User handler when tapping into the UIView marker.

IMarkerViewFactory

Factory for creating UIView markers.

Methods
func make(
/// Отображение маркера.
view: UIView,
/// Точка на карте, к которой осуществляется привязка.
position: GeoPointWithElevation,
/// Относительная точка на View, к которой осуществяется привязка.
anchor: Anchor,
/// Дополнительное смещение в пикселях по оси X.
offsetX: CGFloat,
/// Дополнительное смещение в пикселях по оси Y.
offsetY: CGFloat
) -> IMarkerView

Create a marker.

Parameters

view

position

anchor

offsetX

offsetY

Returns

IMarkerViewOverlay

Protocol for working with UIView markers on the map.

Methods
func add(markerView: IMarkerView)

Adds the UIView marker.

Parameters

markerView

func add(markerViews: [IMarkerView])
Parameters

markerViews

func remove(markerView: IMarkerView)

Removes the UIView marker.

Parameters

markerView

func remove(markerViews: [IMarkerView])
Parameters

markerViews

func removeAll()

Removes all markers.

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.

INavigationControlView

Navigator UI element.

Properties

var isVisible

Element visibility.

var onDidChangeVisibility

(() -> ())?

Item visibility change signal.

INavigationMapControlsFactory

Map controllers factory in the navigator.

Methods
func makeZoomControl() -> UIControl

Control for changing the map scale.

Returns
func makeTrafficAndParkingMapControl() -> UIControl

Control to enable/disable the display of traffic jams and parking lots.

Returns
func makeCompassControl() -> UIControl

Control to display the compass.

Returns
func makeNavigationFollowingControl() -> NavigationFollowingControl

Control to enable the tracking mode.

func makeTUGCControl() -> UIControl

Control to create road events.

Returns
func makeIndoorControl() -> IndoorControl

Control to switch floors in the floor plan.

Properties

var followManager

Current object for switching tracking modes in the navigator.

INavigationView

Methods
func showRoadEvent(_ roadEvent: RoadEvent)

Shows a road event card.

Parameters

roadEvent

Properties

var visibleAreaEdgeInsets

Visible area of the map, taking into account the navigator interface.

var visibleAreaEdgeInsetsChangedCallback

((UIEdgeInsets) -> ())?

Closes the callback when the visible area of the map changes.

var finishButtonCallback

(() -> ())?

Closes the callback when you press the End Route button.

INavigationViewControlsFactory

Navigator controls factory.

Methods
func makeNextManeuverControl(
uiModel: Model
) -> UIView & INextManeuverControlView

Control with information about the next maneuver and the additional one.

Parameters

uiModel

Returns
func makeSpeedControl(
uiModel: Model
) -> (UIView & INavigationControlView)

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

uiModel

func makeRemainingRouteInfoControl(
navigationManager: NavigationManager
) -> UIView & INavigationControlView

Control with information about the remaining distance and estimated time of arrival/remaining travel time.

Parameters

navigationManager

Returns
func makeMessageBarControl(
uiModel: Model
) -> UIView & INavigationControlView

Control for displaying navigation status messages, such as route search and GPS signal loss.

Parameters

uiModel

Returns
func makeBetterRouteControl(
uiModel: Model
) -> UIView & INavigationControlView

Control to switch to a route with a shorter expected arrival time.

Parameters

uiModel

Returns
func makeThermometerControl(
uiModel: Model
) -> UIView & IThermometerControlView

Control for displaying vehicle speeds and traffic events on the route.

Parameters

uiModel

Returns

INavigationViewFactory

Navigator UI factory.

Methods
func makeNavigationViewControlsFactory() -> INavigationViewControlsFactory

Creates a factory of navigator controls.

func makeNavigationMapControlsFactory(
map: Map,
followManager: INavigatorFollowManager
) -> INavigationMapControlsFactory

Creates a factory of navigator controls.

Parameters

map

Map controller.

followManager

Tracking mode switch in the navigator.

Returns
func makeNavigationView(
map: Map,
navigationManager: NavigationManager
) -> (UIView & INavigationView)

Creates the navigator UI.

Parameters

map

Map controller.

navigationManager

Navigation service.

func makeNavigationView(
map: Map,
navigationManager: NavigationManager,
navigationViewControlsFactory: INavigationViewControlsFactory?,
navigationMapControlsFactory: INavigationMapControlsFactory?
) -> (UIView & INavigationView)

Creates the navigator UI.

Parameters

map

Map controller.

navigationManager

Navigation service.

navigationViewControlsFactory

Custom factory of the navigator controls. If nil, the default implementation will be used.

navigationMapControlsFactory

Custom map controls factory in the navigator. If nil, the default implementation will be used.

func makeRouteListView(_ routes: [TrafficRoute]) -> IRouteListView

Creates the UI of a routes preview list.

Parameters

routes

Routes list.

Returns
func makeRouteView(_ route: TrafficRoute) -> IRouteView

Creates the UI of a route preview.

Parameters

route

Returns
func makeRouteDetailsView(
_ route: TrafficRoute,
startName: String?,
finishName: String?
) -> IRouteDetailsView

Creates the UI of route details.

Parameters

route

startName

Name of the starting point of the route.

finishName

Name of the finish point of the route.

Returns

INavigatorFollowManager

Wrapper for switching tracking modes in the navigator.

Methods
func toggleFollowMode()

Switches the tracking mode to the next one available.

func setFollowMode(_ mode: NavigatorFollowMode)
Parameters
func addFollowModeObserver(_ observer: @escaping FollowModeObserver) -> INavigatorFollowManagerObservation
Parameters

observer

FollowModeObserver
Returns
Properties

INavigatorFollowManagerObservation

Methods
func invalidate()

INextManeuverControlView

Control with information about the next maneuver and additional maneuver.

Properties

var onDidRequestLayout

(() -> ())?

Signal to update the layout.

IPositioningServicesFactory

Positions services factory. All constructed object methods must be called in the positioningQueueue queue, unless otherwise specified.

Properties

var locationProvider

Geopositioning source interface. If nil, SDK geopositioning functions are not available.

var magneticHeadingProvider

Magnetic orientation source interface. If nil, the SDK magnetic orientation functions are not available.

IRoadEventCardView

Road event card protocol.

Methods
func setRoadEvent(_ roadEvent: RoadEvent)

Update the card content with the data of a new road event.

Parameters

roadEvent

Road event.

Properties

var closeButtonCallback

(() -> ())?

Closes the callback when the close button is clicked.

var roadEventActionResultCallback

((Result<(type: RoadEventActionType, result: ActionResult), Error>) -> ())?

Closes the callback when the processing of a traffic event action is completed.

var removeRoadEventActionResultCallback

((Result<ActionResult, Error>) -> ())?

Closes the callback when the processing of a traffic event action is completed.

IRoadEventCardViewFactory

Road event card view factory.

Methods
func makeRoadEventCardView(_ roadEvent: RoadEvent) -> IRoadEventCardView

Road event card.

Parameters

roadEvent

Road event.

Returns
func makeCreateRoadEventView(map: Map) -> ICreateRoadEventView

Interface for creating a road event.

Parameters

IRouteDetailsView

Route detail card protocol.

Properties

var isScrollEnabled

Value that determines whether route card content scrolling is enabled.

var contentSize

Route card content size.

IRouteEditorFactory

Map data source designer.

Methods
func createRouteEditorSource() -> RouteEditor

Creates a route editor.

IRouteListView

Route preview list protocol.

Properties

var isScrollEnabled

Value that determines whether scrolling of the route list is enabled.

var contentSize

Route list content size.

var trafficRouteSelectedCallback

((TrafficRoute) -> ())?

Closes the callback when the visible area of the map changes.

IRouteView

Route card preview protocol.

Properties

var route

ISDKError

Prorocol for all MobileSDK exceptions.

ISearchManager

Search engine. The main entry point for the reference API.

Methods
func suggest(
query: SuggestQuery
) -> Future<SuggestResult>

Gets hints that match this query.

Parameters

query

Query for a search hint in a directory.

func search(
query: SearchQuery
) -> Future<SearchResult>

Gets the directory objects that match the given query.

Parameters

query

Query for directory search prompts.

func searchById(
id: String
) -> Future<DirectoryObject?>

Gets a directory object by its string identifier.

Parameters

id

Directory string identifier. A complex identifier, which is obtained as a result of a WebAPI query, is possible.

func searchByDirectoryObjectId(
objectId: DgisObjectId
) -> Future<DirectoryObject?>

Gets a directory object by its identifier.

Parameters

objectId

Object identifier in a directory.

ISearchManagerFactory

A search engine factory with different data sources.

Methods
func makeOnlineManager() throws -> ISearchManager?

Creates a search engine working online.

func makeOfflineManager() throws -> ISearchManager?

Creates a search engine working with preloaded data.

func makeSmartManager() throws -> ISearchManager?

Creates a search engine working online or with preloaded data depending on the availability of internet connection.

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(path: String) -> Future<Style>
Parameters

path

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

name

bundle

Bundle

IThermometerControlView

Properties

LogSink

Logging receiver.

Methods
func write(
message: LogMessage
)
Parameters

message

SimpleClusterRenderer

Customizes the appearance of a cluster in the IMapObjectManager.

Methods
func renderCluster(
cluster: SimpleClusterObject
) -> SimpleClusterOptions
Parameters

StyleZoomToTiltRelation

Object to describe the dependence of the camera angle on the style zoom level.

Methods
func styleZoomToTilt(
styleZoom: StyleZoom
) -> Tilt
Parameters

styleZoom

Returns