Optional
attributionThe attribution for the source.
The id for the source. Must not be used by any existing source.
Optional
isfalse
if tiles can be drawn outside their boundaries, true
if they cannot.
The maximum zoom level for the source.
The minimum zoom level for the source.
Optional
reparsetrue
if tiles should be sent back to the worker for each overzoomed zoom level, false
if not.
Optional
roundtrue
if zoom levels are rounded to the nearest integer in the source data, false
if they are floor-ed to the nearest integer.
The tile size for the source.
Optional
abortAllows to abort a tile loading.
The tile to abort
Optional
hasTrue is the tile is part of the source, false otherwise.
The tile ID
This method does the heavy lifting of loading a tile. In most cases it will defer the work to the relevant worker source.
The tile to load
Optional
onThis method is called when the source is added to the map.
The map instance
Optional
onThis method is called when the source is removed from the map.
The map instance
Optional
prepareOptional
unloadAllows to unload a tile.
The tile to unload
The
Source
interface must be implemented by each source type, including "core" types (vector
,raster
,video
, etc.) and all custom, third-party types.Event
data
- Fired with{dataType: 'source', sourceDataType: 'metadata'}
to indicate that any necessary metadata has been loaded so that it's okay to callloadTile
; and with{dataType: 'source', sourceDataType: 'content'}
to indicate that the source data has changed, so that any current caches should be flushed.