使用几何查询实现绘制多边形跟地图相交,多边形绘制了,可地图获取不到features,(注:我地图的坐标系是4546)
代码如下:
var geometryParam = new SuperMap.GetFeaturesByGeometryParameters({
datasetNames: ["土地权属:TDQS_200600_460000"],
geometry: queryPolygonGeometry,
spatialQueryMode: "INTERSECT",
targetPrj:{"epsgCode":4546},
});
new mapboxgl.supermap.FeatureService(dataUrl).getFeaturesByGeometry(geometryParam, function (serviceResult) { console.log(serviceResult);
map.addSource("queryDatas", {
"type": "geojson",
"data": serviceResult.result.features
});
map.addLayer({
"id": "queryDatas",
"type": "fill",
"source": "queryDatas",
"paint": {
"fill-color": "rgba(255, 251, 240, 0.4)",
'fill-outline-color': "#0066FF",
},
});
});