I have a map defined with four layers in this order: TiledBaseMap (ArcMapTiledMapServiceLayer), Sample Locations (FeatureLayer), MyGraphicsLayer (GraphicsLayer), and MySelectionGraphicsLayer (GraphicsLayer). The TiledBaseMap service WKID is 3735. The Sample Locations service WKID is 3734.
I am executing a QueryTask against Sample Locations passing in a Geometry object with SpatialReference WKID=3735. When the call to QueryTask.ExecuteAsync returns the features in the QueryEventArgs.FeatureSet specify that their SpatialReference WKID=3735. However, when I add these features to MyGraphicsLayer they do not overlay with the features from Sample Locations.
I have tried specifying QueryTask.OutSpatialReference as 3735 (though this should be the default according to my understanding) and 3734 - and even though the features in the featureset report the WKID I specify, the actual coordinates are the same.
I have tried setting MyGraphicsLayer.SpatialReference to 3735 and 3734 in combination with the QueryTask OutSpatialReference with no change in the overlay.
Can you help me understand what is going on here?
And, I guess the simple question is: Is there any way to return geometry from a QueryTask that is not in the SpatialReference of the map? If not, do I need to reproject each feature using the GeometryService in order to overlay them, or is there some better way to get where I am trying to go (which is to highlight the selected features).
Thanks,