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

Method createWMSSource

src/openlayers/mapping/WebMap.js:1464–1479  ·  view source on GitHub ↗

* @private * @function WebMap.prototype.createWMSSource * @description 创建wms地图source。 * @param {Object} layerInfo - 图层信息。 * @returns {ol.source.TileWMS} wms的source

(layerInfo)

Source from the content-addressed store, hash-verified

1462 * @returns {ol.source.TileWMS} wms的source
1463 */
1464 createWMSSource(layerInfo) {
1465 let that = this;
1466 return new TileWMS({
1467 url: layerInfo.url,
1468 wrapX: false,
1469 params: {
1470 LAYERS: layerInfo.layers ? layerInfo.layers[0] : '0',
1471 FORMAT: 'image/png',
1472 VERSION: layerInfo.version || '1.3.0'
1473 },
1474 projection: layerInfo.projection || that.baseProjection,
1475 tileLoadFunction: this.getCustomTileLoadFunction((src) => {
1476 return that.isAddProxy(src, layerInfo.proxy) ? `${that.getProxy('png')}${encodeURIComponent(src)}`: src;
1477 })
1478 });
1479 }
1480
1481 /**
1482 * @private

Callers 2

createBaseLayerMethod · 0.95
createSpecLayerMethod · 0.80

Calls 3

isAddProxyMethod · 0.80
getProxyMethod · 0.80

Tested by

no test coverage detected