For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Class MapSourceDataEvent
Hierarchy (View Summary)
- MapLibreEvent
- MapSourceDataEvent
Index
Constructors
Properties
Constructors
constructor
- new MapSourceDataEvent(
type:
| "dataloading"
| "data"
| "sourcedataloading"
| "sourcedata"
| "dataabort"
| "sourcedataabort",
data?: Omit<Partial<MapSourceDataEvent>, "type" | "dataType" | "target">,
): MapSourceDataEventParameters
- type:
| "dataloading"
| "data"
| "sourcedataloading"
| "sourcedata"
| "dataabort"
| "sourcedataabort" Optionaldata: Omit<Partial<MapSourceDataEvent>, "type" | "dataType" | "target">
Returns MapSourceDataEvent
- type:
Properties
coord
The tile ID of the tile being loaded or changed, if the event is related to loading of a tile.
dataType
dataType: "source"
isSourceLoaded
isSourceLoaded: boolean
True if the event has a dataType of source and the source has no outstanding network requests.
originalEvent
originalEvent: unknown
OptionalresourceTiming
resourceTiming?: PerformanceResourceTiming[]
Resource timing data, if collectResourceTiming is enabled for the source.
source
The style spec representation of the source if the event has a dataType of source.
OptionalsourceDataChanged
sourceDataChanged?: boolean
sourceDataType
sourceId
sourceId: string
target
The object that fired the event. Set when the event is fired, and narrowed to a more
specific type (e.g. Map, Marker) by the event subclasses.
tile
tile: any
The tile being loaded or changed, if the event has a dataType of source and
the event is related to loading of a tile.
type
type:
| "dataloading"
| "data"
| "sourcedataloading"
| "sourcedata"
| "dataabort"
| "sourcedataabort"
| "dataloading"
| "data"
| "sourcedataloading"
| "sourcedata"
| "dataabort"
| "sourcedataabort"
A
MapSourceDataEventis emitted with the source-relateddata,dataloading,dataabort,sourcedata,sourcedataloadingandsourcedataabortevents. ItsdataTypeis always'source'.Possible values for
sourceDataTypes are:'metadata': indicates that any necessary source metadata has been loaded (such as TileJSON) and it is ok to start loading tiles'content': indicates the source data has changed (such as when source.setData() has been called on GeoJSONSource)'visibility': send when the source becomes used when at least one of its layers becomes visible in style sense (inside the layer's zoom range and with layout.visibility set to 'visible')'idle': indicates that no new source data has been fetched (but the source has done loading)Example