| 1 | |
| 2 | = !MapGuide RFC 186 - Support label justification for basic stylization = |
| 3 | |
| 4 | This page contains a change request (RFC) for the !MapGuide Open Source project. |
| 5 | More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page. |
| 6 | |
| 7 | == Status == |
| 8 | |
| 9 | ||RFC Template Version||(1.0)|| |
| 10 | ||Submission Date||5 Feb 2023|| |
| 11 | ||Last Modified||5 Feb 2023|| |
| 12 | ||Author||Jackie Ng|| |
| 13 | ||RFC Status||draft|| |
| 14 | ||Implementation Status||pending|| |
| 15 | ||Proposed Milestone||4.0|| |
| 16 | ||Assigned PSC guide(s)||(when determined)|| |
| 17 | ||'''Voting History'''||(vote date)|| |
| 18 | ||+1|||| |
| 19 | ||+0|||| |
| 20 | ||-0|||| |
| 21 | ||-1|||| |
| 22 | ||no vote|| || |
| 23 | |
| 24 | == Overview == |
| 25 | |
| 26 | This RFC proposes to add support for feature label justification in basic stylization mode |
| 27 | |
| 28 | == Motivation == |
| 29 | |
| 30 | 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. |
| 31 | |
| 32 | 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. |
| 33 | |
| 34 | == Proposed Solution == |
| 35 | |
| 36 | Update our v4.0.0 LayerDefinition XML schema to introduce a new optional `LabelJustification` element. |
| 37 | |
| 38 | ``` |
| 39 | <xs:element name="LabelJustification" type="xs:string" default="'Left'" minOccurs="0"> |
| 40 | <xs:annotation> |
| 41 | <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> |
| 42 | </xs:annotation> |
| 43 | </xs:element> |
| 44 | ``` |
| 45 | |
| 46 | 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) |
| 47 | |
| 48 | === `Left` or `Justify` === |
| 49 | |
| 50 | === `Right` === |
| 51 | |
| 52 | === `Center` === |
| 53 | |
| 54 | 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 [wiki:MapGuideRfc178]. |
| 55 | |
| 56 | 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. |
| 57 | |
| 58 | == Test Plan == |
| 59 | |
| 60 | Add new rendering service tests to exercise the new justification setting |
| 61 | |
| 62 | == Funding / Resources == |
| 63 | |
| 64 | Community |