-
The style has been fully loaded, and the map has rendered all visible tiles.
Declaration
Swift
public static var mapLoaded: Event<NoPayload> { get } -
Describes an error that has occurred while loading the Map. The
typeproperty defines what resource could not be loaded and themessageproperty will contain a descriptive error message. In case ofsourceortileloading errors,source-idwill contain the id of the source failing. In case oftileloading errors,tile-idwill contain the id of the tile.Declaration
Swift
public static var mapLoadingError: Event<MapLoadingErrorPayload> { get } -
The map has entered the idle state. The map is in the idle state when there are no ongoing transitions and the map has rendered all requested non-volatile tiles. The event will not be emitted if
setUserAnimationInProgressand / orsetGestureInProgressis set totrue.Declaration
Swift
public static var mapIdle: Event<NoPayload> { get } -
The requested style data has been loaded. The
typeproperty defines what kind of style data has been loaded. Event may be emitted synchronously, for example, whensetStyleJSONis used to load style.Based on an event data
typeproperty value, following use-cases may be implemented:style: Style is parsed, style layer properties could be read and modified, style layers and sources could be added or removed before rendering is started.sprite: Style’s sprite sheet is parsed and it is possible to add or update images.sources: All sources defined by the style are loaded and their properties could be read and updated if needed.
Declaration
Swift
public static var styleDataLoaded: Event<StyleDataLoadedPayload> { get } -
The requested style has been fully loaded, including the style, specified sprite and sources’ metadata.
Note: The style specified sprite would be marked as loaded even with sprite loading error (An error will be emitted via
.mapLoadingError). Sprite loading error is not fatal and we don’t want it to block the map rendering, thus this event will still be emitted if style and sources are fully loaded.Declaration
Swift
public static var styleLoaded: Event<NoPayload> { get } -
A style has a missing image. This event is emitted when the map renders visible tiles and one of the required images is missing in the sprite sheet. Subscriber has to provide the missing image by calling
addImage(_:id:sdf:contentInsets:).Declaration
Swift
public static var styleImageMissing: Event<StyleImageMissingPayload> { get } -
An image added to the style is no longer needed and can be removed using
removeImage(withId:).Declaration
Swift
public static var styleImageRemoveUnused: Event<StyleImageUnusedPayload> { get } -
A source data has been loaded. Event may be emitted synchronously in cases when source’s metadata is available when source is added to the style.
The
idproperty defines the source id.The
typeproperty defines if source’s metadata (e.g., TileJSON) or tile has been loaded. The property ofmetadatavalue might be useful to identify when particular source’s metadata is loaded, thus all source’s properties are readable and can be updated before map will start requesting data to be rendered.The
loadedproperty will be set totrueif all source’s data required for visible viewport of the map, are loaded. Thetile-idproperty defines the tile id if thetypefield equalstile.Declaration
Swift
public static var sourceDataLoaded: Event<SourceDataLoadedPayload> { get } -
The source has been added with
addSource(_:id:)oraddSource(withId:properties:). The event is emitted synchronously, therefore, it is possible to immediately read added source’s properties.Declaration
Swift
public static var sourceAdded: Event<SourceAddedPayload> { get } -
The source has been removed with
removeSource(withId:). The event is emitted synchronously, thus,allSourceIdentifierswill be in sync when the observer receives the notification.Declaration
Swift
public static var sourceRemoved: Event<SourceRemovedPayload> { get } -
The map finished rendering a frame. The
render-modeproperty tells whether the map has all data (full) required to render the visible viewport. Theneeds-repaintproperty provides information about ongoing transitions that trigger map repaint. Theplacement-changedproperty tells if the symbol placement has been changed in the visible viewport.Declaration
Swift
public static var renderFrameStarted: Event<NoPayload> { get } -
The camera has changed. This event is emitted whenever the visible viewport changes due to the MapView’s size changing or when the camera is modified by calling camera methods. The event is emitted synchronously, so that an updated camera state can be fetched immediately.
Declaration
Swift
public static var renderFrameFinished: Event<RenderFrameFinishedPayload> { get } -
The camera has changed. This event is emitted whenever the visible viewport changes due to the MapView’s size changing or when the camera is modified by calling camera methods. The event is emitted synchronously, so that an updated camera state can be fetched immediately.
Declaration
Swift
public static var cameraChanged: Event<NoPayload> { get } -
The
ResourceRequestevent allows client to observe resource requests made by a map or snapshotter.Declaration
Swift
public static var resourceRequest: Event<ResourceRequestPayload> { get }
Event Structure Reference