SourceManager interface
A manager for the map control's sources. Exposed through the sources property of the atlas.Map class. Cannot be instantiated by the user.
Methods
| add(Source | Source[]) | Adds one or more data sources to the map. The map must be ready before a source can be added. Use the map.events.add method with event type 'ready'. |
| clear() | Removes all sources from the map. |
| get |
Retrieves a source with the specified id. |
| get |
Returns all rendered shape features in a source that match a specified filter. If the source is a vector tile source, a source layer name needs to be specified. |
| get |
Retrieves all sources that have been added to the map. |
| is |
Returns a boolean indicating if the source is loaded or not. |
| remove(string | Source | Array<string | Source>) | Removes one or more sources from the map by specifying the source id or providing the source itself. |
Method Details
add(Source | Source[])
Adds one or more data sources to the map. The map must be ready before a source can be added. Use the map.events.add method with event type 'ready'.
function add(source: Source | Source[])
Parameters
clear()
Removes all sources from the map.
function clear()
getById(string)
Retrieves a source with the specified id.
function getById(id: string)
Parameters
- id
-
string
Returns
getRenderedShapes(string | Source, Expression, string)
Returns all rendered shape features in a source that match a specified filter. If the source is a vector tile source, a source layer name needs to be specified.
function getRenderedShapes(source: string | Source, filter?: Expression, sourceLayer?: string)
Parameters
- source
-
string | Source
source to be queried
- filter
- Expression
a filter to limit the query
- sourceLayer
-
string
the layer where shapes and features are matched
Returns
getSources()
isSourceLoaded(string | Source)
Returns a boolean indicating if the source is loaded or not.
function isSourceLoaded(source: string | Source)
Parameters
- source
-
string | Source
The id of a source or a Source object.
Returns
boolean