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

Method _createWMSLayer

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

Source from the content-addressed store, hash-verified

929 }
930
931 _createWMSLayer(layerInfo, addedCallback) {
932 this.webMapService
933 .getWmsInfo(layerInfo)
934 .then(
935 (result) => {
936 const layerId = layerInfo.layerID || layerInfo.name;
937 if (result) {
938 const wmsUrl = this._getWMSUrl(layerInfo, result.version);
939 this._addBaselayer({ url: [wmsUrl], layerID: layerId, visibility: layerInfo.visible, bounds: result.bounds });
940 addedCallback && addedCallback();
941 }
942 },
943 (error) => {
944 addedCallback && addedCallback();
945 throw new Error(error);
946 }
947 )
948 .catch((error) => {
949 this.fire('layercreatefailed', { error, layer: layerInfo, map: this.map });
950 });
951 }
952
953 _createVectorLayer(layerInfo, features) {
954 const type = layerInfo.featureType;

Callers 1

_initBaseLayerMethod · 0.95

Calls 4

_getWMSUrlMethod · 0.95
_addBaselayerMethod · 0.95
getWmsInfoMethod · 0.45
fireMethod · 0.45

Tested by

no test coverage detected