private void UseRotationProjectionForAFeatureLayer_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); ShapeFileFeatureLayer StatesLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\usstates.shp"); StatesLayer.Name = "states"; StatesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.State1; StatesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; rotateProjection = new RotationProjection(); StatesLayer.FeatureSource.Projection = rotateProjection; LayerOverlay worldOverlay = new LayerOverlay(); worldOverlay.Layers.Add("StatesLayer", StatesLayer); winformsMap1.Overlays.Add("WorldOverlay", worldOverlay); winformsMap1.ZoomLevelSnapping = ZoomLevelSnappingMode.None; winformsMap1.CurrentExtent = rotateProjection.GetUpdatedExtent(new RectangleShape(-180.0, 83.0, 180.0, -90.0)); winformsMap1.MapClick += new EventHandler(winformsMap1_MapClick); winformsMap1.MouseDoubleClick += new MouseEventHandler(winformsMap1_MouseDoubleClick); winformsMap1.Refresh(); } void winformsMap1_MouseDoubleClick(object sender, MouseEventArgs e) { LayerOverlay worldOverlay = winformsMap1.Overlays["WorldOverlay"] as LayerOverlay; ShapeFileFeatureLayer worldLayer = worldOverlay.Layers["WorldLayer"] as ShapeFileFeatureLayer; ShapeFileFeatureLayer StatesLayer= worldOverlay.Layers["StatesLayer"] as ShapeFileFeatureLayer; worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country2; StatesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Sand1; winformsMap1.Refresh(); } void winformsMap1_MapClick(object sender, MapClickWinformsMapEventArgs e) { LayerOverlay worldOverlay = winformsMap1.Overlays["WorldOverlay"] as LayerOverlay; ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"..\..\SampleData\Data\Countries02.shp"); worldLayer.Name = "world"; worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1; worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; worldLayer.FeatureSource.Projection = rotateProjection; worldOverlay.Layers.Add("WorldLayer", worldLayer); worldOverlay.Layers.MoveToBottom("WorldLayer"); winformsMap1.Refresh(); } private void btnRotateCounterclockwise_Click(object sender, EventArgs e) { rotateProjection.Angle += 45; winformsMap1.CurrentExtent = rotateProjection.GetUpdatedExtent(winformsMap1.CurrentExtent); winformsMap1.Refresh(winformsMap1.Overlays["WorldOverlay"]); } private void btnRotateClockwise_Click(object sender, EventArgs e) { rotateProjection.Angle -= 45; winformsMap1.CurrentExtent = rotateProjection.GetUpdatedExtent(winformsMap1.CurrentExtent); winformsMap1.Refresh(winformsMap1.Overlays["WorldOverlay"]); }