* @private * @function WebMap.prototype.createWMSSource * @description 创建wms地图source。 * @param {Object} layerInfo - 图层信息。 * @returns {ol.source.TileWMS} wms的source
(layerInfo)
| 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 |
no test coverage detected