任意几何范围查询

几何范围查询,即在指定数据集集合中查找符合几何范围的矢量要素,并在客户端中展示出来。本示例为:在 World 数据服务中查询任意几何范围的要素。

使用接口 L.supermap.featureService 在 “World:Countries” 数据集中采用相交空间查询模式查询符合此几何范围的矢量要素。

// 设置几何查询范围
var polygon = L.polygon([[0, 0], [-30, 0], [-10, 30], [0, 0]], {color: 'red'});
// 设置任意几何范围查询参数
var geometryParam = new SuperMap.GetFeaturesByGeometryParameters({
    datasetNames: ["World:Countries"],
    geometry: polygon,
    spatialQueryMode: "INTERSECT" // 相交空间查询模式
});
// 创建任意几何范围查询实例
L.supermap .featureService(url) .getFeaturesByGeometry(geometryParam,function (serviceResult) {
    // 获取服务器返回的结果
    var featuers = serviceResult.result.features;
});

查看完整示例代码

results matching ""

    No results matching ""