(layerInfo)
| 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) { |
no test coverage detected