(layers, _taskID)
| 522 | } |
| 523 | |
| 524 | _initOverlayLayers(layers, _taskID) { |
| 525 | // 存储地图上所有的图层对象 |
| 526 | if (this.expectLayerLen > 0) { |
| 527 | layers.forEach((layer) => { |
| 528 | const type = this.webMapService.getDatasourceType(layer); |
| 529 | // TODO --- 暂不支持 SAMPLE_DATA |
| 530 | if (type === 'SAMPLE_DATA') { |
| 531 | this._addLayerSucceeded(); |
| 532 | this.fire('layercreatefailed', { |
| 533 | error: 'SAMPLE DATA is not supported', |
| 534 | layer, |
| 535 | map: this.map |
| 536 | }); |
| 537 | return; |
| 538 | } |
| 539 | |
| 540 | if (layer.visibleScale) { |
| 541 | const { minScale, maxScale } = layer.visibleScale; |
| 542 | const crs = this.map.getCRS(); |
| 543 | layer.minzoom = Math.max(this._transformScaleToZoom(minScale, crs, layer.tileSize), 0); |
| 544 | layer.maxzoom = Math.min(this.map.getMaxZoom()+1, this._transformScaleToZoom(maxScale, crs, layer.tileSize) + 0.0000001); |
| 545 | } |
| 546 | |
| 547 | if (type === 'tile') { |
| 548 | if (layer.autoUpdateTime) { |
| 549 | this._layerTimerList.push( |
| 550 | setInterval(() => { |
| 551 | this._initBaseLayer(layer); |
| 552 | }, layer.autoUpdateTime) |
| 553 | ); |
| 554 | } |
| 555 | this._initBaseLayer(layer, () => { |
| 556 | this._addLayerSucceeded(); |
| 557 | }); |
| 558 | } else { |
| 559 | this.getLayerFeatures(layer, _taskID, type); |
| 560 | if (layer.autoUpdateTime) { |
| 561 | this._layerTimerList.push( |
| 562 | setInterval(() => { |
| 563 | this.getLayerFeatures(layer, _taskID, type); |
| 564 | }, layer.autoUpdateTime) |
| 565 | ); |
| 566 | } |
| 567 | } |
| 568 | }, this); |
| 569 | } |
| 570 | } |
| 571 | |
| 572 | _initOverlayLayer(layerInfo, features = [], mergeByField, featureProjection) { |
| 573 | const { layerID, layerType, visible, style, featureType, projection } = layerInfo; |
no test coverage detected