MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / onAdd

Method onAdd

src/mapboxgl/overlay/HeatMapLayer.js:88–97  ·  view source on GitHub ↗

* @function HeatMapLayer.prototype.onAdd * @description 添加该图层。

(map)

Source from the content-addressed store, hash-verified

86 * @description 添加该图层。
87 */
88 onAdd(map) {
89 this.map = map;
90 const targetElement = this.map.getCanvasContainer();
91 const mapElement = this.map.getCanvas();
92 this.renderer = new HeatMapLayerRenderer({ id: this.id, ...this.options, convertLatlonToPixel: this._convertLatlonToPixel.bind(this), targetElement, mapElement });
93 if (this.features.features && this.features.features.length) {
94 this.renderer.setExtent(this.map.getBounds());
95 this.renderer.addFeatures(this.features);
96 }
97 }
98
99 /**
100 * @function HeatMapLayer.prototype.removeFromMap

Callers

nothing calls this directly

Calls 6

bindMethod · 0.80
getCanvasContainerMethod · 0.45
getCanvasMethod · 0.45
setExtentMethod · 0.45
getBoundsMethod · 0.45
addFeaturesMethod · 0.45

Tested by

no test coverage detected