1

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.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Mar 14, 2014 at 14:24

1 Answer 1

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]);
});
answered Mar 14, 2014 at 14:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.