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.
Status
RFC Template Version | (1.0) |
Submission Date | 5 Feb 2023 |
Last Modified | 9 Feb 2023 |
Author | Jackie Ng |
RFC Status | adopted |
Implementation Status | implemented |
Proposed Milestone | 4.0 |
Assigned PSC guide(s) | (when determined) |
Voting History | (vote date) |
+1 | Jackie,Gordon |
+0 | |
-0 | |
-1 | |
no vote |
Overview
This RFC proposes to add support for feature label justification in basic stylization mode
Motivation
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.
Proposed Solution
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)
Left
or Justify
Right
Center
As the v4.0.0 Layer Definition schema has not yet been finalized as MapGuide Open Source 4.0 is still in development, we'll take this opportunity to fix up an oversight in MapGuideRfc178.
The new 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.
Implications
This new LabelJustification
setting is primarily for dealing with multi-line labels. It has no effect for feature labels that do not span multiple lines.
Test Plan
Add new rendering service tests to exercise the new justification setting
Funding / Resources
Community
Attachments (3)
- LabelJustifyCenter_PNG.png (58.4 KB ) - added by 22 months ago.
- LabelJustifyLeft_PNG.png (58.4 KB ) - added by 22 months ago.
- LabelJustifyRight_PNG.png (58.3 KB ) - added by 22 months ago.
Download all attachments as: .zip