Version 4 (modified by 13 years ago) ( diff ) | ,
---|
MapGuide RFC # - Title Goes Here
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 | (June 7, 2011) |
Last Modified | (Aleck Sun) (June 7, 2011) |
Author | (Aleck Sun) |
RFC Status | (draft) |
Implementation Status | (pending) |
Proposed Milestone | (2.3) |
Assigned PSC guide(s) | (when determined) |
Voting History | (vote date) |
+1 | |
+0 | |
-0 | |
-1 | |
no vote |
Overview
There is one issue found with current symbol definition schema that there is no way to scale a path symbol easily for a user. This RFC describes the proposed schema changes which address the issues.
Motivation
Currently with CompositeTypeStyle, user can reference a predefined symbol on stylizing while he will be able to adjust value of any properties that are exposed by the symbol definition as parameters. However, unlike text and image graphics, a path cannot be scaled by setting any property. The only work-around to scale a path is to set the scale of a symbol instance. However, if the scale of a symbol instance is modified, not only the size of the path geometry is scaled, but also all the other length properties like size of other graphics, the repeat interval defined in area usage, etc.
As an example, think of the following symbol.
If the user wants to make the highway shield bigger, the only way he can do is to set the scale of the symbol instance. However, it also affects the repeat interval of the line usage, and he’ll get this:
Therefore, the only way to solve this problem is to add an ability to set individual scale for path in symbol definition.
Proposed Solution
To add ability of defining scale for path in symbol definition, we need to modify the schema a bit to add a scale property for path.
<xs:complexType name="Path"> <xs:annotation> <xs:documentation>A 2D path defining vector geometry to include in the symbol definition.</xs:documentation> </xs:annotation> <xs:complexContent> <xs:extension base="GraphicBase"> <xs:sequence> <xs:element name="Geometry" type="xs:string"> <xs:annotation> <xs:documentation>The path geometry. The format is a sequence of segments, each represented by a letter indicating the segment type followed by one or more parameters. Uppercase letters denote absolute values and lowercase letters denote relative values. Segment types can be one of "M" (moveto), "L" (lineto), "H" (horizontal lineto), "V" (vertical lineto), "A" (arcto), or "Z" (close segment).</xs:documentation> </xs:annotation> </xs:element> <xs:element name="ScaleX" type="xs:string" minOccurs="0" default="1.0"> <xs:annotation> <xs:documentation> The amount to scale the path geometry in the horizontal direction. This is only applied to the Geometry element. Defaults to 1 if not specified.</xs:documentation> </xs:annotation> </xs:element> <xs:element name="ScaleY" type="xs:string" minOccurs="0" default="1.0"> <xs:annotation> <xs:documentation> The amount to scale the path geometry in the Vertical direction. This is only applied to the Geometry element. Defaults to 1 if not specified.</xs:documentation> </xs:annotation> </xs:element> … </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType>
By Adding the ScaleX and ScaleY property to path, user will be able to set the scale of just the path symbol without any side effects. Once the ScaleX and ScaleY property is set, it’ll be the first transformation applied on the geometry.
The version number of symbol definition schema will be changed to 2.3.0. and the layer definition and watermark definition schema will be updated to 2.3.1 since they reference symbol definition schema. Also, the MdfParser and MdfModel will be updated to handle this new property and version number. Besides the stylization code will take this scale into account when drawing a symbol.
Implications
Existing schema documentation will be updated.
Test Plan
The existing unit tests (MdfModel unit test) will be updated adding test of the 2 new field and the new version handling. The MdfModel unit test verifies that the versioning / roundtripping behavior is working correctly.
Funding / Resources
Autodesk
Attachments (2)
-
img1.jpg
(7.7 KB
) - added by 13 years ago.
Image1
-
img2.jpg
(10.5 KB
) - added by 13 years ago.
Image2
Download all attachments as: .zip