cesium加载OGC标准WMS服务,需要空间范围查询过滤,可以使用CQL过滤器进行多边形范围查询。
const viewer = new Cesium.Viewer("cesiumContainer", {});
let wmsImageryProvider = new Cesium.WebMapServiceImageryProvider({
url: "http://localhost:8080/geoserver/test/wms",
layers: "test:testlayer",
parameters: {
service: "WMS",
format: "image/png",
styles: "",
transparent: true,
// 使用CQL过滤器进行多边形范围查询
CQL_FILTER: "INTERSECTS(the_geom, POLYGON((126.7778 23.54559, 126.80321 23.58576, 126.85677 23.5758, 126.83067 23.51847, 126.7778 23.54559)))",
},
});
viewer.imageryLayers.addImageryProvider(wmsImageryProvider);