Select to view content in your preferred language

Synchronous request to search address on map

1434
2
05-29-2014 12:42 PM
BhavinSanghani
Frequent Contributor
I have one scenario in my product related to address search over multiple geocoding services. My product is integrated with ArcGIS Server (on premises or arcgisonline). I am allowing user to enter address on the form and performing address search. I am using  Locator for that. I need to use one primary geocoding service and other as a backup services. Let's say if I don't find address from primary geocoding service then I have to use other backup services from the list. The question is - can I perform synchronous address search using Locator? That way, in case primary service fails then I can send request to another service and loop it.
0 Kudos
2 Replies
ManishkumarPatel
Deactivated User
I have one scenario in my product related to address search over multiple geocoding services. My product is integrated with ArcGIS Server (on premises or arcgisonline). I am allowing user to enter address on the form and performing address search. I am using  Locator for that. I need to use one primary geocoding service and other as a backup services. Let's say if I don't find address from primary geocoding service then I have to use other backup services from the list. The question is - can I perform synchronous address search using Locator? That way, in case primary service fails then I can send request to another service and loop it.



Hi,

you could try making ajax calls based on the response you can try to loop through and call another ajax till condition is satisfied.
0 Kudos
JeffPace
MVP Alum
you want to use a deferred

http://dojotoolkit.org/reference-guide/1.9/dojo/Deferred.html#dojo-deferred

So you can do

deferred = geocode request

deferred.then(
if(success){
}else {
try geocode # 2
}
0 Kudos