You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using mapsforge 0.5.1 sample App. If you change one rule in rendertheme-v4.xml to the following (the only change in this rule is zoom-min=15 changed to zoom-min=13):
You should see highway names on the map at zoom 13 and 14. But they do not appear until zoom=15, even though the highways are visible at zooms 13 and 14.
Line labels are a special case.
Besides all common placement rules they obey, internally each label needs to "fit" in the line segment it's supposed to appear.
Thanks. From your response it seems this is expected behaviour. I think you should consider changing this behaviour in future. At zoom=13 (for example) a map may only show major highways and it would be useful to display the names of the highways. Forcing a user to zoom in to get the names to appear, then zoom out again to use the map, is not user friendly in my opinion. It is inconsistent too as other features like rivers display names at zoom=13. What do you think about changing this in future?
The only way to make highway names visible at lower zoom levels (sometimes, if the highway has short segments and a long name, this means ZL 16-18!) is to use caption instead of pathText - with other annoyances involved.
This is one of the last major disadvantages of mapsforge which regularly creates support questions.
Can this be fixed with the label layer? OSMAnd for example has pathTexts winding along the highway, which would be desireable too.
At the moment it makes no difference, and it seems to me that pathText is still rendered on the map layer.
Right now pathText is rendered on every possible segment, if you zoom in far enough, which isn't desireable as well (especially with possible solution like truncating or just writing the name longer than the segment) .
Also only once per tile if it's a long straight segment which passes several tiles (for example on aerial ways).
Could moving to label layer it might be possible to limit it to once per name value? Then it might make sense to just write the whole name, even if it's longer than a segment.
Edit: Maybe it makes sense to have pathText once per tile, as for longer routes/roads. So showing the name value without limiting it to the segment length only once per tile may be a good compromise.
emux already referenced it ... so only to keep the context ... here's the relevant screenshot (which shows a lot of missing street labels).
It seems that the rules for supressing the street labels are to strict. IMHO it's important to increase the number of labels shown, even if they are not rendered perfectly (or have some glitches).
skipPixels is used to avoid repeating the street name all the time if there
is space. Previously it was dependent on the name length, which to me does
not make much sense.
actually, just double checking: the calculations might be total rubbish,
will have to check tomorrow or so again. But at least we do not have them
stuck at the beginning of the road anymore.
yes, that is what the code does: it relaxes the space restrictions for
street names a bit, so sections that were not considered long enough now
sometimes display a street name
Activity
devemux86 commentedon Jul 6, 2015
Line labels are a special case.
Besides all common placement rules they obey, internally each label needs to "fit" in the line segment it's supposed to appear.
pbmorton commentedon Jul 7, 2015
Thanks. From your response it seems this is expected behaviour. I think you should consider changing this behaviour in future. At zoom=13 (for example) a map may only show major highways and it would be useful to display the names of the highways. Forcing a user to zoom in to get the names to appear, then zoom out again to use the map, is not user friendly in my opinion. It is inconsistent too as other features like rivers display names at zoom=13. What do you think about changing this in future?
devemux86 commentedon Jul 7, 2015
I agree that this is not the best behavior and we should review it (though I don't know if it's technically possible).
devemux86 commentedon Jul 7, 2015
BTW have you played with render theme directives, like
priorityanddisplay?pbmorton commentedon Jul 7, 2015
I did play around with the display and priority directives but could not make the labels visible.
eartrumpet commentedon Jul 14, 2015
The only way to make highway names visible at lower zoom levels (sometimes, if the highway has short segments and a long name, this means ZL 16-18!) is to use caption instead of pathText - with other annoyances involved.
This is one of the last major disadvantages of mapsforge which regularly creates support questions.
Can this be fixed with the label layer? OSMAnd for example has pathTexts winding along the highway, which would be desireable too.
devemux86 commentedon Jul 14, 2015
Have you tried it?
eartrumpet commentedon Jul 14, 2015
At the moment it makes no difference, and it seems to me that pathText is still rendered on the map layer.
Right now pathText is rendered on every possible segment, if you zoom in far enough, which isn't desireable as well (especially with possible solution like truncating or just writing the name longer than the segment) .
Also only once per tile if it's a long straight segment which passes several tiles (for example on aerial ways).
Could moving to label layer it might be possible to limit it to once per name value? Then it might make sense to just write the whole name, even if it's longer than a segment.
Edit: Maybe it makes sense to have pathText once per tile, as for longer routes/roads. So showing the name value without limiting it to the segment length only once per tile may be a good compromise.
Klaus-Tockloth commentedon Feb 8, 2016
emux already referenced it ... so only to keep the context ... here's the relevant screenshot (which shows a lot of missing street labels).
It seems that the rules for supressing the street labels are to strict. IMHO it's important to increase the number of labels shown, even if they are not rendered perfectly (or have some glitches).
Klaus
[-]mapsforge highway names disappear at lower zoom levels[/-][+]Not all street labels are shown on the map[/+]Streetnames: placing names in middle of segments, decreasing margins #…
ludwigb commentedon Feb 14, 2016
I changed the algorithm a bit:
Overall we get more street names with a more pleasing layout.
Streetnames: remove obsolete comment #644
devemux86 commentedon Feb 14, 2016
+1
Are we certain the labels are in segments center? (they seem a bit off)
Also the
skipPixels- specially now with arbitrary value - what's exactly its purpose?ludwigb commentedon Feb 14, 2016
skipPixels is used to avoid repeating the street name all the time if there
is space. Previously it was dependent on the name length, which to me does
not make much sense.
actually, just double checking: the calculations might be total rubbish,
will have to check tomorrow or so again. But at least we do not have them
stuck at the beginning of the road anymore.
Thanks for checking....
On 14 February 2016 at 21:35, Emux [email protected] wrote:
devemux86 commentedon Feb 14, 2016
Another thought is whether we need to make
skipPixelsdependent on display model scale factor now.ludwigb commentedon Feb 14, 2016
possibly, I was wondering what unit that actually is.
On 14 February 2016 at 22:06, Emux [email protected] wrote:
lincomatic commentedon Apr 22, 2016
This new code shows more streets, which is great, but at the same time, there are more duplicate names on the same street.
Old code:

New code:

ludwigb commentedon Apr 22, 2016
yes, that is what the code does: it relaxes the space restrictions for
street names a bit, so sections that were not considered long enough now
sometimes display a street name
On 23 April 2016 at 07:21, lincomatic [email protected] wrote:
lincomatic commentedon Apr 26, 2016
I fixed a bug in c8f705f . The street names were not centered. Compare the screen shot below with the one above:

In WayDecorator.java, the line:
LineSegment actuallyUsedSegment = drawableSegment.subSegment(offset, wayNameWidth - WAYNAME_SAFETY_MARGIN * 2);should be:
LineSegment actuallyUsedSegment = drawableSegment.subSegment(offset+WAYNAME_SAFETY_MARGIN, wayNameWidth - WAYNAME_SAFETY_MARGIN * 2);lincomatic commentedon Apr 26, 2016
Sorry, my previous comment was referencing lines in stale code. I submitted a PR with the latest dev code #829
WayDecorator: fix bug centering text #644
[-]Not all street labels are shown on the map[/-][+]Street names rendering improvements[/+]devemux86 commentedon May 15, 2016
Closing this part of improvements. Additional can be monitored in new issue.