Hi,
I have a road layer, but the labels are drawing under the lines how do I prevent this.
Hi,
I have a road layer, but the labels are drawing under the lines how do I prevent this.
Clava,
Thanks for the post. By default the labels should display on top of the layer so it seems strange that the labels are underneath. Can you post the code where you setup the zoom levels and styles for that layer?
Also if you want to have full control over the labeling order you can just create a "Labeling" Layer that points to the same shapefile and only set a TextStyle on it. This way you can control exact drawing order when you put it into the StaticLayers collection.
I hope this helps, Thanks!
Clava,
I have a quick clarification. Is the text under the line in the sense that the text is drawing lower than the line or is the text drawing beneath the line so that the line intersects and overlaps the line? I hope you mean my meaning, one way under means line draws over to overlap the line or the text draws beneath or furth south of the line. Also could you insert a little picture of this?
Like what Clint mentioned above maybe what you are doing is setting the DefaultTextStyle and the DefaultLineStyle on the same layer. This means the text will draw on this way and may have the line draw on top of the text. This is not the recommended way to label. What you want to do is to add another layer on the top of all the vector layers that does labeling. In this way all labels will draw on top of all of vector layers.
David
I have attached the sample image. I don't agree with having to add 2 separate layers to get the labels on top of the map. I hope this can be resolved in future versions.
40-SampleMap.png (45.3 KB)
Clava,
As Batman and David mentioned above, the solution is to have another layer specific for labeling. I am not sure why you do not like it but in fact, it’s better and highly recomended.
1, In Map Suite 3.0, one philosophy is to make the whole structure more consistent, and make classes simpler and more specific. For instance, to add a shape data in previous Map Suite, we need to add a new layer. But to add a scalebar, we need to set the scalebar property. Now in Map Suite 3.0 everything is a layer. So if we want to add a scalebar, just add a new adornment layer, which can be used in the same way as a “normal” layer. In this way, we make things simpler as users just follow the pattern-----create a proper layer and add it to the map-----and then they can deal with all the similar situations. To have a specific layer for labeling is the same idea. A labeling layer is not special, just a “normal” layer, we do not want to make one layer very difficult but instead, we can have more layers and make them follow the same pattern.
2, As a benefit of the above idea, we can make the controls easier. Such as this labeling case, we can simply modify the displaying order by change the layer order. That will be more helpful if we have multiple label layers, especially in the case the order for displaying the layer labels is different from the order for dispalying the layer shapes.
3, Not only make the control easier, it brings us more power. For instance, we can add the shape to static layer and add the corresponding label to dynamic layer and then, we can refresh the label only. In some case like the label is got on the fly, this way is more efficient.
In a word, we think it’s a better way to have a specific labeling layer to solve your problem. Sure we are open to get any comments and thanks for the post!
Ben