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

Method _updateLayer

src/common/mapping/WebMapV2.js:3139–3156  ·  view source on GitHub ↗
(layerInfo)

Source from the content-addressed store, hash-verified

3137 }
3138
3139 _updateLayer(layerInfo) {
3140 const {
3141 id,
3142 paint,
3143 source: { type, tiles, data, proxy }
3144 } = layerInfo;
3145 const source = this.map.getSource(id);
3146 if (source) {
3147 if (type === 'geojson' || source.type === 'geojson') {
3148 Object.keys(paint).forEach((name) => {
3149 this.map.setPaintProperty(id, name, paint[name]);
3150 });
3151 data && source.setData(data);
3152 } else if (type === 'raster') {
3153 this._updateRasterSource(id, { proxy, tiles });
3154 }
3155 }
3156 }
3157
3158 _updateRasterSource(sourceId, options) {
3159 if (!sourceId) {

Callers 2

_addLayerMethod · 0.95
mapbox-gl.jsFile · 0.80

Calls 5

_updateRasterSourceMethod · 0.95
forEachMethod · 0.80
getSourceMethod · 0.45
setPaintPropertyMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected