几何查询时返回getFeatureByBuffer方法中传入的参数为空错误

0 投票
iclient 10i for leaflet开发时实现空间查询数据时,第一步的sql查询结果geometry已经有数据。但是第二步几何查询的结果返回值是400,错误内容为"getFeatureByBuffer方法中传入的参数为空"

L.supermap
            .featureService(dataurl)
            .getFeaturesBySQL(sqlParam, function (serviceResult) {
                 if(serviceResult.result.features){
                     var features = serviceResult.result.features.features;
                    geometry = features[0].geometry;
                    var geometryParam = new SuperMap.GetFeaturesByGeometryParameters({
                        datasetNames: [mapName+":"+layerName],
                        geometry: geometry,
                        spatialQueryMode: "INTERSECT"
                    });
                     L.supermap.featureService(dataurl).getFeaturesByGeometry(geometryParam, function (serviceResult) {
                        var idResults = [];//(此处返回值报错)
                        resultLayer = L.geoJSON(serviceResult.result.features, {
                            onEachFeature: function (feature, layer) {
                                 idResults.push(feature.properties);
                            }
                        });
                    });
                  }
           });

sql查询的结果geometry已经有数据。但是几何查询的结果返回值是400,错误内容为"getFeatureByBuffer方法中传入的参数为空"
5月 12 分类:  125次浏览 | 用户: 刘__ (1 分)
重新分类 5月 12 用户:胡延南

1个回答

0 投票

      L.supermap
            .featureService(url)
            .getFeaturesByGeometry(new SuperMap.GetFeaturesByGeometryParameters({
            datasetNames: ["World:Countries"],
            geometry: L.geoJSON(serviceResult.result.features.features[0]),
            spatialQueryMode: "INTERSECT"
        }),(e)=>{
                console.log(e)
            }) 

5月 12 用户: 阳俊林 名扬四海 (3,296 分)
...