(id, layerInfo = {})
| 229 | } |
| 230 | |
| 231 | async copyLayer(id, layerInfo = {}) { |
| 232 | const matchLayer = this._mapInfo.layers.find(layer => layer.id === id); |
| 233 | if (!matchLayer || this._getLayerOnMap(layerInfo.id)) { |
| 234 | return; |
| 235 | } |
| 236 | const copyLayerId = layerInfo.id || `${matchLayer.id}_copy`; |
| 237 | const copyLayer = { ...matchLayer, ...layerInfo, id: copyLayerId }; |
| 238 | if (l7LayerUtil.isL7Layer(copyLayer)) { |
| 239 | const layers = [copyLayer]; |
| 240 | const params = this._getAddL7LayersParams(layers, this._mapInfo.sources, layers); |
| 241 | await l7LayerUtil.addL7Layers(params); |
| 242 | } else { |
| 243 | if (typeof copyLayer.source === 'object') { |
| 244 | this.map.addSource(copyLayer.id, copyLayer.source); |
| 245 | copyLayer.source = copyLayer.id; |
| 246 | } |
| 247 | this.map.addLayer(copyLayer); |
| 248 | } |
| 249 | return copyLayer; |
| 250 | } |
| 251 | |
| 252 | updateOverlayLayer(layerInfo, features, mergeByField) { |
| 253 | if (layerInfo.renderSource.type === 'geojson') { |
nothing calls this directly
no test coverage detected