Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 1.31 KB

File metadata and controls

52 lines (37 loc) · 1.31 KB

EChartsLayer class

npm i @naivemap/mapbox-gl-echarts-layer echarts

Signature:

export default class EChartsLayer implements mapboxgl.CustomLayerInterface

Implements: mapboxgl.CustomLayerInterface

Constructors

Constructor Description
(constructor)(id: string, option: ECOption) Constructs a new instance of the EChartsLayer class

Parameters

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
>

Methods

Method Description
setOption (option: ECOption) Call echartsInstance.setOption() to update the chart.

Example

// echart option
const option = {...}
const layer = new EChartsLayer('layer-id', option)

map.addLayer(layer)