Feature request #3284
Wrapping long labels
|Pull Request or Patch supplied:||No||Resolution:||fixed|
|Easy fix?:||No||Copied to github as #:||13344|
Sometimes labels are very long, such as "River of the Big Dry Blue Reef". UMN Mapserver offers a way to wrap labels based on 2 parameters :
- a max length (integer)
- a wrap character, space by default
See http://mapserver.org/mapfile/label.html for more information.
I do not know how hard it is to implement this feature in the new label engine (considering curves, etc.)
#3 Updated by Alister Hood over 8 years ago
There is already a wrapping option. But I have never figured out how to actually get layers to wrap. How is it supposed to work?
Oh, I remember now. The User Guide says multiline labels work with a true line return. I'm not sure how you're supposed to enter a true line return though (on windows).
#4 Updated by Alister Hood over 8 years ago
Aha, here's the answer from the mailing list:
Of course this feature request is still valid, as it is about automatic wrapping, not wrapping with a manual line break.
#5 Updated by Michael Douchin almost 8 years ago
I think this request if no longer needed since the implementation of expression based labelling : http://woostuff.wordpress.com/2011/10/27/expression-based-labeling/
#9 Updated by Nathan Woodrow over 7 years ago
- Resolution set to fixed
- Category changed from Map Canvas to Labelling
- Assignee set to Nathan Woodrow
I have added the ability to wrap labels based on a character, check on the advanced tab on the label dialog. Max length isn't done yet but it shouldn't be too hard to add.
#14 Updated by Alister Hood over 7 years ago
While I can see the benefits of doing it the same way as other software, the mapserver way isn't particularly intuitive. Especially things like this:
If maxlength > 0 and wrap = ‘char’, insert a newline at the FIRST wrap character AFTER maxlength characters
I would think that users would expect it to wrap at the LAST wrap character BEFORE maxlength characters (assuming there is one).
And I don't see why they have two ways of achieving "hard wrap (always break at exactly MAXLENGTH characters)". Perhaps when there is "no wrap", they mean to truncate at MAXLENGTH characters, not to "hard wrap".
#15 Updated by Nathan Woodrow over 7 years ago
Alister Hood wrote:
Just to clarify: are you proposing actually doing it in the expression builder?
No. The plan is to add another control to the label dialog for wrapping properties e.g. max length, wrap character etc
This is a general labeling thing not really just for expressions.