wiki:MapGuideRfc186

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 Date5 Feb 2023
Last Modified9 Feb 2023
AuthorJackie Ng
RFC Statusadopted
Implementation Statusimplemented
Proposed Milestone4.0
Assigned PSC guide(s)(when determined)
Voting History(vote date)
+1Jackie,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

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

Last modified 22 months ago Last modified on 02/09/23 04:30:55

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.