Two quick thoughts:dojo.connect(locator, "onAddressToLocationsComplete"); Doesn't this require a callback?i.e.dojo.connect(locator, "onAddressToLocationsComplete", processResults);function processResults(addressCandidates){ //handle your processing here, i.e. zoom to, etc.}Also, in the API it lists both of these formats for the address:{ Street: "<street>", City: "<city>", State: "<state>", Zone: "<zone>"}{ street: "380 New York", city: "Redlands", state: "CA", zip: "92373" }(Note the difference in captialization...dunno if it bothers it or not, but it's a discrepancy I saw)
function init() { .... locator = new esri.tasks.Locator("http://gis.hamiltoncounty.in.gov/ArcGIS/rest/services/Addresses/GeocodeServer"); dojo.connect(locator, "onAddressToLocationsComplete", processResults); var address ={}; //or var address =new Object(); address.FULL_ADDRESS =FullAddressString; address.CITY =CityString; //optional locator.addressToLocations(address); .... } function processResults(addressCandidates) { //handle your processing here, i.e. zoom to, etc. }
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.