interface
CameraMoveController
Allows you to control the camera position for animation needs
The class must be thread-safe.
func animationTime() -> 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.
func availableValues() -> FollowValueOptionSet
func coordinates() -> GeoPoint?
func bearing() -> Bearing?
func tilt() -> Tilt?
func styleZoom() -> StyleZoom?
ICancellable
Token to cancel the operation, at the start of which it was obtained.
func cancel()
ICreateRoadEventView
Traffic event creation interface protocol.
var visibleAreaEdgeInsets
Visible area given the size of the road event creation card.
var visibleAreaEdgeInsetsChangedCallback
Callback closure when the visible area changes.
var cancelButtonCallback
Callback closure when the cancel button is pressed.
var createRoadEventRequestCallback
Closes the callback with a road event creation result.
IDoubleTapAndPanGestureRecognizer
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.
func setFpsCallback(_ fpsCallback: FpsCallback?)
Sets the callback function for changing FPS.
fpsCallback
IHTTPClient
Network client interface for sending HTTP requests.
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.
request
HTTP request.
callback
Callback function when obtaining the result of a request.
IImageFactory
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.
ILocationProvider
Geoposition source interface that the platform implements.
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.
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
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 \ .
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.
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.
headingCallback
Callback function to update the current direction. See the CLLocationManagerDelegate.locationManager(didUpdateHeading:) method.
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.
func makeZoomControl() -> ZoomControl
func makeCurrentLocationControl() -> CurrentLocationControl
func makeCompassControl() -> CompassControl
func makeTrafficControl() -> TrafficControl
func makeCreateRoadEventControl() -> CreateRoadEventControl
func makeIndoorControl(_ options: IndoorControlOptions) -> IndoorControl
func makeIndoorControl(_ options: IndoorControlOptions = .default) -> IndoorControl
IMapControlViewFactory
Factory of SwiftUI buttons to add to the map.
func makeCurrentLocationView() -> CurrentLocationView
func makeZoomView() -> ZoomView
func makeTrafficView(colors: TrafficViewColors) -> TrafficView
func makeIndoorView() -> IndoorView
func makeCompassView() -> CompassView
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).
IMapFactory
Matching map object factory.
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
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 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.
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
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.
@available(*, deprecated, message: "Please use makeGestureView(map:eventProcessor:coordinateSpace:)")
func makeGestureView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
func makeGestureView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
@available(*, deprecated, message: "Please use makeGestureView(map:eventProcessor:coordinateSpace:)")
func makeGestureView(
map: Map,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
func makeGestureView(
map: Map,
eventProcessor: IMapEventProcessor,
coordinateSpace: IMapCoordinateSpace
) -> UIView & IMapGestureView
Creates a gesture processing layer.
IMapSnapshotter
Map image capture tool.
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.
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.
IMapView
Map layer protocol.
func addObjectTappedCallback(callback: MapObjectTappedCallback)
Adds a callback function that will be called upon a click or a long click on the map.
callback
func addObjectLongPressCallback(callback: MapObjectTappedCallback)
callback
func removeObjectTappedCallback(callback: MapObjectTappedCallback)
Removes the callback function that was called upon a click or a long click on the map.
callback
func removeLongPressCallback(callback: MapObjectTappedCallback)
callback
var gestureView
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
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.
IMarkerViewFactory
Factory for creating UIView markers.
func make(
/// Отображение маркера.
view: UIView,
/// Точка на карте, к которой осуществляется привязка.
position: GeoPointWithElevation,
/// Относительная точка на View, к которой осуществяется привязка.
anchor: Anchor,
/// Дополнительное смещение в пикселях по оси X.
offsetX: CGFloat,
/// Дополнительное смещение в пикселях по оси Y.
offsetY: CGFloat
) -> IMarkerView
Create a marker.
IMarkerViewOverlay
Protocol for working with UIView markers on the map.
func removeAll()
Removes all markers.
IModelFactory
func make(modelData: Data) -> ModelData
Creating a model based on binary data.
INativeScaleProvider
Protocol describing the point-to-pixel conversion.
INavigationControlView
Navigator UI element.
INavigationMapControlsFactory
Map controllers factory in the navigator.
var followManager
Current object for switching tracking modes in the navigator.
INavigationView
var visibleAreaEdgeInsets
Visible area of the map, taking into account the navigator interface.
var visibleAreaEdgeInsetsChangedCallback
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.
INavigationViewFactory
Navigator UI factory.
INavigationViewsFactory
Factory of SwiftUI elements to add to the map.
INavigatorFollowManager
Wrapper for switching tracking modes in the navigator.
INavigatorFollowManagerObservation
INavigatorViewFactory
Factory of SwiftUI navigator elements.
INextManeuverControlView
Control with information about the next maneuver and additional maneuver.
var onDidRequestLayout
Signal to update the layout.
IRoadEventCardView
Road event card protocol.
func setRoadEvent(_ roadEvent: RoadEvent)
Update the card content with the data of a new road event.
roadEvent
Road event.
var closeButtonCallback
Closes the callback when the close button is clicked.
var roadEventActionResultCallback
Closes the callback when the processing of a traffic event action is completed.
var removeRoadEventActionResultCallback
Closes the callback when the processing of a traffic event action is completed.
IRoadEventCardViewFactory
Road event card view factory.
func makeRoadEventCardView(_ roadEvent: RoadEvent) -> IRoadEventCardView
Road event card.
func makeCreateRoadEventView(map: Map) -> ICreateRoadEventView
Interface for creating a road event.
IRouteDetailsView
Route detail card protocol.
IRouteEditorFactory
Map data source designer.
IRouteListView
Route preview list protocol.
IRouteView
Route card preview protocol.
var route
Route.
ISDKError
Prorocol for all MobileSDK exceptions.
ISearchManager
Search engine. The main entry point for the reference API.
func suggest(
query: SuggestQuery
) -> Future<SuggestResult>
Gets hints that match this query.
query
Query for a search hint in a directory.
func search(
query: SearchQuery
) -> Future<SearchResult>
Gets the directory objects that match the given query.
query
Query for directory search prompts.
func searchById(
id: String
) -> Future<DirectoryObject?>
Gets a directory object by its string identifier.
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.
objectId
Object identifier in a directory.
ISearchManagerFactory
A search engine factory with different data sources.
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.
func createOnlineDGISSource() -> Source
Creates a source that receives data from 2GIS servers.
func createGeometryMapObjectSourceBuilder() -> GeometryMapObjectSourceBuilder
Creates a data source with overlaid objects (for example, markers).
func createOfflineDGISSource() -> Source
Creates a source that uses preloaded 2GIS data.
func createHybridDGISSource() -> Source
Creates a source that uses data from 2GIS servers and preloaded 2GIS data.
func createRouteEditorSource(routeEditor: RouteEditor) -> RouteEditorSource
Creates a source of data for route editing.
IStyleFactory
Style download tool interface.
func setAttribute(name: String, value: AttributeValue) -> Self
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.
url
func loadResource(name: String, bundle: Bundle) -> Future<Style>
Loads a custom style by name from a specified package.
IThermometerControlView
var eventsPosition
LogSink
Logging receiver.
SimpleClusterRenderer
Customizes the appearance of a cluster in the IMapObjectManager.
func renderCluster(
cluster: SimpleClusterObject
) -> SimpleClusterOptions