(layerInfo, addedCallback)
| 719 | } |
| 720 | |
| 721 | _createWMTSLayer(layerInfo, addedCallback) { |
| 722 | this.webMapService |
| 723 | .getWmtsInfo(layerInfo, this.map.getCRS().epsgCode) |
| 724 | .then( |
| 725 | (result) => { |
| 726 | const layerId = layerInfo.layerID || layerInfo.name; |
| 727 | if (result.isMatched) { |
| 728 | const wmtsUrl = this._getWMTSUrl(Object.assign({}, layerInfo, result)); |
| 729 | this._addBaselayer({ |
| 730 | url: [wmtsUrl], |
| 731 | layerID: layerId, |
| 732 | visibility: layerInfo.visible, |
| 733 | minzoom: result.matchMinZoom, |
| 734 | maxzoom: result.matchMaxZoom, |
| 735 | isIserver: false, |
| 736 | bounds: result.bounds |
| 737 | }); |
| 738 | addedCallback && addedCallback(); |
| 739 | } |
| 740 | }, |
| 741 | (error) => { |
| 742 | addedCallback && addedCallback(); |
| 743 | throw new Error(error); |
| 744 | } |
| 745 | ) |
| 746 | .catch((error) => { |
| 747 | this.fire('layercreatefailed', { error, layer: layerInfo, map: this.map }); |
| 748 | }); |
| 749 | } |
| 750 | |
| 751 | async _createBingLayer(layerName, layerInfo, addedCallback) { |
| 752 | let metaInfoUrl = `https://dev.virtualearth.net/REST/v1/Imagery/Metadata/RoadOnDemand?uriScheme=https&include=ImageryProviders&key=${this.bingMapsKey}&c=zh-cn`; |
no test coverage detected