How would I retrieve the lat/long of the city/location selected using the Search Widget? I do not need to display this location on a map. All examples I have so far come across attach the Widget to a SceneView or Mapview.


You have to hook the select-result Event that fires when a search result is selected.

var searchWidget = new Search();

searchWidget.on("select-result", function(event){
   // Do whatever you want with your result
   var graphic = event.result.feature
   var extent = event.result.extent


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.