【问题标题】:Feature of showing the existing district on Map IN ArcGis JS在 ArcGis JS 的地图上显示现有区域的功能
【发布时间】:2021-12-17 12:06:47
【问题描述】:

请问ArcGIS中有什么方法可以帮助我在地图上显示当前的地区吗?

如上图,ArcGIS 有任何功能可以列出当前在此地图上的地区,例如,它可以列出:吉隆坡、莎阿南、布城等。并且没有显示当前未出现在此视图中的地区。

【问题讨论】:

    标签: arcgis arcgis-js-api


    【解决方案1】:

    您可以查询包含具有视图范围的地区的图层。

    如果该地区在您地图上的 FeatureLayer 中,那么您只需要查询图层视图,您的所有要素都已经是本地的,因为您实际上是看到它的。看看这个例子,它就是在ArcGIS JS Examples - FeatureLayerView query列表中显示一些特征信息。 在示例中,这是他如何进行查询的,

    layerView.queryFeatures({
        geometry: view.extent,
        returnGeometry: true,
        orderByFields: ["GEOID"]
    })
    .then(function (results) {
        graphics = results.features; // <- here are the features
        ...
    })
    .catch(function (error) {
        console.error("query failed: ", error);
    });
    

    现在,如果地图上没有包含地区的 FeatureLayer,则必须对包含该信息的服务进行查询。为此,您可以使用QueryTask ArcGIS JS API - QueryTask

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-11-09
      • 2022-01-24
      • 1970-01-01
      • 2021-12-06
      • 2021-02-02
      • 1970-01-01
      相关资源
      最近更新 更多