Convert Graphic (polygon) coordinates

590
3
01-25-2013 12:53 PM
EnriqueIbarra
New Contributor III
I have a FeatureSet, result from a query, now I'm triying to highlight the results (polygons) in a graphic layer but need to convert the cordinates of them from Geographic to WebMercator. there's a way to do it?
0 Kudos
3 Replies
MelitaKennedy
Esri Notable Contributor
ESRI.ArcGIS.Client.Projection Namespace > WebMercator Class : FromGeographic Method ?

There's a similar method under the Bing namespace, but it works with MapPoints.
0 Kudos
EnriqueIbarra
New Contributor III
ESRI.ArcGIS.Client.Projection Namespace > WebMercator Class : FromGeographic Method ?

There's a similar method under the Bing namespace, but it works with MapPoints.


thanks, sorry can you be a little more clear on how to use the first option?
0 Kudos
DominiqueBroux
Esri Frequent Contributor
thanks, sorry can you be a little more clear on how to use the first option?


Should be something like:
  var geometryInWebMercator = new ESRI.ArcGIS.Client.Projection.WebMercator().FromGeographic(geometryInWGS84);


You'll find the documentation here.

I have a FeatureSet, result from a query, now I'm triying to highlight the results (polygons) in a graphic layer but need to convert the cordinates of them from Geographic to WebMercator. there's a way to do it?


If you are using a recent version of the ArcGIS API for Silverlight, the projection to WebMercator coordinates should be done automatically by the graphics layer so you should not have to do it by yourself.

Another option, which avoids the conversion at client side, is to query the graphics directly in the map spatial reference by setting the OutSpatialReference of your query.
0 Kudos