= !MapGuide RFC 113 - Support Path Scaling In Symbol Definition = This page contains a change request (RFC) for the !MapGuide Open Source project. More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs 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||(adopted)|| ||Implementation Status||(pending)|| ||Proposed Milestone||(2.4)|| ||Assigned PSC guide(s)||Bruce Dechant|| ||'''Voting History'''||June 21, 2011|| ||+1||Bruce, Haris, Jackie, Paul, Tom, Trevor, Zac || ||+0|| || ||-0|| || ||-1|| || ||no vote||Bob || == 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. [[Image(img1.jpg)]] 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: [[Image(img2.jpg)]] 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. {{{ A 2D path defining vector geometry to include in the symbol definition. 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). 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. 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. }}} 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.4.0. and the layer definition and watermark definition schema will be updated to 2.4.0 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