The feature labels are displayed beneath line shapes. In a map with many line shapes, it is difficult to visually track the label that refers to each line shape. I tried changing the placement of the label to center on top of the line shape (so the line passes through the label but the label overlays the line) to no avail. Any thoughts?
Feature labels appear beneath line shapes, not on top of them
Gregory,
The default setting is that the label will on the top of line shape, I think maybe the loading code is not right, could you provide the code for loading layers to us? And if it’s possible could you provide the screen-shot that can make the problem clear.
And as my experience, if you set the text style and line style to the same layer, the label will be on top of line shape. If you set the text style and line style to the different layer, when you add them to overlay, the text style layer should be after than line style layer, otherwise the line shape will cover the label because the drawing order depends on the layer’s order.
Thanks
James
I am attaching a screen print. We are using the MapShapes project where all of our shapes are stored in the same layer but have their own zoom level set. Would the MapShapes approach interfere with the proper placement of the labels?
Gregory,
Could you let me know the version you are on? You can call the GetVersion API on the map control itself. I will try and re-create this with the map shapes sample from the code community. Will know more in a few minutes.
David
We are using 3.0.415 but can be persuaded to upgrade (3.1.299?) if it fixes the problem…
Gregory,
That explains the issues. In a later version than what you have we changed the TextStyle to have a DrawinglLevel property. We defaulted it to LabelLevel which means that all labels will draw on a special label lever so they will always appear over geometries regardless of if you draw the labels with the geometries themselves. Before we suggested you draw the labels as a separate Layer. You still can and if you want to control labeling at a finer level this is still better but the other way works now. Another reason is that the later version is what is officially released and is our compatibility build. We guarantee compatibility with the 3.1.299 APIs from here on out.
I tested the Map Shapes with the released build and it is working just fine.
David
Hello,
I work with Gregory on this project, and I’ve just upgraded our code to reference the 3.1.299 binaries. However, the label’s are still appearing underneath the lines, instead of on them. Perhaps we are not setting the right properties. Here’s a snippet of the code below. Please advise.
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City1(“Label”);
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.PointPlacement = PointPlacement.LowerRight;
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.TextSolidBrush = new GeoSolidBrush(GeoColor.StandardColors.White);
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.DuplicateRule = LabelDuplicateRule.UnlimitedDuplicateLabels;
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.AllowOverlapping;
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.TextLineSegmentRatio = 1000;
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.SuppressPartialLabels = false;
this.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.DrawingLevel = DrawingLevel.LabelLevel;
Jeremy,
Thank you for sending us the code. Can you also send us the code with the other styles you set up for that layer? It might be that you also set the DrawingLevel to LabelLevel for the LineStyle. That might be a cause of that drawing behavior. Thank you.