Select to view content in your preferred language

Locator - Output Spatial Reference

971
4
11-17-2010 03:25 AM
RobChouinard
Frequent Contributor
Any chance of supporting the REST outSR (Output Spatial Reference) parameter in the Silverlight API for the Locator.AddressToLocationsAsync and Locator.LocationToAddressAsync methods?

Maybe final release?

Right now I have to do a seperate project call to the geometry service creating more overhead.

I'm using the RC and it is good stuff. Keep up the good work!
0 Kudos
4 Replies
JenniferNery
Esri Regular Contributor
Output Spatial Reference is one of the parameters in AddressToLocationAsync. Kindly see this documentation:
http://help.arcgis.com/en/webapi/silverlight/apiref/ESRI.ArcGIS.Client~ESRI.ArcGIS.Client.Tasks.Addr...

It is supported already, you just need a service that supports it (ArcGIS Server v10 and up) 🙂
0 Kudos
RobChouinard
Frequent Contributor
I was working with the locationtoaddress and couldnt find it and still can't. I guess I didn't look close enough at the addresstolocation. Am I over looking for the out spatial reference for the locationtoaddress or is that not included in the API?

ArcGISServer 10SP1
SL API 2.1RC

Thanks,

Rob
0 Kudos
JenniferNery
Esri Regular Contributor
You should be able to perform the following AddressToLocationAsync call.

  public MainPage()
  {
   InitializeComponent();

   Locator l = new Locator("Your GeocodeServer URL - v10 & up");
   AddressToLocationsParameters p = new AddressToLocationsParameters()
   {
    OutSpatialReference = new SpatialReference(4326)
   };
   
   p.Address["Street"] = "380 New York St.";
   p.Address["City"] = "Redlands";
   p.Address["State"] = "CA";
   p.Address["ZIP"] = "92373";

   p.OutFields.Add("*");

   l.AddressToLocationsCompleted += l_AddressToLocationsCompleted;
   l.AddressToLocationsAsync(p);
  }

  void l_AddressToLocationsCompleted(object sender, AddressToLocationsEventArgs e)
  {
   
  }
0 Kudos
JenniferNery
Esri Regular Contributor
Sorry I missed that you were looking at LocationToAddressAsync(), the SpatialReference that you define for the MapPoint parameter is the SpatialReference used for the outSR.
0 Kudos