SymbolLayer class
Renders point based data as symbols on the map using text and/or icons. Symbols can also be created for line and polygon data as well.
- Extends
Symbol |
Constructs a new SymbolLayer. |
metadata | A property for associating custom data with the layer. |
get |
Gets the options of the symbol layer. |
get |
Gets the source provided when creating the layer. |
set |
Sets the options of the symbol layer. |
get |
Gets the id of the layer |
get |
Gets the map that the layer is currently added to, or null. |
on |
Initialization method for the layer which is called when added to the map. |
on |
Method that is called when the layer is removed from the map. Should perform any necessary cleanup for the layer. |
Constructs a new SymbolLayer.
new SymbolLayer(source: string | Source, id?: string, options?: SymbolLayerOptions)
Parameters
- source
-
string | Source
The id or instance of a data source which the layer will render.
- id
-
string
The id of the layer. If not specified a random one will be generated.
- options
- SymbolLayerOptions
The options of the polygon layer.
A property for associating custom data with the layer.
metadata?: any
Property Value
any
Inherited From Layer.metadata
Gets the options of the symbol layer.
function getOptions(): SymbolLayerOptions
Returns
Gets the source provided when creating the layer.
function getSource(): string | Source
Returns
string | Source
Sets the options of the symbol layer.
function setOptions(options: SymbolLayerOptions)
Parameters
- options
- SymbolLayerOptions
Gets the map that the layer is currently added to, or null.
function getMap(): Map
Returns
Inherited From Layer.getMap
Initialization method for the layer which is called when added to the map.
function onAdd(map: Map)
Parameters
- map
- Map
The map the layer has been added to.
Inherited From Layer.onAdd
Method that is called when the layer is removed from the map. Should perform any necessary cleanup for the layer.
function onRemove()
Inherited From Layer.onRemove