Select to view content in your preferred language

Projection Question

1005
3
09-08-2010 07:46 AM
PaulHuppé
Deactivated User
Hi,
I am using the Selection Tool and for some layers, the selected polygons appear way off the map. During debugging, I noticed that the features selected come from a layer which has a different WKID than the map. That is the features.Geometry.SpatialRefenrence is not equal to the Map.SpatialRefenrence.

My question is how do I project the features from their SpatialRefenrence to the map's SpatialReference so that they show up in the correct location on the graphics layer?

Thanks,
Paul
0 Kudos
3 Replies
AliMirzabeigi
Emerging Contributor
What if you set the map SpatialReference to what is defined in your GraphicsLayer? You can do so by setting the SpatialReference in your map's initial extent; please see the following sample to get the whole idea:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#DefineMapProjection
0 Kudos
dotMorten_esri
Esri Notable Contributor
If you are using the QueryTask, did you set the OutputSpatialReference property to match that of the map?
0 Kudos
PaulHuppé
Deactivated User
Hi,

I was using the QueryTask, so setting the QueryTask's spatial reference to be equal to the Map's spatial reference worked.

Thanks,
Paul
0 Kudos