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

Method add

src/mapboxgl/mapping/layers/GeojsonLayer.js:29–41  ·  view source on GitHub ↗

* @function GeojsonLayer.prototype.add * @param {Object} layer - Mapbox layer 地图对象。 * @param {string} beforeId - Mapbox GL 地图对象。

(layer, beforeId)

Source from the content-addressed store, hash-verified

27 * @param {string} beforeId - Mapbox GL 地图对象。
28 */
29 add(layer, beforeId) {
30 const { id, source } = layer;
31 this.layerId = id;
32 if (this._existed()) {
33 return;
34 }
35 if (typeof source === 'object') {
36 const newData = this.eachData(cloneDeep(source.data));
37 layer.source.data = newData;
38 }
39
40 this.map.addLayer(layer, beforeId);
41 }
42
43 /**
44 * @function GeojsonLayer.prototype.remove

Callers 1

addLayerMethod · 0.95

Calls 3

_existedMethod · 0.95
eachDataMethod · 0.95
addLayerMethod · 0.45

Tested by

no test coverage detected