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

Method addSource

src/mapboxgl/mapping/VideoMap.js:157–167  ·  view source on GitHub ↗

* @function VideoMap.prototype.addSource * @description 添加数据源。 * @param {string} id - 数据源 id。 * @param {Object} source - 图层源配置。 * @param {string} source.type - 只支持 geojson * @param {Object} source.data - geojson 数据。

(id, source)

Source from the content-addressed store, hash-verified

155 * @param {Object} source.data - geojson 数据。
156 */
157 addSource(id, source) {
158 if (!this._mapExisted()) {
159 return;
160 }
161 if (this.sourceCache[id]) {
162 return;
163 }
164 const geojsonSource = new GeojsonSource(this);
165 geojsonSource.add(id, source);
166 this.sourceCache[id] = geojsonSource;
167 }
168
169 /**
170 * @function VideoMap.prototype.removeLayer

Callers 15

VideoMapSpec.jsFile · 0.80
WebMapV2Spec.jsFile · 0.80
callbackFunction · 0.80
WebMapV3Spec.jsFile · 0.80
WebMapV22Spec.jsFile · 0.80
WebMapV2Spec.jsFile · 0.80
callbackFunction · 0.80
WebMapV3Spec.jsFile · 0.80
MapFunction · 0.80
MapFunction · 0.80
addMethod · 0.80
removeMethod · 0.80

Calls 2

_mapExistedMethod · 0.95
addMethod · 0.95

Tested by

no test coverage detected