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

Method onAdd

src/mapboxgl/overlay/MapvLayer.js:55–66  ·  view source on GitHub ↗

* @function MapvLayer.prototype.onAdd * @description 添加图层到地图。 * @param {Object} map - 地图对象。

(map)

Source from the content-addressed store, hash-verified

53 * @param {Object} map - 地图对象。
54 */
55 onAdd(map) {
56 this.map = map;
57 this.mapContainer = map.getCanvasContainer();
58 this.renderer = new MapvRenderer(map, this.dataSet, this.mapVOptions, {
59 transferCoordinate: this._transferCoordinate,
60 getCenterPixel: this._getCenterPixel,
61 getResolution: this._getResolution,
62 validZoom: this._validZoom.bind(this)
63 }, { mapElement: this.map.getCanvas(), targetElement: this.mapContainer, id: this.id });
64 this.mapContainer.style.perspective = this.map.transform.cameraToCenterDistance + 'px';
65 this.bindEvent();
66 }
67
68 /**
69 * @function MapvLayer.prototype.onRemove

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