MapGuide RFC 186 - Support label justification for basic stylization
This page contains a change request (RFC) for the MapGuide Open Source project. More MapGuide RFCs can be found on the RFCs page.
|RFC Template Version||(1.0)|
|Submission Date||5 Feb 2023|
|Last Modified||9 Feb 2023|
|Assigned PSC guide(s)||(when determined)|
|Voting History||(vote date)|
This RFC proposes to add support for feature label justification in basic stylization mode
This 14 year old bug (https://trac.osgeo.org/mapguide/ticket/772) is the result of the rendering/stylization engine having a hard-coded "Left" justification for feature labels in basic stylization.
The reason for this is because the Layer Definition XML schema does not define a justification setting for the
TextSymbol element (which controls feature label settings). The rendering/stylization engine itself allows for this justification to be changed (so there is no work required on this front), but there is nothing on the Layer Definition XML to change this justification value from its "Left" default.
Update our v4.0.0 LayerDefinition XML schema to introduce a new optional
LabelJustification element as a child element of the
TextSymbol element type.
<xs:element name="LabelJustification" type="xs:string" default="'Left'" minOccurs="0"> <xs:annotation> <xs:documentation>A string FDO expression for the label justification. Must evaluate to one of the 'Left', 'Right', 'Center' or 'Justify' (which is the same as 'Left').</xs:documentation> </xs:annotation> </xs:element>
This element accepts any of the following values, which will result in the following effect (using Sheboygan Voting Districts with multi-line label as an example)
IncludeFeatureBounds element introduced with this RFC was made a required element by mistake. For this RFC, we'll fix this element to be optional.
This feature change has been implemented in the
basic_label_justification sandbox branch. Upon adoption of this RFC, it will be merged into trunk.
LabelJustification setting is primarily for dealing with multi-line labels. It has no effect for feature labels that do not span multiple lines.
Add new rendering service tests to exercise the new justification setting
Funding / Resources