MapEvents class
List of supported event types by the map
and map snapshotter
objects,
and event data format specification for each event.
Simplified 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──┐ │
│ │ │ │
│ ◀────────────────────────────┘ │
│◀────────MapLoaded─────────┤ │
│ │ │
│ │ │
│◀─────────MapIdle──────────┤ │
│ ┌ ─── ─┴─ ─── ┐ │
│ │ offline │ │
│ └ ─── ─┬─ ─── ┘ │
│ │ │
├─────────setCamera────────▶│ │
│ ├───────────get tiles───────────▶│
│ │ │
│ │┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │
│◀─────────MapIdle──────────┤ waiting for connectivity │ │
│ ││ Map renders cached data │
│ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │
│ │ │
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- CAMERA_CHANGED → const String
-
The camera has changed. This event is emitted whenever the visible viewport
changes due to the invocation of
setSize
,setBounds
methods 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. - MAP_IDLE → const String
-
The
map
has entered the idle state. Themap
is in the idle state when there are no ongoing transitions and themap
has rendered all requested non-volatile tiles. The event will not be emitted ifsetUserAnimationInProgress
and / orsetGestureInProgress
is set totrue
. - MAP_LOADED → const String
-
The style has been fully loaded, and the
map
has rendered all visible tiles. - MAP_LOADING_ERROR → const String
-
Describes an error that has occured while loading the Map. The
type
property defines what resource could not be loaded and themessage
property will contain a descriptive error message. In case ofsource
ortile
loading errors,source-id
will contain the id of the source failing. In case oftile
loading errors,tile-id
will contain the id of the tile - RENDER_FRAME_FINISHED → const String
-
The
map
finished rendering a frame. Therender-mode
property tells whether themap
has all data (full
) required to render the visible viewport. Theneeds-repaint
property provides information about ongoing transitions that triggermap
repaint. Theplacement-changed
property tells if the symbol placement has been changed in the visible viewport. - RENDER_FRAME_STARTED → const String
-
The
map
started rendering a frame. - RESOURCE_REQUEST → const String
-
The
ResourceRequest
event allows client to observe resource requests made by amap
ormap snapshotter
objects. - SOURCE_ADDED → const String
-
The source has been added with
addStyleSource
method. The event is emitted synchronously, therefore, it is possible to immediately read added source's properties. - SOURCE_DATA_LOADED → const String
- 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.
- SOURCE_REMOVED → const String
-
The source has been removed with
removeStyleSource
method. The event is emitted synchronously, thus,getStyleSources
will be in sync when theobserver
receives the notification. - STYLE_DATA_LOADED → const String
-
The requested style data has been loaded. The
type
property defines what kind of style data has been loaded. Event may be emitted synchronously, for example, whensetStyleJSON
is used to load style. - STYLE_IMAGE_MISSING → const String
-
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 callingaddStyleImage
method. - STYLE_IMAGE_REMOVE_UNUSED → const String
-
An image added to the style is no longer needed and can be removed using
removeStyleImage
method. - STYLE_LOADED → const String
- The requested style has been fully loaded, including the style, specified sprite and sources' metadata.