I have a search widget in my app.
After the search widget address is applied I have it run some code to return features within a certain distance.
This all works great....
// SEARCH WIDGET
var searchWidget = new Search({
view: view,
popupEnabled: false
});
searchWidget.on("select-result", function () {
searchRadius();
});
But what I want to do is pass the Search Widget an Address not manually enter it in the widget.
I want to read from a table and pass the individual addresses to the search widget and get the result from the code that have written.
Can I pass the searchWidget an address? If so an examples out there?
Solved! Go to Solution.
just saw this....looks promising
https://community.esri.com/thread/197592-parse-search-widget-to-a-html-search-form
just saw this....looks promising
https://community.esri.com/thread/197592-parse-search-widget-to-a-html-search-form
Jay,
In case that does not get you there, The method on the search widget is called search.
https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Search.html#search
yea the answer for the link that I posted was the same
var searchWidget = new Search{view: view1})
function mySubmitFunction () {
let element = document.getElementById("YourInputID")
let address = element.value
searchWidget.search(address).then((results) => {
console.log("Search widget results :", results)
})
})