I am migrating my application to the ArcGIS API for JS Version 4.13 from Version 3.15.
I would like to return a point so that I may use it in a query task.
My old code was: query.geometry = addressPoint;
I am not sure how to obtain this from using the Search widget:
var searchWidget = new Search({
view: view,
container: "searchWidget",
popupEnabled: false
});
searchWidget.on('search-complete', function(result){
console.log(result)
});
Thank you.
Solved! Go to Solution.
Hello Andrew,
To access the point geometry with the callback function you have, it will be result.results[0].results[0].feature.geometry.
Regards,
Jose
Hello Andrew,
To access the point geometry with the callback function you have, it will be result.results[0].results[0].feature.geometry.
Regards,
Jose
Thanks Jose! That worked.
I was able to use DevTools to figure out how to retrieve the name as well since I need that too.
addressText = result.results[0].results[0].name