dreamaster

MapToScreen not honoring spatialreference?

Discussion created by dreamaster on Oct 25, 2013
I am using MapToScreen to create specialized maptips that track with the points.   My map is in web mercator of course, and any graphics in that spatialreference work perfectly.   But I have some graphic layers that come in via lat/longs and since I specify the different spatial reference, the map engine projects them perfectly, BUT when I ask for the MapToScreen point, I am getting results that place my annotations near Africa (which tells me MapToScreen is NOT running the coordinates through the autoproject.) 

Any ideas about this?

(just dropping a sample of my code)

GraphicsLayer inputLayer = this.ConwayMap.Layers[inputLayerName] as GraphicsLayer;
  foreach (ESRI.ArcGIS.Client.Graphic g in inputLayer)
            {

    Point myGraphic = (Point)ConwayMap.MapToScreen(new MapPoint { X = g.Geometry.Extent.XMax, Y = g.Geometry.Extent.YMax, SpatialReference= new SpatialReference(4326) });

   //blah blah do something with this point
             }

Outcomes