laptop and a wrench

Error

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

Última publicación: November 11, 2019 ArcGIS API for JavaScript
Número de ID del error BUG-000124573
EnviadoAugust 16, 2019
Última modificaciónJune 5, 2024
Relacionado conArcGIS API for JavaScript
Versión encontrada4.12
Sistema operativoWindows OS
Versión de sistema operativo10.0
EstadoNon-Reproducible

Información adicional

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

Solución alternativa

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

      })

     });

  }

    }

   });

  });

 });

Pasos para reproducir

ID del error: BUG-000124573

Software:

  • ArcGIS API for JavaScript

Recibir notificaciones cuando cambie el estado de un error

Descargar la aplicación de soporte de Esri

Descubrir más sobre este tema

Obtener ayuda de expertos en ArcGIS

Contactar con el soporte técnico

Descargar la aplicación de soporte de Esri

Ir a opciones de descarga