WGS84 - Map Co-ordinates

May 26, 2009 at 5:08 PM
Edited May 26, 2009 at 5:10 PM


I trying create a spatial reference class to represent the WGS84 (NOT WGS84 Mercator) projection since all my tiles are in WGS84. I have created the following class and set it in _SpatialReference of the Map class. But it does seems to resolve the lat/lon correctly. For example, in california, I am getting -60s where as I supposed to be getting -120s. Look like something to do with the multiplication some where but I don't where to look for.

Here my spatial refrence class.

    public class WGS84Projection : DeepEarth.Layers.SpatialReference
        public WGS84Projection()
            GeoGCS = "GCS_North_American_1983";
            Datum = "D_North_American_1983";
            SpheroidRadius = 6378137.0D;
            SpheroidFlattening = 298.257222101D;
            Primem = 0.0D;
            AngularUnitOfMeasurement = 0.0174532925199433D;
            FalseEasting = 0.0D;
            FalseNorthing = 0.0D;
            CentralMeridian = 0.0D;
            LatitudeOfOrigin = 0.0D;
            UnitAuthority = "Degree";

            ScaleX = 1.0;
            ScaleY = -1.0;
            OffsetX = 0.0;
            OffsetY = 0.0;

Any help is appreciated.



May 27, 2009 at 1:35 PM

Hi Thanga,

The SpatialReference class is only there for developers to extend.  The actual projection (spatial reference) of the map will not change by doing this as there is not a coordinate transformation built into the map control.  Therefore, in order to actually have the map in WGS84 you would need to perform the projection on the viewport of the map itself in order to fit your WGS84 map tiles.

May 27, 2009 at 2:19 PM

Thanks skulavik,

I am half-solved this issue. The problem was that my tile service zoomlevel starts from 0 where as map control starts with 1. Adjusting to this, the longitude seems to work but still latitude having issue.