private void ChangeTheLabelPlacementForPoints_Load(object sender, EventArgs e) { winformsMap1.MapUnit = GeographyUnit.DecimalDegree; winformsMap1.BackgroundOverlay.BackgroundBrush = new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean); InMemoryFeatureLayer pointLayers = new InMemoryFeatureLayer(); pointLayers.Open(); pointLayers.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1; pointLayers.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = new MyTextStyle("text", new GeoFont("Arial", 10), new GeoSolidBrush(GeoColor.SimpleColors.Black)); pointLayers.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; pointLayers.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.PointPlacement = PointPlacement.UpperRight; pointLayers.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Mask = AreaStyles.Country1; pointLayers.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.MaskMargin = 2; pointLayers.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; pointLayers.Columns.Add(new FeatureSourceColumn("text")); Feature feature1 = new Feature(0, 0); Feature feature2 = new Feature(1, 0); feature1.ColumnValues.Add("text", "dfadfefdfefdfefdfe"); feature2.ColumnValues.Add("text", "222fadfefdfefdfefdfe"); pointLayers.InternalFeatures.Add(feature1); pointLayers.InternalFeatures.Add(feature2); LayerOverlay statesOverlay = new LayerOverlay(); statesOverlay.Layers.Add("MajorCitiesShapes", pointLayers); winformsMap1.Overlays.Add("StatesOverlay", statesOverlay); winformsMap1.CurrentExtent = new RectangleShape(-20, 20, 20, -20); winformsMap1.Refresh(); } class MyTextStyle : TextStyle { public MyTextStyle(string textColumnName, GeoFont textFont, GeoSolidBrush textSolidBrush) : base(textColumnName, textFont, textSolidBrush) { } protected override bool CheckOverlappingCore(LabelingCandidate labelingCandidate, GeoCanvas canvas, System.Collections.ObjectModel.Collection labelsInThisLayer, System.Collections.ObjectModel.Collection labelsInAllLayers) { while (base.CheckOverlappingCore(labelingCandidate, canvas, labelsInThisLayer, labelsInAllLayers)) { labelingCandidate.CenterPoint.Y -= 2; labelingCandidate.ScreenArea.TranslateByOffset(0, -2); } return false; } }