laptop and a wrench

Bug

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

Last Published: November 11, 2019 ArcGIS API for JavaScript
Bug ID Number BUG-000124573
SubmittedAugust 16, 2019
Last ModifiedJune 5, 2024
Applies toArcGIS API for JavaScript
Version found4.12
Operating SystemWindows OS
Operating System Version10.0
StatusNon-Reproducible

Additional Information

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

Workaround

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

      })

     });

  }

    }

   });

  });

 });

Steps to Reproduce

Bug ID: BUG-000124573

Software:

  • ArcGIS API for JavaScript

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options