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

Method addLayer

src/mapboxgl/mapping/VideoMap.js:137–147  ·  view source on GitHub ↗

* @function VideoMap.prototype.addLayer * @description 添加图层。 * @param {Object} layer - 图层配置。 * @param {string} layer.id - 图层 id * @param {string} layer.type - 图层类型 * @param {string|Object} layer.source - 数据源配置 * @param {Array} [layer.filter] - 过滤配置 * @param {Object} [layer.layou

(layer, beforeId)

Source from the content-addressed store, hash-verified

135 * @param {string} beforeId - 已经存在的图层 ID。
136 */
137 addLayer(layer, beforeId) {
138 if (!this._mapExisted()) {
139 return;
140 }
141 if (this.layerCache[layer.id]) {
142 return;
143 }
144 const currentLayer = new GeojsonLayer(this);
145 currentLayer.add(layer, beforeId);
146 this.layerCache[layer.id] = currentLayer;
147 }
148
149 /**
150 * @function VideoMap.prototype.addSource

Callers 2

addMethod · 0.45
_addVideoLayerMethod · 0.45

Calls 2

_mapExistedMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected