I have a problem with applying labels to a layer where some of the labels show but not all of them. When I zoom in/out or drag to pan the map the labels change with some disappearing and others appearing. I have tried setting the AllowOverLapping, UnlimitedDuplicateLabels, SuppressPartialLabels = false and GridSize = 10 to try and solve the issue but I haven’t had any luck with any of them.
I have attached a zip file containing a version of my code and the shapefile I’m using, could you please check this and see if you have the same problem and how I might be able to fix it?
Thanks
map.aspx.zip (6.2 KB)
Labels appear/disappear when panning or zooming
Hi Simon,
I have recreated your problem and solve that.
Your question is you add the text style to custom styles but you still set the value to default text style.
Regards,
Don
Here I changed your code simply and it works well now.
worldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(classBreakStyle);
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level15;
worldLayer.ZoomLevelSet.ZoomLevel16.CustomStyles.Add(classBreakStyle);
TextStyle worldLayerTextStyle = TextStyles.CreateSimpleTextStyle("Ph", "Arial", 12, DrawingFontStyles.Bold, GeoColor.StandardColors.Black, 0, 0);
worldLayerTextStyle.SuppressPartialLabels = true;
worldLayerTextStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;
worldLayerTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
worldLayerTextStyle.GridSize = 10;
worldLayerTextStyle.BestPlacement = true;
worldLayer.ZoomLevelSet.ZoomLevel16.CustomStyles.Add(worldLayerTextStyle);
worldLayer.ZoomLevelSet.ZoomLevel16.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
worldLayer.DrawingMarginPercentage = 50;
That works perfectly.
Thanks Don.
Simon,
Any more questions please feel free to let us know.
Regards,
Gary