openlayer 截取
const url = item.mapUrl;
const _url = url.substring(url.indexOf('layers='),url.indexOf('&bbox='));
const layer = _url.split('=')[1];
console.log(layer)
const ip = url.substring(url.indexOf('http:'),url.indexOf('/geoserver'));
const Layer = new ol.layer.Image({
source: new ol.source.ImageWMS({
ratio: 1,
url: ip+ '/geoserver/tcyhy/wms',
params: {'FORMAT': 'image/png',
'VERSION': '1.1.1',
"STYLES": '',
"LAYERS": layer,
"exceptions": 'application/vnd.ogc.se_inimage',
}
})
});
this.map.addLayer(Layer)