Methods
addLayer(layer, index)
appends the layer to the end of the list of layers
Parameters:
Name | Type | Description |
---|---|---|
layer | Layer | |
index | Number |
- Source
addListener(key, listener)
Adds a listener for map layer content changes
Parameters:
Name | Type | Description |
---|---|---|
key | * | |
listener | function | (eventName, layer)=>{} |
- Source
getLayerByID(id) → {Layer}
Fetches a specific layer by ID.
Parameters:
Name | Type | Description |
---|---|---|
id | Number | |
- Source
Returns:
layer with given id if any
- Type:
- Layer
getLayers() → {Array.<Layer>}
Returns an array of layers currently loaded on the map
- Source
Returns:
the list of layers
- Type:
- Array.<Layer>
removeLayer(index, dispose)
removes the layer at the specific index optionally "disposing" of any resources the layer is using.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
index | Number | ||
dispose | Boolean | true |
- Source
removeListener(key)
removes the listener associated with the given key
Parameters:
Name | Type | Description |
---|---|---|
key | * |
- Source
setLayer(layer, index)
Sets the given layer at the given index disposing of any layer previously at that index.
Parameters:
Name | Type | Description |
---|---|---|
layer | Layer | |
index | Number |
- Source