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

Method onAdd

src/mapboxgl/overlay/theme/ThemeLayer.js:87–106  ·  view source on GitHub ↗

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

(map)

Source from the content-addressed store, hash-verified

85 * @description 添加该图层。
86 */
87 onAdd(map) {
88 this.map = map;
89 this._createCanvasContainer();
90
91 //处理用户预先(在图层添加到 map 前)监听的事件
92 this.addTFEvents();
93 this.map.on('resize', this.resizeEvent.bind(this));
94 this.map.on('zoomstart', this.zoomStartEvent.bind(this));
95 this.map.on('zoomend', this.zoomEndEvent.bind(this));
96 this.map.on('rotatestart', this.rotateStartEvent.bind(this));
97 this.map.on('rotate', this.rotateEvent.bind(this));
98 this.map.on('rotateend', this.rotateEndEvent.bind(this));
99 this.map.on('dragend', this.dragEndEvent.bind(this));
100 this.map.on('movestart', this.moveStartEvent.bind(this));
101 this.map.on('move', this.moveEvent.bind(this));
102 this.map.on('moveend', this.moveEndEvent.bind(this));
103 this.map.on('remove', this.removeFromMap.bind(this));
104
105 this.refresh();
106 }
107
108 /**
109 * @function ThemeLayer.prototype.refresh

Callers

nothing calls this directly

Calls 5

addTFEventsMethod · 0.95
refreshMethod · 0.95
bindMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected