MCPcopy
hub / github.com/apache/echarts / MapView

Class MapView

src/chart/map/MapView.ts:32–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30
31
32class MapView extends ChartView {
33
34 static readonly type = SERIES_TYPE_MAP;
35 readonly type = SERIES_TYPE_MAP;
36
37 private _mapDraw: MapDraw;
38
39 render(
40 mapModel: MapSeries,
41 ecModel: GlobalModel,
42 api: ExtensionAPI,
43 payload: Payload
44 ): void {
45 // Not render if it is an toggleSelect action from self
46 if (payload && payload.type === 'mapToggleSelect'
47 && payload.from === this.uid
48 ) {
49 return;
50 }
51
52 const group = this.group;
53 group.removeAll();
54
55 if (mapModel.getHostGeoModel()) {
56 return;
57 }
58
59 let mapDraw = this._mapDraw;
60 if (mapDraw && payload && payload.type === 'geoRoam') {
61 mapDraw.resetForLabelLayout();
62 }
63
64 // Not update map if it is an roam action from self
65 if (!(payload && payload.type === 'geoRoam'
66 && payload.componentType === 'series'
67 && payload.seriesId === mapModel.id
68 )
69 ) {
70 if (mapSeriesNeedsDrawMap(mapModel)) {
71 mapDraw = mapDraw || (this._mapDraw = new MapDraw(api));
72 group.add(mapDraw.group);
73
74 mapDraw.draw(mapModel, ecModel, api, this, payload);
75 }
76 else {
77 this._clearMapDraw();
78 }
79 }
80 else {
81 mapDraw && group.add(mapDraw.group);
82 }
83
84 mapModel.get('showLegendSymbol') && ecModel.getComponent('legend')
85 && this._renderSymbols(mapModel);
86 }
87
88 /**
89 * @implements RoamHostView['__updateOnOwnRoam']

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…