Hi ashwini,
I have modified the code as below, please check it and have another try.
projection.InternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(4326);
I don’t know the detailed procedure about your appliation, but I use the following code to test it, it works.
private void LoadAnShapeFileFeatureLayer_Load(object sender, EventArgs e)
{
winformsMap1.MapUnit = GeographyUnit.Meter;
winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean);
winformsMap1.MouseMove += new MouseEventHandler(winformsMap1_MouseMove);
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"…\SampleData\Data\Countries02.shp");
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green));
ManagedProj4Projection projection = new ManagedProj4Projection();
projection.InternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(4326);
projection.ExternalProjectionParametersString = ManagedProj4Projection.GetGoogleMapParametersString();
worldLayer.FeatureSource.Projection = projection;
LayerOverlay staticOverlay = new LayerOverlay();
staticOverlay.Layers.Add(“WorldLayer”, worldLayer);
winformsMap1.Overlays.Add(staticOverlay);
worldLayer.Open();
winformsMap1.CurrentExtent = worldLayer.GetBoundingBox();
worldLayer.Close();
winformsMap1.Refresh();
}
void winformsMap1_MouseMove(object sender, MouseEventArgs e)
{
PointShape originalShape = ExtentHelper.ToWorldCoordinate(winformsMap1.CurrentExtent, new ScreenPointF(e.X, e.Y), winformsMap1.Width, winformsMap1.Height);
ManagedProj4Projection projection = new ManagedProj4Projection();
projection.InternalProjectionParametersString = ManagedProj4Projection.GetEpsgParametersString(4326);
projection.ExternalProjectionParametersString = ManagedProj4Projection.GetGoogleMapParametersString();
projection.Open();
PointShape decimalDegreePoint = (PointShape)projection.ConvertToInternalProjection(originalShape);
projection.Close();
}
Regards,
Ivan