首页 / 浏览问题 / WebGIS / 问题详情
根据点几何查询相邻线段的属性信息
3EXP 2023年09月08日

1. 使用产品:iserver 10i , iclient-leaflet 操作系统:win11 x64
2. 数据类型: 矢量数据工作空间, 通过tileImage加载服务
3. 问题详细描述:利用iclient-leaflet 通过tileImage方式加载线段地图服务, 通过官方示例提供的几何查询接口请求调用后, 无法正确获取属性信息
4. 问题重现步骤: 

(1) 代码片段:

map.on("click", function (evt) {
 var x = evt.latlng.lng;
 var y = evt.latlng.lat;
 if (x < -180.0 || x > 180.0 || y < -90 || y > 90) {
   return;
 }
 const point = {
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [x, y]
  },
 }

 var geometryParam = new L.supermap.GetFeaturesByGeometryParameters({
     datasetNames: ["guoshengdao_kaihua:guoshengdao_kaihua"],
        geometry: point,
        spatialQueryMode: "INTERSECT"
     });
       
        
 new L.supermap.FeatureService(url).getFeaturesByGeometry(geometryParam,function (serviceResult) {
     console.log("几何查询", serviceResult)
 });
})

(2) 问题截图:

1个回答

您好,通过您的代码片段来看您调用的是数据服务几何查询的接口,您检查一下您的服务地址,是否发布的是数据服务。

您可以参考示例:

数据服务的几何查询:https://iclient.supermap.io/examples/leaflet/editor.html#02_getFeatureByGeometry

地图服务的几何查询:https://iclient.supermap.io/examples/leaflet/editor.html#01_mapQueryByGeometry

希望能够帮助到您。

620EXP 2023年09月08日
...