According to https://developers.arcgis.com/javascript/jsapi/geocoder-amd.html#find the geocoder widget has a method "find" which seems to be a manual way of forcing the widget to start the geocode.
I put this method into one of the esri samples but it never actually does anything.
Here is a JSFiddle of the Esri sample code plus the line geocoder.find()
My intent here is that I want to be able to have an address be automatically located to when the user loads the map.
1 Answer 1
The find method only executes a query to the geocode service and doesn't select features that get returned.
In order to mimic the behavior of the widget search I had to change geocoder.find()
to use the select
method on the widget object
all([geocoder.find()]).then(function(results){
geocoder.select(results[0].results[0]);
});
Explore related questions
See similar questions with these tags.