MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / _createWMTSLayer

Method _createWMTSLayer

src/common/mapping/WebMapV2.js:721–749  ·  view source on GitHub ↗
(layerInfo, addedCallback)

Source from the content-addressed store, hash-verified

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`;

Callers 1

_initBaseLayerMethod · 0.95

Calls 5

_getWMTSUrlMethod · 0.95
_addBaselayerMethod · 0.95
getWmtsInfoMethod · 0.45
getCRSMethod · 0.45
fireMethod · 0.45

Tested by

no test coverage detected