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

Method _getWMSUrl

src/common/mapping/WebMapV2.js:1016–1047  ·  view source on GitHub ↗
(mapInfo, version = '1.1.1')

Source from the content-addressed store, hash-verified

1014 }
1015
1016 _getWMSUrl(mapInfo, version = '1.1.1') {
1017 let url = mapInfo.url;
1018 const options = {
1019 service: 'WMS',
1020 request: 'GetMap',
1021 layers:
1022 mapInfo.layers !== null && typeof mapInfo.layers === 'object'
1023 ? mapInfo.layers.join(',')
1024 : mapInfo.layers || '0', // 如果是多个图层,用逗号分隔
1025 styles: '',
1026 format: 'image/png',
1027 transparent: 'true',
1028 version,
1029 width: 256,
1030 height: 256
1031 };
1032 options.bbox = '{bbox}';
1033 if (version === '1.3.0' ) {
1034 options.crs = this.baseProjection;
1035 if (this.baseProjection === 'EPSG:4326') {
1036 options.bbox = '{bbox-wms-1.3.0}';
1037 } else {
1038 const proj = crsManager.getProj4().defs(this.baseProjection);
1039 if (proj.axis && proj.axis.indexOf('ne') === 0) {
1040 options.bbox = '{bbox-wms-1.3.0}';
1041 }
1042 }
1043 } else {
1044 options.srs = this.baseProjection;
1045 }
1046 return Util.urlAppend(url, this._getParamString(options, url));
1047 }
1048
1049 _setLayerID(mapInfo) {
1050 const sumInfo = {};

Callers 1

_createWMSLayerMethod · 0.95

Calls 3

_getParamStringMethod · 0.95
indexOfMethod · 0.80
getProj4Method · 0.45

Tested by

no test coverage detected