Skip to main content

interface

CameraMoveController

Class to control the position of the camera 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

An 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

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()

Request to start 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()

Request to disable 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 received.

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>) -> ())?

Closing the callback with a road event creation result.

IDoubleTapAndPanGestureRecognizer

Properties
var scaleDoublingTranslation

Number of vertical shift points, resulting in twice the scale change.

IEnergyConsumption

Protocol for setting the power saving of the device.

Methods
func setFpsCallback(_ fpsCallback: FpsCallback?)

Set the callback function for changing fps.

Parameters
fpsCallback
FpsCallback?
Properties
var maxFps

Maximum allowable map refresh frequency.

var powerSavingMaxFps

Maximum allowable map refresh frequency in energy saving mode.

IHTTPClient

Network client interface for sending HTTP requests.

Methods
func send(
request: URLRequest,
callback: @escaping RequestDataCompletionCallback
)

Function for sending 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 receiving the result of a request.

IImageFactory

Methods
func make(pngData: Data, size: CGSize) -> Image

Create an image based on PNG data.

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

Create an image based on SVG data.

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

Create an animated image based on Lottie data.

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

Create an image based on the UIImage object. The make(pngData:size:) method works better if you have ready PNG data.

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

Create an image based on a pending UIImage object. The passed closure is called with a delay when the data is needed. The make(pngData:size:) method works better if you have ready PNG data.

Returns

ILocationProvider

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

Callback function to update the current geoposition. If the provider is available (call availabilityCallback with value true), this source always delivers a valid geoposition. A valid geoposition is a geoposition in which all fields have a valid value at the time it was sent to this channel (i.e. if the geoposition accuracy >= half the length of the Earth's equator, then the geoposition is valid for any of the correct coordinates specified in it). If the precision value <= 0, the position is considered invalid even if isAvailable == true. See the CLLocationManagerDelegate.locationManager(didUpdateLocations:) method.

availabilityCallback
AvailabilityCallback?

Callback function to change the availability of the geoposition source. If this function is called with the value true, all subsequent calls to locationCallback will contain a valid (up-to-date) geoposition. Even if geoposition tracking is not available, the ILocationProvider implementation can send a new geoposition, but it will be considered invalid. See the CLLocationManagerDelegate.locationManager(didFailWithError:) method.

func setDesiredAccuracy(_ accuracy: DesiredAccuracy)

Set the desired location accuracy. If the device cannot return a location with the desired accuracy, it can return a location with lower accuracy. If the platform does not provide a method similar in functionality, then this method must have an empty implementation.

Parameters
Properties
var lastLocation

The best currently known geoposition. If there is no currently known geoposition, nil is returned. The geoposition returned by this method may be invalid (see setCallbacks). This method should query the system for the best currently known geoposition and return it even if it is out of date and/or does not meet the required accuracy. If the platform API does not provide a method similar in functionality, this method should always return nil.

ILocationService

Geoposition source interface.

Properties
var lastLocation

The best currently known geoposition. If there is no currently known geoposition, nil is returned. The geoposition returned by this method may be invalid. This method needs to request the best currently known geoposition from the system and return it even if it is out of date and/or does not meet the required accuracy. If the platform API does not provide a similarly functional method, this method will always return nil.

IMagneticHeadingProvider

A 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 method CLLocationManagerDelegate.locationManager(didUpdateHeading:).

availabilityCallback
AvailabilityCallback?

Callback function to change 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

A 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 gesture handler.

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
func makeGestureView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView

Create a gesture processing layer.

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

Create a gesture processing layer.

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

Create a gesture processing layer.

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

Create a gesture processing layer.

Parameters
map
eventProcessor
coordinateSpace
Returns

IMapSnapshotter

Map image capture tool.

Methods
func makeImage(
scale: CGFloat,
orientation: UIImage.Orientation
) -> Future<UIImage>

Get an image of the map based on its current state. Can be called from any queue. The value is returned to Future on an undefined queue.

Parameters
scale

Multiplier of the received image (see UIImage.scale).

orientation

Image orientation (see UIImage.orientation.

func makeImage(
scale: CGFloat = 1,
orientation: UIImage.Orientation = .up
) -> Future<UIImage>

Get an image of the map based on its current state. Can be called from any queue. The value is returned to Future on an undefined queue.

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)

Add 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)

Remove 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)?

An 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. By default false.

var copyrightAlignment

Default is bottomRight.

var copyrightInsets

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

var urlOpener
((URL) -> ())?

Custom URL opening handler on tap to copywriting.

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)

Add the UIView marker.

Parameters
markerView
func add(markerViews: [IMarkerView])
Parameters
markerViews
func remove(markerView: IMarkerView)

Remove the UIView marker.

Parameters
markerView
func remove(markerViews: [IMarkerView])
Parameters
markerViews
func removeAll()

Remove 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

UI element for changing the map scale.

Returns
func makeTrafficAndParkingMapControl() -> UIControl

UI element to turn on/off the display of traffic jams and parking spaces.

Returns
func makeCompassControl() -> UIControl

UI element to display the compass.

Returns
func makeNavigationFollowingControl() -> NavigationFollowingControl

UI element to enable the tracking mode.

func makeTUGCControl() -> UIControl

UI element to create road events.

Returns
func makeIndoorControl() -> IndoorControl

UI element 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)

Show a road event card.

Parameters
roadEvent
Properties
var visibleAreaEdgeInsets

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

var visibleAreaEdgeInsetsChangedCallback
((UIEdgeInsets) -> ())?

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

var finishButtonCallback
(() -> ())?

Closing the callback when you press the End Route button.

INavigationViewControlsFactory

Navigator controls factory.

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

UI element with information about the next maneuver and the additional one.

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

UI element 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

UI element with information about the remaining distance and the approximate time of arrival/remaining travel time.

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

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

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

UI element to switch to a route with a shorter expected arrival time.

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

UI element for displaying vehicle speeds and traffic events on the route.

Parameters
uiModel
Returns

INavigationViewFactory

Navigator UI Factory.

Methods
func makeNavigationViewControlsFactory() -> INavigationViewControlsFactory

Create a factory of navigator controls.

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

Create a factory of map controls in the navigator.

Parameters
map

Map controller.

followManager

Tracking mode switch in the navigator.

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

Create the navigator UI.

Parameters
map

Map controller.

navigationManager

Navigation service.

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

Create 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

Create the UI of a routes preview list.

Parameters
routes

Routes list.

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

Create the UI of a route preview.

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

Create the UI of route details.

Parameters
route
startName

Name of the start point of the route.

finishName

Name of the end point of the route.

Returns

INavigatorFollowManager

Wrapper for switching tracking modes in the navigator.

Methods
func toggleFollowMode()

Switches the follow 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

UI element with information about the next maneuver and additional maneuver.

Properties
var onDidRequestLayout
(() -> ())?

Signal to update the layout.

IPositioningServicesFactory

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

Properties
var locationProvider

Geo-positioning source interface. If nil, SDK geopositioning functions are unavailable.

var magneticHeadingProvider

Magnetic orientation source interface. If nil, the SDK's magnetic orientation functions are unavailable.

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
(() -> ())?

Closing callback when the close button is clicked.

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

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

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

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

IRoadEventCardViewFactory

Road event vard 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

The 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

Create 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) -> ())?

Closing 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. Main entry point for the reference API.

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

Get hints that match this query.

Parameters
query

Query for a search hint in a directory.

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

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

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

Create a search engine working online.

func makeOfflineManager() throws -> ISearchManager?

Create a search engine working with preloaded data.

func makeSmartManager() throws -> ISearchManager?

Create 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

Create a source that receives data from 2GIS servers.

Returns
func createGeometryMapObjectSourceBuilder() -> GeometryMapObjectSourceBuilder

Create a data source with overlaid objects (for example, markers).

func createOfflineDGISSource() -> Source

Create a source that uses preloaded 2GIS data.

Returns
func createHybridDGISSource() -> Source

Create a source that uses data from 2GIS servers and preloaded 2GIS data.

Returns
func createRouteEditorSource(routeEditor: RouteEditor) -> RouteEditorSource

Create 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>

Getting a preset style.

func loadFile(path: String) -> Future<Style>

Load a custom style from a specified file on the absolute path.

Parameters
path
func loadFile(url: URL) -> Future<Style>

Load a custom style from a specified file by URL. The URL must follow the “file:” pattern, otherwise an error will be returned.

Parameters
url
URL
func loadResource(name: String, bundle: Bundle) -> Future<Style>

Load a custom style by name from a specified package.

Parameters
name
bundle
Bundle

IThermometerControlView

Properties
var eventsPosition

LogSink

Logging receiver.

Methods
func write(
message: LogMessage
)
Parameters
message

SimpleClusterRenderer

A class for customizing 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