LineLayer class
Renders line data on the map. Can be used with SimpleLine, SimplePolygon, CirclePolygon, LineString, MultiLineString, Polygon, and MultiPolygon objects.
- Extends
Constructors
Line |
Constructs a new LineLayer. |
Inherited Properties
metadata | A property for associating custom data with the layer. |
Methods
get |
Gets the options of the line layer. |
get |
Gets the source provided when creating the layer. |
set |
Sets the options of the line layer. |
Inherited Methods
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. |
Constructor Details
LineLayer(string | Source, string, LineLayerOptions)
Constructs a new LineLayer.
new LineLayer(source: string | Source, id?: string, options?: LineLayerOptions)
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
- LineLayerOptions
The options of the line layer.
Inherited Property Details
metadata
A property for associating custom data with the layer.
metadata?: any
Property Value
any
Inherited From Layer.metadata
Method Details
getOptions()
Gets the options of the line layer.
function getOptions(): LineLayerOptions
Returns
getSource()
Gets the source provided when creating the layer.
function getSource(): string | Source
Returns
string | Source
setOptions(LineLayerOptions)
Sets the options of the line layer.
function setOptions(options: LineLayerOptions)
Parameters
- options
- LineLayerOptions
The new options of the line layer.
Inherited Method Details
getId()
getMap()
Gets the map that the layer is currently added to, or null.
function getMap(): Map
Returns
Inherited From Layer.getMap
onAdd(Map)
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
onRemove()
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