AnsweredAssumed Answered

Return more than one result with hitTest

Question asked by michaellodes on Nov 4, 2018
Latest reply on Nov 6, 2018 by rscheitlin
view.on("click", function (event) { 
  event.stopPropagation();
  var htr; // a single result from HitTestResult results[]
  view.hitTest(event)
     .then(function (response) {
       if (response.results.length){
         htr = response.results.filter(function (result) {
          return result.graphic.layer === lyr;
         })[0];
         console.log(htr);
         if (htr !== undefined){
             var arr = [];
             arr.push(htr.graphic);
             view.popup.open({
                 location: htr.mapPoint,
                 features: arr
             });
         }
       }
      });
});

I'm using the above hitTest function to check wether the user clicked on a feature that is overlapped by a query result feature and open its popup. It is working fine but when clicking on two or more features at the same time i want the arrow to appear in the popup, so the user can switch through. Is it possible to return more than one result?

Outcomes