Opened 12 years ago

Closed 11 years ago

#2383 closed enhancement (fixed)

enhance label wrapping functionality

Reported by: tbonfort Owned by: jmckenna
Priority: normal Milestone: 5.4 release
Component: Documentation - MapServer Version: unspecified
Severity: normal Keywords:
Cc: sdlime, jmckenna, dmorissette

Description

Currently labels can be told to wrap on characters other than newlines by specifying a WRAP parameter in the LABEL block. I think this is mostly used when specifying a ' ' (space) character so that text wraps on breaks between words, but implies that 'every' such character is transformed to a newline.

proposed enhancement: provide the labelObj with a new keyword, for example MINWRAPLENGTH, which will tell mapserver to only replace the WRAP character with a newline if the current line length is over MINWRAPLENGTH. This approach is rather straightforward as it can be done in the same loop as the character replacing function.

A more complicated approach would be to provide a MAXLENGTH keyword to enforce that a label cannot be wider than a given number of characters, but the implementation would be a little bit trickier, as it implies going back into the text string when MAXLENGTH chars have been encountered.

Change History (10)

comment:1 Changed 12 years ago by tbonfort

Cc: sdlime added

comment:2 Changed 11 years ago by jmckenna

Cc: jmckenna added

comment:3 Changed 11 years ago by dmorissette

Cc: dmorissette added

comment:4 Changed 11 years ago by tbonfort

Milestone: 5.2 release5.4 release

comment:5 Changed 11 years ago by tbonfort

Component: MapServer C LibraryMapScript-PHP

committed in r7928

passing on to php-mapscript for labelObj getters and setters: ALIGN, MAXLENGTH and MINLENGTH (the latter currently unused)

comment:6 Changed 11 years ago by tbonfort

Owner: changed from tbonfort to aboudreault

comment:7 Changed 11 years ago by aboudreault

Owner: changed from aboudreault to tbonfort

Changes in php-mapscript committed in r7930

comment:8 Changed 11 years ago by tbonfort

Component: MapScript-PHPMapServer Documentation

off to documentation

see http://mapserver.gis.umn.edu/development/rfc/ms-rfc-40/ for the details

comment:9 Changed 11 years ago by dmorissette

Owner: changed from tbonfort to jmckenna

comment:10 Changed 11 years ago by tbonfort

Resolution: fixed
Status: newclosed

doc updated

Note: See TracTickets for help on using tickets.