Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
esri-geocoder engine
// build the esri geocoder bloodhound engine
var esriBH = new Bloodhound({
name: "esri-geocoder",
datumTokenizer: function (d) {
return Bloodhound.tokenizers.whitespace(;
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
// use the searchExtent parameter to limit the results to roughly washington state
url: config.arcgisGeocodingBaseUrl +
filter: function (data) {
return $.map(data.suggestions, function (result) {
//typically this is a category or type of business (e.g. coffee shops)
if(result.isCollection === false) {
return {
name: result.text,
magicKey: result.magicKey,
source: "esri-geocoder"
ajax: {
beforeSend: function (jqXhr, settings) {
complete: function (jqXHR, status) {
limit: 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment