Displaying popup on arcGIS map

354
2
12-26-2021 08:21 PM
altair
by
New Contributor III
after the user click on one of the data display in lists it will open a popup and show its details, in my current behavior, he just locates where the data comesfrom but no popup display.
 
const [locationList, setLocationList] = useState([]);
 
const onLocationSelect = (location) => {
    mapDiv.current.center = [
         location.geoCode.longitude,
         location.geoCode.latitude,
    ];
    mapDiv.current.popup.open({
         //open what record selected
     });
};
 
<LocationSearchWidget
       locations={locationList}
       setViewLocationList={setViewLocationList}
       viewLocationList={viewLocationList}
       setActiveLocation={onLocationSelect}
       startSearch={onStartSearch}
/>
0 Kudos
2 Replies
ABishop
MVP Regular Contributor

I'm confused... what is the question?

Amanda Bishop, GISP
TahirChutiya
New Contributor

do this.

point.popupTemplate = {
  content: [{
    type: "text", // Autocasts as new TextContent
    text: "The {expression/predominance-tree} species occurs more often"
      + " than other tree species in the area."
  }]
};

then

features:[point]

0 Kudos