0

What's the difference between Esri's Geocoder and Locator module in the JavaScript API?

I know the Geocoder defaults to ESRI's geocoding service, or both modules can be set to a custom Address Locator service on ArcGIS Server, which is my use scenario.

Is the Geocoder intended to be used more like a "widget" because it adds a search box?

Is there a reason you'd use one module over the other, or a case where'd you'd want to use both?

1 Answer 1

4

Great question! Very subjective but I'll try to keep it brief. Yes, with JavaScript API in mind, Geocoder is a dijit and Locator is a task. However, generally speaking, Geocoder and Locator terms can be used interchangeably.

If you need a pre-built solution for letting users search an address going to a locator service, you can just pull Geocoder widget in your application and it'll start working without you having to create an input text box, etc. However, it consumes a locator service/task/class (how ever you want to reference it) in the background it uses a locator/geocoding service (for the ease of understanding - a service that ends in "GeocodeServer") and performs a Locator task in the background.

Locator task in JS API is basically bare bone class that does the same thing, however, you'd have to call it and also have it read input from a text box etc. You could also use it with any kind of background geocoding that you want to do without requiring user interactions.

0

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