npm i @naivemap/mapbox-gl-echarts-layer echarts
Signature:
export default class EChartsLayer implements mapboxgl.CustomLayerInterface
Implements: mapboxgl.CustomLayerInterface
Constructor | Description |
---|---|
(constructor)(id : string , option : ECOption ) |
Constructs a new instance of the EChartsLayer class |
id (string)
The ID of the layer.
option (ECOption)
The option of the Lines graph and Scatter (bubble) chart.
export type ECOption = echarts.ComposeOption<
| TitleComponentOption
| TooltipComponentOption
| LegendComponentOption
| LinesSeriesOption
| ScatterSeriesOption
| EffectScatterSeriesOption
>
Method | Description |
---|---|
setOption (option: ECOption) |
Call echartsInstance.setOption() to update the chart. |
// echart option
const option = {...}
const layer = new EChartsLayer('layer-id', option)
map.addLayer(layer)