({
url,
layerID,
parentLayerId,
visibility = true,
minzoom = 0,
maxzoom,
isIserver = false,
tileSize = 256,
bounds
})
| 2608 | } |
| 2609 | |
| 2610 | _addBaselayer({ |
| 2611 | url, |
| 2612 | layerID, |
| 2613 | parentLayerId, |
| 2614 | visibility = true, |
| 2615 | minzoom = 0, |
| 2616 | maxzoom, |
| 2617 | isIserver = false, |
| 2618 | tileSize = 256, |
| 2619 | bounds |
| 2620 | }) { |
| 2621 | const source = { |
| 2622 | type: 'raster', |
| 2623 | tiles: url, |
| 2624 | minzoom: minzoom || 0, |
| 2625 | maxzoom: maxzoom || this.map.getMaxZoom() + 1, |
| 2626 | tileSize: isIserver ? this.rasterTileSize : tileSize, |
| 2627 | rasterSource: isIserver ? 'iserver' : '', |
| 2628 | prjCoordSys: |
| 2629 | isIserver && !this.isOnlineBaseLayer(url[0], this.baseProjection) && +this.baseProjection.split(':')[1] > 0 |
| 2630 | ? { epsgCode: this.baseProjection.split(':')[1] } |
| 2631 | : '', |
| 2632 | proxy: this.baseLayerProxy |
| 2633 | }; |
| 2634 | if (bounds) { |
| 2635 | source.bounds = bounds; |
| 2636 | } |
| 2637 | let sourceId = source; |
| 2638 | if (this.map.getSource(layerID) && (!this.map.getLayer(layerID) || !this.checkSameLayer || !this._isSameRasterLayer(layerID, source))) { |
| 2639 | sourceId = `${layerID}_${+new Date()}`; |
| 2640 | this.map.addSource(sourceId, source); |
| 2641 | } |
| 2642 | this._addLayer( |
| 2643 | { |
| 2644 | id: layerID, |
| 2645 | type: 'raster', |
| 2646 | source: sourceId, |
| 2647 | minzoom: minzoom || 0, |
| 2648 | maxzoom: maxzoom || this.map.getMaxZoom() + 1, |
| 2649 | layout: { |
| 2650 | visibility: this._getVisibility(visibility) |
| 2651 | } |
| 2652 | }, |
| 2653 | parentLayerId |
| 2654 | ); |
| 2655 | this.baseLayerProxy = null; |
| 2656 | } |
| 2657 | |
| 2658 | /** |
| 2659 | * @private |
no test coverage detected