Opened 11 months ago
Last modified 11 months ago
#24103 new task
Irritations with text-anchor-horizontal and text-anchor-vertical in the documentation ("MapCSS Implementation")
| Reported by: | goodidea | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Wiki content | Version: | |
| Keywords: | text-anchor-horizontal text-anchor-vertical | Cc: |
Description
What confuses me about the MapCSS documentation for text-anchor-horizontal and text-anchor-vertical:
- Do these two style keys only affect text of nodes? (It seems that if an icon is present at a node, it refers to the text position in relation to the icon). With a way styling, these two style keys seem to have absolutely no effect. I haven't tested how it is with areas, but it is probably equivalent to a node (if an icon is displayed in an area, for example, or even without an icon; for
text-position: center). - The default value in the table for text-anchor-horizontal is
right- but that is not correct - it is apparentlycenter. - The default value in the table for text-anchor-vertical is
bottom- but that is not correct - it is apparentlybelow.
Shouldn't the defaults be corrected and shouldn't described more clearly what is affected by these 2 style keys (and what not)?
I have attached a screenshot that visualizes the values of text-anchor-vertical ...
Attachments (1)
Change History (3)
by , 11 months ago
| Attachment: | text-anchor-vertical.png added |
|---|
comment:1 by , 11 months ago
Hmm, regarding point 2 and 3: According to trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/BoxTextElement.java#L220 the defaults are right and bottom.
comment:2 by , 11 months ago
OK ... then I got really confused. I checked again now and I had activated another styling that changed these strange defaults to text-anchor-horizontal: center; and text-anchor-vertical: below;(for all nodes). Very strange defaults: why should text be on the right side of an icon and on the bottom edge of an icon (at a node)?
But then it is what it is – but perhaps the description could be improved, then which elements does it affect? Only nodes? It doesn't seem to have any effect on text on ways (text is always vertically centered on the way), I don't know about areas (e.g. with an icon in the middle). It is not clearly described (where and when the anchor is dropped...).



A screenshot visualizing the values of text-anchor-vertical