Geocoder not returning any address candidates from JavaScript API

692
5
11-07-2011 06:40 AM
GarethMann
New Contributor III
I have taken the sample code for geocoding that I found here:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/locator_address.html

And tried to get it to work with my own geocoder. The only code that I have changed is the URL to my geocoder service, and the default address in the textbox, I also added a message box to display the number of candidates returned (for debugging).

For some reason, when I try to use my geocoder service it returns 0 candidates:
http://northmiamicra.org/geoCodeMyLocator.html

Even though it does return plenty of candidates if I just call the geocode service from rest:

http://192.168.110.10/ArcGIS_External/rest/services/MDStreets_NoOpaLocka/GeocodeServer/findAddressCa...

Any idea what the problem may be?

Could it be something to with some sort of caching? Because originally there was something wrong with the locator that i was using and I had to replace it with a new one. I have stopped and restarted the service and it is now working in the REST web interface but is still not working when called from the API.
0 Kudos
5 Replies
JeffPace
MVP Alum
I have taken the sample code for geocoding that I found here:

http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples/locator_address.html

And tried to get it to work with my own geocoder. The only code that I have changed is the URL to my geocoder service, and the default address in the textbox, I also added a message box to display the number of candidates returned (for debugging).

For some reason, when I try to use my geocoder service it returns 0 candidates:
http://northmiamicra.org/geoCodeMyLocator.html

Even though it does return plenty of candidates if I just call the geocode service from rest:

http://192.168.110.10/ArcGIS_External/rest/services/MDStreets_NoOpaLocka/GeocodeServer/findAddressCa...

Any idea what the problem may be?

Could it be something to with some sort of caching? Because originally there was something wrong with the locator that i was using and I had to replace it with a new one. I have stopped and restarted the service and it is now working in the REST web interface but is still not working when called from the API.



I can't view your rest service, its an internal address (192.168). My guess is this is the same problem your app is having, it cant see the geocoder.  If you had a format problem , you should at least get an error response.  I get "aborted"
0 Kudos
GarethMann
New Contributor III
Sorry I was not aware of the IP Address being internal only, I am learnuing new things every day, thanks for pointing that out.

I have now updated the page with what I think is the external IP address but I am still getting 0 resuts from the API:

http://northmiamicra.org/geoCodeMyLocator.html

And the rest service should now be visible for you here, it is returning 466 candidates:

http://209.149.254.202/ArcGIS_External/rest/services/MDStreets_NoOpaLocka/GeocodeServer/findAddressC...
0 Kudos
JeffPace
MVP Alum
Sorry I was not aware of the IP Address being internal only, I am learnuing new things every day, thanks for pointing that out.

I have now updated the page with what I think is the external IP address but I am still getting 0 resuts from the API:

http://northmiamicra.org/geoCodeMyLocator.html

And the rest service should now be visible for you here, it is returning 466 candidates:

http://209.149.254.202/ArcGIS_External/rest/services/MDStreets_NoOpaLocka/GeocodeServer/findAddressC...



Your parameter is wrong.

you need to change it to
var address = {"Single Line Input":dojo.byId("address").value}; 

instead of SingleInput
0 Kudos
GarethMann
New Contributor III
Thanks, that worked, what is the difference between "SingleInput" and "Single Line Input"? The ESRI sample uses "SingleInput".

Also, for some reason, it is returning 776 NW 125 ST as the closest match even though the closest match is obviously 776 NE 125 ST. Why would this be? This was never a problem in the locators I made with ArcGIS 9.x, using the same data.

In fact even if I use ESRI's geocode service used on the original sample page and input the city and state aswell (776 NE 125 ST, North Miami, Fl.), it still returns NW instead of NE as the top candidate match:
http://help.arcgis.com/en/webapi/javascript/arcgis/demos/locator/locator_address.html
0 Kudos
JeffPace
MVP Alum
They only difference I can see is there are running 10.02 and you are running 10. 

As for the result, its because the score on the NE is higher, but I cannot tell you why (in my opinion it shouldnt be).  That is a question for the ESRI geocoder voodoo folks.
0 Kudos