首页 / 浏览问题 / 云GIS / 问题详情
几何查询时返回getFeatureByBuffer方法中传入的参数为空错误
1EXP 2020年05月12日
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方法中传入的参数为空"

1个回答

      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)
            }) 

3,357EXP 2020年05月12日
...