laptop and a wrench

漏洞

The View.popup.open() method fails to display the pop-up when calling the method within the search class event.

上次发布: November 11, 2019 ArcGIS API for JavaScript
漏洞 ID 编号 BUG-000124573
已提交August 16, 2019
上次修改时间June 5, 2024
适用范围ArcGIS API for JavaScript
找到的版本4.12
操作系统Windows OS
操作系统版本10.0
状态Non-Reproducible

附加信息

This issue is fixed in ArcGIS API for JavaScript 4.13 and not reproducible in ArcGIS API for JavaScript 4.14 (Developer Edition).

解决办法

Using a while loop with an iterator to prevent layerview.watch() from firing multiple queries causing the parcel pop-up glitch.

let t = 0;

 searchWidget.on("search-complete", (event) => {

  let resultGeometry = event.results[0].results[0].feature.geometry;

  mapView.whenLayerView(layer).then((layerView) => {

   console.log(layerView)

   layerView.watch("updating", (val) => {

    if (!val) { // wait for the layer view to finish updating

     while(t === 0){

     t++;

     layerView.queryFeatures({

      geometry: resultGeometry,

      returnGeometry: true

     }).then((results) => {

      console.log(results);

      layerView.highlight(results.features);

      console.log('opening popup');

      mapView.popup.open({

       features: [results.features[0]],

       location: results.features[0].geometry.centroid

      })

     });

  }

    }

   });

  });

 });

重现步骤

漏洞 ID: BUG-000124573

软件:

  • ArcGIS API for JavaScript

当漏洞状态发生变化时获得通知

下载 Esri 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项