ESRI.ArcGIS.Client.Toolkit.DataSources.WebMercatorProjectionService.ProjectAsync C# (CSharp) Method

ProjectAsync() public method

public ProjectAsync ( IEnumerable graphics, SpatialReference outSpatialReference ) : void
graphics IEnumerable
outSpatialReference SpatialReference
return void
        public void ProjectAsync(IEnumerable<Graphic> graphics, SpatialReference outSpatialReference)
        {
            if (outSpatialReference == null ||
                outSpatialReference.WKID != 4326 &&
                !outSpatialReference.Equals(MercatorSref))
            {
                //This projector doesn't support this out sref -> Return geometry untouched
                ProjectCompleted(this, new Tasks.GraphicsEventArgs(graphics.ToList(), null));
            }
            else
            {
                //Perform projection
                var result = graphics.Where(g => g != null).Select(g => new Graphic {Geometry = Project(g.Geometry, outSpatialReference)});

                ProjectCompleted(this, new Tasks.GraphicsEventArgs(result.ToList(), null));
            }
        }
WebMercatorProjectionService