Select to view content in your preferred language

Using Geocoder in Silverlight Web Map ... Slight Manipulation to Sample

919
5
09-20-2012 04:38 AM
danielchaboya
Regular Contributor
I'm looking to use this ESRI sample http://resources.arcgis.com/en/help/silverlight-api/samples/start.htm#AddressToLocation and I would like to make a modification to the Address Finder. 

In essence, all I need to have is a single input parameter (Address).  I've been playing around with the code for a while now and have yet to successfully manipulate the C# side of things.  On the xaml side i've removed all but the Address text boxes.  What needs to be done on the C# side of things to get this modification to work?  When I comment out all but the Address IF statements, the tool does not work.  I'm guessing it's more than  just removing those additional parameters (City, State, Zip).  Any help would be awesome.
0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
In essence, all I need to have is a single input parameter (Address).


You can use the 'Full address' field of the address locator.

In the REST API this field is called 'Simple Line Input', so code like :
Dictionary<string, string> address = addressParams.Address;
address.Add("Single Line Input", "400 Market Street, San Francisco, CA, 94111");
_locatorTask.AddressToLocationsAsync(addressParams);

returns the expected location.

Hope that helps.
0 Kudos
danielchaboya
Regular Contributor
Thanks for the reply Dominique.  I found a solution.  I was using the wrong name for my address field.  I kept using the name that is used for the ESRI geocoder, which is different than mine
0 Kudos
gabrielvazquez
Deactivated User
Dominique,
I am attempting to do the same thing however we cant get the single line working. Our geocoding service is the NA composite locator that comes with 10.1 and I built the app using the Find Address Sample. I added a singleLine text field and I'm using the same syntax you recommend
address.Add("Single Line Input", "400 Market Street, San Francisco, CA, 94111");
.

However the geocoder doesnt seem to respond. it works still for the seperated Street, City, State, Zip fields. But not when I simply specify the single line option. The Single Line query works directly on the Rest Services Directory for the locator though.

If I follow the Find Address Sample, is there anything else that must be changed or altered to use the single line option, perhaps in the AddresstoLocationsCompleted method?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
0 Kudos
gabrielvazquez
Deactivated User
0 Kudos