interface
CameraMoveController
Allows you to control the camera position for animation needs<br/>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()
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.<br/>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.<br/>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.
IMapControlFactory
Button factory to add to the map.
Methods
func makeZoomControl() -> ZoomControl
Returns
func makeCurrentLocationControl() -> CurrentLocationControl
Returns
func makeCompassControl() -> CompassControl
Returns
func makeTrafficControl() -> TrafficControl
Returns
func makeCreateRoadEventControl() -> CreateRoadEventControl
Returns
func makeIndoorControl(_ options: IndoorControlOptions) -> IndoorControl
Parameters
func makeIndoorControl(_ options: IndoorControlOptions = .default) -> IndoorControl
Parameters
IMapControlViewFactory
Factory of SwiftUI buttons to add to the map.
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 makeCompassView() -> AnyView
Returns
AnyView
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 mapView
Card layer. Can only be read from the main queue.
var mapViewOverlay
Map layer for SwiftUI. Can be read from the main queue only.
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.<br/>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 mapControlViewFactory
Factory of standard SwiftUI controls that use a built-in style for managing the map.
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.
var mapMarkerViewOverlay
Object for working with SwiftUI View 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
func makeGestureView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
Parameters
@available(*, deprecated, message: "Please use makeGestureView(map:eventProcessor:coordinateSpace:)")
func makeGestureView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
Parameters
func makeGestureView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
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.<br/>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.<br/>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
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
callback
func addObjectLongPressCallback(callback: MapObjectTappedCallback)
Parameters
callback
func removeObjectTappedCallback(callback: MapObjectTappedCallback)
Removes the callback function that was called upon a click or a long click on the map.
Parameters
callback
func removeLongPressCallback(callback: MapObjectTappedCallback)
Parameters
callback
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`.
var copyrightAlignment
Default is `bottomRight`.
var copyrightInsets
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.<br/>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
IMarkerViewOverlay
Protocol for working with UIView markers on the map.
Methods
func removeAll()
Removes all markers.
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`.
INavigationControlView
Navigator UI element.
Properties
var isVisible
Element visibility.
var onDidChangeVisibility
(() -> ())?
Item visibility change signal.
INavigationMapControlsFactory
Map controllers factory in the navigator.
Methods
func makeTrafficAndParkingMapControl() -> UIControl
Control to enable/disable the display of traffic jams and parking lots.
Returns
func makeCompassControl(icon: UIImage?, highlightedIcon: UIImage?) -> UIControl
Control to display the compass.
Parameters
func makeIndoorControl() -> IndoorControl
Control to switch floors in the floor plan.
Returns
func makeTrafficControl() -> UIControl
UI element for a separate control for enabling/disabling traffic jams display.
Returns
func makeParkingControl() -> UIControl
UI element for a separate control for enabling/disabling parking lots display.
Returns
func makeCompassControl() -> UIControl
Returns
Properties
var followManager
Current object for switching tracking modes in the navigator.
INavigationMapViewsFactory
Factory of map SwiftUI controls in the navigator.
Methods
INavigationView
Methods
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
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
func makeMessageBarControl(
uiModel: Model
) -> UIView & INavigationControlView
Control for displaying navigation status messages, such as route search and GPS signal loss.
Parameters
func makeBetterRouteControl(
uiModel: Model
) -> UIView & INavigationControlView
Control to switch to a route with a shorter expected arrival time.
Parameters
INavigationViewFactory
Navigator UI factory.
Methods
func makeRouteListView(_ routes: [TrafficRoute]) -> IRouteListView
Creates the UI of a routes preview list.
Parameters
func makeRouteView(_ route: TrafficRoute) -> IRouteView
Creates the UI of a route preview.
Parameters
func makeRouteDetailsView(
_ route: TrafficRoute,
startName: String?,
finishName: String?
) -> IRouteDetailsView
Creates the UI of route details.
Parameters
route
Route.
startName
Name of the starting point of the route.
finishName
Name of the finish point of the route.
Returns
INavigationViewsFactory
Factory of SwiftUI elements to add to the map.
Methods
func makeFinishRouteDashboardView(
map: Map
) -> 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
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()
INavigatorViewFactory
Factory of SwiftUI navigator elements.
Methods
INextManeuverControlView
Control with information about the next maneuver and additional maneuver.
Implements: INavigationControlView
Properties
var onDidRequestLayout
(() -> ())?
Signal to update the layout.
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
func makeCreateRoadEventView(map: Map) -> ICreateRoadEventView
Interface for creating a road event.
Parameters
IRouteDetailsView
Route detail card protocol.
IRouteEditorFactory
Map data source designer.
Methods
IRouteListView
Route preview list protocol.
IRouteView
Route card preview protocol.
Properties
var route
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.
Returns
func makeOfflineManager() throws -> ISearchManager?
Creates a search engine working with preloaded data.
Returns
func makeSmartManager() throws -> ISearchManager?
Creates a search engine working online or with preloaded data depending on the availability of internet connection.
Returns
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
IThermometerControlView
Implements: INavigationControlView
Properties
var eventsPosition
LogSink
Logging receiver.
Methods
SimpleClusterRenderer
Customizes the appearance of a cluster in the IMapObjectManager.
Methods
func renderCluster(
cluster: SimpleClusterObject
) -> SimpleClusterOptions
Parameters