MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / onAdd

Method onAdd

src/maplibregl/overlay/MapvLayer.js:43–54  ·  view source on GitHub ↗

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

(map)

Source from the content-addressed store, hash-verified

41 * @description 添加该图层
42 */
43 onAdd(map) {
44 this.map = map;
45 this.mapContainer = map.getCanvasContainer();
46 this.renderer = new MapvRenderer(map, this.dataSet, this.options, {
47 transferCoordinate: this._transferCoordinate,
48 getCenterPixel: this._getCenterPixel,
49 getResolution: this._getResolution,
50 validZoom: this._validZoom.bind(this)
51 }, { id: this.id, targetElement: this.mapContainer, mapElement: this.map.getCanvas() });
52 this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
53 this._bindEvent();
54 }
55/**
56 * @function MapvLayer.prototype.onRemove
57 * @description 添加该图层

Callers

nothing calls this directly

Calls 4

_bindEventMethod · 0.95
bindMethod · 0.80
getCanvasContainerMethod · 0.45
getCanvasMethod · 0.45

Tested by

no test coverage detected