Is there a way to take advantage of the 'suggest' of the World Geocoding Service?

1574
4
Jump to solution
12-03-2014 02:05 PM
TracySchloss
Frequent Contributor

I see there are some newer features in the REST API documentation for the World Geocoding Service.  I really like the idea of 'suggest' that lets the user to enter part of an address and get a list of suggested matches.

Is there a way to take advantage of this through the Javascript API, maybe through something like esri.request?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
StevenGraf1
Occasional Contributor III
var geocoder = new Geocoder({
    map: map,
autocomplete: true
  },"search");

The autocomplete:true property will give suggestions.  Is this what you were looking for?

View solution in original post

0 Kudos
4 Replies
StevenGraf1
Occasional Contributor III
var geocoder = new Geocoder({
    map: map,
autocomplete: true
  },"search");

The autocomplete:true property will give suggestions.  Is this what you were looking for?

0 Kudos
TracySchloss
Frequent Contributor

I've always used a locator task and not the geocoder dijit, because I always feel like I have more control with a task compared to the dijits.  I guess I need to give the dijit a 2nd look. 

0 Kudos
MattDriscoll
Esri Contributor

The locator task has a suggestLocations method which uses the locator suggest.

locator-amd | API Reference | ArcGIS API for JavaScript

0 Kudos
TracySchloss
Frequent Contributor

Maybe I should try that instead.  Going back through a geocoder dijit example,  I'm remembering what I didn't like about it in the first place - completely flaky behavior!  It will suggest my address, but when I select it to complete the navigation zoom etc, it's takes me instead to some other location entirely!  I know I will get nothing but complaints from the end users if I start using this instead.

0 Kudos