-
The
observableclass provides Publish&Subscribe functionality formapandmap snapshotterobjects. The dedicated methods return a cancellable object whosecancelmethod can be used to cancel an active subscription.
See moreSimplified diagram for events emitted by the map object. ┌─────────────┐ ┌─────────┐ ┌──────────────┐ │ Application │ │ Map │ │ResourceLoader│ └──────┬──────┘ └────┬────┘ └───────┬──────┘ │ │ │ ├───────setStyleURI────────▶│ │ │ ├───────────get style───────────▶│ │ │ │ │ │◀─────────style data────────────┤ │ │ │ │ ├─parse style─┐ │ │ │ │ │ │ StyleDataLoaded ◀─────────────┘ │ │◀───────type: Style────────┤ │ │ ├─────────get sprite────────────▶│ │ │ │ │ │◀────────sprite data────────────┤ │ │ │ │ ├──────parse sprite───────┐ │ │ │ │ │ │ StyleDataLoaded ◀─────────────────────────┘ │ │◀──────type: Sprite────────┤ │ │ ├─────get source TileJSON(s)────▶│ │ │ │ │ SourceDataLoaded │◀─────parse TileJSON data───────┤ │◀─────type: Metadata───────┤ │ │ │ │ │ │ │ │ StyleDataLoaded │ │ │◀──────type: Sources───────┤ │ │ ├──────────get tiles────────────▶│ │ │ │ │◀───────StyleLoaded────────┤ │ │ │ │ │ SourceDataLoaded │◀─────────tile data─────────────┤ │◀───────type: Tile─────────┤ │ │ │ │ │ │ │ │◀────RenderFrameStarted────┤ │ │ ├─────render─────┐ │ │ │ │ │ │ ◀────────────────┘ │ │◀───RenderFrameFinished────┤ │ │ ├──render, all tiles loaded──┐ │ │ │ │ │ │ ◀────────────────────────────┘ │ │◀────PerfStatsCollected────┤ │ │ │ │ │ │ │ │◀────────MapLoaded─────────┤ │ │ │ │ │ │ │ │◀─────────MapIdle──────────┤ │ │ ┌ ─── ─┴─ ─── ┐ │ │ │ offline │ │ │ └ ─── ─┬─ ─── ┘ │ │ │ │ ├─────────setCamera────────▶│ │ │ ├───────────get tiles───────────▶│ │ │ │ │ │┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │◀─────────MapIdle──────────┤ waiting for connectivity │ │ │ ││ Map renders cached data │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │ │ │ │Declaration
Objective-C
@interface MBMObservable : NSObjectSwift
class Observable : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(MapLoadedCallback) typedef void (^MBMMapLoadedCallback)(MBMMapLoaded * _Nonnull mapLoaded)Swift
typealias MapLoadedCallback = (MBMMapLoaded) -> Void -
The style has been fully loaded, and the
See moremaphas rendered all visible tiles. The event will be emitted only once for the current style. If it is required to observe an event where all required resources are loaded or rendered, please check the following events:MapIdle,StyleDataLoaded, andRenderFrameFinished.Declaration
Objective-C
@interface MBMMapLoaded : NSObjectSwift
class MapLoaded : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(MapIdleCallback) typedef void (^MBMMapIdleCallback)(MBMMapIdle * _Nonnull mapIdle)Swift
typealias MapIdleCallback = (MBMMapIdle) -> Void -
The
maphas entered the idle state. Themapis idle when there are no ongoing animations, transitions and themaphas rendered all requested non-volatile tiles (e.g., live traffic tiles). The event will not be emitted ifsetUserAnimationInProgressand / orsetGestureInProgressis set totrue.The
See moreMapIdlewill also be emitted after expired resources are re-fetched andmapre-renders the new data.Declaration
Objective-C
@interface MBMMapIdle : NSObjectSwift
class MapIdle : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(MapLoadingErrorCallback) typedef void (^MBMMapLoadingErrorCallback)(MBMMapLoadingError * _Nonnull mapLoadingError)Swift
typealias MapLoadingErrorCallback = (MBMMapLoadingError) -> Void -
Describes an error that has occurred while loading the
map. Thetypeproperty defines what resource could not be loaded, and themessageproperty will contain a descriptive error message.- In case of
MapLoadingErrorType.SourceorMapLoadingErrorType.Tileloading errors, thesourceIdproperty will contain the source’s name. - In case of
MapLoadingErrorType.Tileloading errors,tileIdwill contain theCanonicalTileIDof the tile.
Declaration
Objective-C
@interface MBMMapLoadingError : NSObjectSwift
class MapLoadingError : NSObject - In case of
-
The enumeration defines map loading errors.
See moreDeclaration
Objective-C
enum MBMMapLoadingErrorType : NSInteger {}Swift
enum MapLoadingErrorType : Int, @unchecked Sendable -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(StyleLoadedCallback) typedef void (^MBMStyleLoadedCallback)(MBMStyleLoaded * _Nonnull styleLoaded)Swift
typealias StyleLoadedCallback = (MBMStyleLoaded) -> Void -
The requested style has been fully loaded, including specified sprite, and sources’ metadata.
Note: The style specified sprite would be marked as loaded even with a sprite loading error (an error will be emitted via
See moreMapLoadingError). Sprite loading error is not fatal, and won’t block the map rendering; thus, the event will still be emitted if the style and sources are fully loaded.Declaration
Objective-C
@interface MBMStyleLoaded : NSObjectSwift
class StyleLoaded : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(StyleDataLoadedCallback) typedef void (^MBMStyleDataLoadedCallback)(MBMStyleDataLoaded * _Nonnull styleDataLoaded)Swift
typealias StyleDataLoadedCallback = (MBMStyleDataLoaded) -> Void -
The style data has been loaded. The event will be emitted once for each
StyleDataLoadedTypetype during style loading. If a new style is set, events will be emitted again for the newly set style.These events should not be used for runtime styling (using
RuntimeStylingOptionsis preferred), but only to check things like: loading time, loading progress of particular source, spritesheet, etc.Note: The event may be emitted synchronously, for example, when
See moresetStyleJSONis used to load style.Declaration
Objective-C
@interface MBMStyleDataLoaded : NSObjectSwift
class StyleDataLoaded : NSObject -
The enumeration defines the type of loaded style data.
See moreDeclaration
Objective-C
enum MBMStyleDataLoadedType : NSInteger {}Swift
enum StyleDataLoadedType : Int, @unchecked Sendable -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(SourceDataLoadedCallback) typedef void (^MBMSourceDataLoadedCallback)(MBMSourceDataLoaded * _Nonnull sourceDataLoaded)Swift
typealias SourceDataLoadedCallback = (MBMSourceDataLoaded) -> Void -
The
SourceDataLoadedevent is emitted when source data is loaded.Note: The event will be emitted synchronously in cases when the source’s metadata is available when a source is added to the style.
See moreDeclaration
Objective-C
@interface MBMSourceDataLoaded : NSObjectSwift
class SourceDataLoaded : NSObject -
The enumeration defines the type of loaded source data.
See moreDeclaration
Objective-C
enum MBMSourceDataLoadedType : NSInteger {}Swift
enum SourceDataLoadedType : Int, @unchecked Sendable -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(SourceAddedCallback) typedef void (^MBMSourceAddedCallback)(MBMSourceAdded * _Nonnull sourceAdded)Swift
typealias SourceAddedCallback = (MBMSourceAdded) -> Void -
The source has been added with
addStyleSourcemethod.Note: The event is emitted synchronously; therefore, it is possible to read added source’s properties immediately.
See moreDeclaration
Objective-C
@interface MBMSourceAdded : NSObjectSwift
class SourceAdded : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(SourceRemovedCallback) typedef void (^MBMSourceRemovedCallback)(MBMSourceRemoved * _Nonnull sourceRemoved)Swift
typealias SourceRemovedCallback = (MBMSourceRemoved) -> Void -
The source has been removed with
removeStyleSourcemethod.Note: The event is emitted synchronously; thus,
See moregetStyleSourceswill be in sync when theobserverreceives the notification.Declaration
Objective-C
@interface MBMSourceRemoved : NSObjectSwift
class SourceRemoved : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(StyleImageMissingCallback) typedef void (^MBMStyleImageMissingCallback)(MBMStyleImageMissing * _Nonnull styleImageMissing)Swift
typealias StyleImageMissingCallback = (MBMStyleImageMissing) -> Void -
A style needs an image that is missing from the sprite sheet. This event is emitted when the
maprenders visible tiles, and one of the required images is missing in the sprite sheet. The event observer has to provide the missing image by calling theaddStyleImagemethod.Note: Images added as a result of the
See moreStyleImageMissingevent will be treated as user-added images, and when the engine no longer needs a user-provided image, themapwill emitStyleImageRemoveUnusedevent.Declaration
Objective-C
@interface MBMStyleImageMissing : NSObjectSwift
class StyleImageMissing : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(StyleImageRemoveUnusedCallback) typedef void (^MBMStyleImageRemoveUnusedCallback)(MBMStyleImageRemoveUnused * _Nonnull styleImageRemoveUnused)Swift
typealias StyleImageRemoveUnusedCallback = (MBMStyleImageRemoveUnused) -> Void -
An image requested by the
mapthrough theStyleImageMissingevent is no longer needed and can be removed using theremoveStyleImagemethod. The application can decide whether the image should be kept or removed.Note: If there are no subscribers for the
See moreStyleImageRemoveUnusedevent, themapwill automatically remove the unused image.Declaration
Objective-C
@interface MBMStyleImageRemoveUnused : NSObjectSwift
class StyleImageRemoveUnused : NSObject -
This event is emitted whenever the visible viewport changes its size due to the invocation of the
See moresetSizeandsetBoundsmethods or when the camera is modified by calling camera methods. The event is emitted synchronously so that an updated camera state can be read immediately.Declaration
Objective-C
@interface MBMCameraChanged : NSObjectSwift
class CameraChanged : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(CameraChangedCallback) typedef void (^MBMCameraChangedCallback)(MBMCameraChanged * _Nonnull cameraChanged)Swift
typealias CameraChangedCallback = (MBMCameraChanged) -> Void -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(RenderFrameStartedCallback) typedef void (^MBMRenderFrameStartedCallback)(MBMRenderFrameStarted * _Nonnull renderFrameStarted)Swift
typealias RenderFrameStartedCallback = (MBMRenderFrameStarted) -> Void -
The
mapstarted rendering a frame.Note: The
See moremapwill emit the event asynchronously so the user-provided callback does not stall the rendering pipeline.Declaration
Objective-C
@interface MBMRenderFrameStarted : NSObjectSwift
class RenderFrameStarted : NSObject -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(RenderFrameFinishedCallback) typedef void (^MBMRenderFrameFinishedCallback)(MBMRenderFrameFinished * _Nonnull renderFrameFinished)Swift
typealias RenderFrameFinishedCallback = (MBMRenderFrameFinished) -> Void -
The
mapfinished rendering a frame.Note: The
See moremapwill emit the event asynchronously so the user-provided callback does not stall the rendering pipeline.Declaration
Objective-C
@interface MBMRenderFrameFinished : NSObjectSwift
class RenderFrameFinished : NSObject -
The enumeration defines the rendering mode for the rendered frame.
See moreDeclaration
Objective-C
enum MBMRenderModeType : NSInteger {}Swift
enum RenderModeType : Int, @unchecked Sendable -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(ResourceRequestCallback) typedef void (^MBMResourceRequestCallback)(MBMResourceRequest * _Nonnull resourceRequest)Swift
typealias ResourceRequestCallback = (MBMResourceRequest) -> Void -
The
See moreResourceRequestevent allows the application to observe resource requests made by amapormap snapshotterobject.Declaration
Objective-C
@interface MBMResourceRequest : NSObjectSwift
class ResourceRequest : NSObject -
The structure defines the information about the resource request.
See moreDeclaration
Objective-C
@interface MBMRequestInfo : NSObjectSwift
class RequestInfo : NSObject -
The structure defines the information about the response for the resource request.
See moreDeclaration
Objective-C
@interface MBMResponseInfo : NSObjectSwift
class ResponseInfo : NSObject -
The structure defines the information about errors that may occur during a resource request.
See moreDeclaration
Objective-C
@interface MBMResourceRequestError : NSObjectSwift
class ResourceRequestError : NSObject -
The enumeration defines the error type that may occur during a resource request.
See moreDeclaration
Objective-C
enum MBMRequestErrorType : NSInteger {}Swift
enum RequestErrorType : Int, @unchecked Sendable -
The enumeration defines the type of data source.
See moreDeclaration
Objective-C
enum MBMRequestDataSourceType : NSInteger {}Swift
enum RequestDataSourceType : Int, @unchecked Sendable -
The enumeration defines the method used to make a resource request.
See moreDeclaration
Objective-C
enum MBMRequestLoadingMethodType : NSInteger {}Swift
enum RequestLoadingMethodType : Int, @unchecked Sendable -
The enumeration defines the priority of a resource request.
See moreDeclaration
Objective-C
enum MBMRequestPriorityType : NSInteger {}Swift
enum RequestPriorityType : Int, @unchecked Sendable -
The enumeration defines the type of resource requested by the
See moremap.Declaration
Objective-C
enum MBMRequestResourceType : NSInteger {}Swift
enum RequestResourceType : Int, @unchecked Sendable -
The enumeration defines the source type that provides the requested resource.
See moreDeclaration
Objective-C
enum MBMResponseSourceType : NSInteger {}Swift
enum ResponseSourceType : Int, @unchecked Sendable -
Undocumented
Declaration
Objective-C
NS_SWIFT_NAME(GenericEventCallback) typedef void (^MBMGenericEventCallback)(MBMGenericEvent * _Nonnull genericEvent)Swift
typealias GenericEventCallback = (MBMGenericEvent) -> Void -
The generic event type.
See moreDeclaration
Objective-C
@interface MBMGenericEvent : NSObjectSwift
class GenericEvent : NSObject -
The time interval of an event. The
See morebeginproperty represents the time origin of an event, and theendproperty represents the time when the particular operation is complete. The timestamps are sampled at the origin and do not include the time required to dispatch an event.Declaration
Objective-C
@interface MBMEventTimeInterval : NSObjectSwift
class EventTimeInterval : NSObject -
Undocumented
Declaration
Objective-C
NSString* MBMMapLoadingErrorTypeToString(MBMMapLoadingErrorType map_loading_error_type)Swift
func MBMMapLoadingErrorTypeToString(_ map_loading_error_type: MapLoadingErrorType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMRenderModeTypeToString(MBMRenderModeType render_mode_type)Swift
func MBMRenderModeTypeToString(_ render_mode_type: RenderModeType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMRequestDataSourceTypeToString(MBMRequestDataSourceType request_data_source_type)Swift
func MBMRequestDataSourceTypeToString(_ request_data_source_type: RequestDataSourceType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMRequestErrorTypeToString(MBMRequestErrorType request_error_type)Swift
func MBMRequestErrorTypeToString(_ request_error_type: RequestErrorType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMRequestLoadingMethodTypeToString(MBMRequestLoadingMethodType request_loading_method_type)Swift
func MBMRequestLoadingMethodTypeToString(_ request_loading_method_type: RequestLoadingMethodType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMRequestPriorityTypeToString(MBMRequestPriorityType request_priority_type)Swift
func MBMRequestPriorityTypeToString(_ request_priority_type: RequestPriorityType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMRequestResourceTypeToString(MBMRequestResourceType request_resource_type)Swift
func MBMRequestResourceTypeToString(_ request_resource_type: RequestResourceType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMResponseSourceTypeToString(MBMResponseSourceType response_source_type)Swift
func MBMResponseSourceTypeToString(_ response_source_type: ResponseSourceType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMSourceDataLoadedTypeToString(MBMSourceDataLoadedType source_data_loaded_type)Swift
func MBMSourceDataLoadedTypeToString(_ source_data_loaded_type: SourceDataLoadedType) -> String! -
Undocumented
Declaration
Objective-C
NSString* MBMStyleDataLoadedTypeToString(MBMStyleDataLoadedType style_data_loaded_type)Swift
func MBMStyleDataLoadedTypeToString(_ style_data_loaded_type: StyleDataLoadedType) -> String!
Map events Reference