Modify Address Locator sample for Web Mercator projection

442
4
11-22-2010 09:22 AM
BenKoostra
New Contributor II
What are the steps to modify the Address Locator sample to use the Web Mercator projection?

http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#AddressToLocation

When you modify the xaml to use the "World_Street_Map" service instead of the "ESRI_StreetMap_World_2D" service (and modify the initial extents), the geocoded locations of US addresses show up off the coast of Africa.  Additional modifications are needed to reproject the coordinates to Web Mercator.

A better question might be -
Why not update all of the Silverlight samples in the Resource Center to use the Web Mercator projection?  The newer ArcGIS Online services have been available for about a year, and the older Lat/Lon ArcGIS Online map services are not being updated.  Is there a reason Silverlight developers should still be using the older services?

Thanks,
Ben
Lexington, Kentucky
0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor
If you are using a v10 locator service, you can set the OutSpatialReference parameter to Map.SpatialReference to get the result in the spatial reference of the map.
Alternatively, you can use (new ESRI.ArcGIS.Client.Projection.WebMercator()).FromGeographic(myPoint) to project to webmercator without the need of roundtripping to the server.
0 Kudos
BenKoostra
New Contributor II
Why do the Silverlight samples in the Resource Center not use the newer ArcGIS Online map services and the Web Mercator projection? The newer ArcGIS Online map services have been available for over a year, and the older Lat/Lon ArcGIS Online map services are not being updated. Is there a reason Silverlight developers should still be using the older map services?
0 Kudos
JenniferNery
Esri Regular Contributor
ArcGIS Server 9.3 and up is supported by SL/WPF API v2.1. From what I know, there is no particular reason why the samples still use older map services. But I do know that the primary purpose of these samples is to demonstrate the API. The samples usually get updated to show any breaking changes or new features in the API.

Thank you for your feedback. I'll forward your request to get the samples updated.
0 Kudos
RexHansen
Esri Contributor
Ben - Less than one quarter of the samples in the current Interactive Silverlight SDK operate in the WGS84 spatial reference.  While map content in WGS84 tiled services on ArcGIS Online is not being updated, and some are being retired, the functionality demonstrated in the Silverlight samples remains valid.  In fact, in some cases working in geographic coordinates has provided a more cognitive example for understanding functionality (e.g. manually creating graphics). That said, we are and have been updating samples periodically to reference basemap layers in Web Mercator.  This will continue where appropriate.  The Address Matching samples you mention in this post have been updated to use a Web Mercator basemap.  Unfortunately the locators hosted by ArcGIS Online are still operating on ArcGIS Server 9.3.1 servers, so the simplest solution is not yet available when using them (merely setting the output spatial reference for the locator task).  Hope this helps.
0 Kudos