Last active
September 6, 2018 18:37
-
-
Save dbouwman/5131087 to your computer and use it in GitHub Desktop.
Snipped showing geocoding w/ jquery and the Esri geocode service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
geocodeAddress: function (data) { | |
console.log('Geocoder called with ' + data); | |
//although there is a dijit that can do this search | |
//it's just a simple ajax call, so we will just use jquery | |
var url = 'http://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/find'; | |
this.layout.showSpinner(); | |
$.ajax(url, { | |
data: { | |
text: data, | |
f: 'json', | |
outSR:102100, | |
maxlocations:6 | |
}, | |
dataType: 'json', | |
success: this.geocodeResultsHandler , | |
error: this.geocodeError, | |
complete: this.geocodeComplete | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment