Changes between Version 45 and Version 46 of MapGuideRfc14


Ignore:
Timestamp:
Feb 21, 2007, 7:57:04 AM (17 years ago)
Author:
waltweltonlair
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc14

    v45 v46  
    3939The proposal is to create one engine that will satisfy the requirements of all three symbolizations (point, line, and area).  This engine will use as input a new XML resource, parameters, and geometry, and will use the rendering interface of !MapGuide to perform high quality stylization from those inputs.  The resource format and the engine will ultimately be able to handle all three symbolization types.
    4040
    41 To implement all of this we will create a new type-style element for the !MapGuide layer definition schema.  This type-style can reference the new symbolization resources.
    42 
    43 Symbols themselves will be represented as a new resource type, and will be stored in the !MapGuide resource repository.  Groups of symbols can then be easily stored in folders in the repository to represent symbol libraries. The proposed design includes the ability to define both simple and compound symbols.  A simple symbol consists of a set of path, image, and text elements that define the graphics, and information on how the symbol is used in the context of points, lines, and areas.  A compound symbol contains a collection of simple symbols, either inlined or using references to existing symbols.
     41To implement all of this we will create a new type-style element for the !MapGuide !LayerDefinition schema.  This type-style can reference the new symbolization resources.
     42
     43Symbols themselves will be represented as a new resource type, and will be stored in the !MapGuide resource repository.  Groups of symbols can then be easily stored in folders in the repository to represent symbol libraries. The proposed design includes the ability to define both simple and compound symbols.  A simple symbol consists of a collection of path, image, and text elements that define the graphics, and information on how the symbol is used in the context of points, lines, and areas.  A compound symbol contains a collection of simple symbols, either inlined or using references to existing symbols.
    4444
    4545The details on how the symbolization works are best gathered from the XML schema.  Please refer to appendix A for the schema.
     
    5757  <SimpleSymbolDefinition>
    5858    <Name>US_Interstate</Name>
    59     <GraphicElement>
     59    <Graphics>
    6060      <Image>
    6161        <Reference>Library%3A%2F%2FHighwaySymbols%2FInterstateImage.png</Reference>
     
    6565        <PositionY>0.8</PositionY>
    6666      </Image>
    67     </GraphicElement>
    68     <GraphicElement>
    6967      <Text>
    7068        <String>%INTERSTATE_NUMBER%</String>
     
    7674        <VerticalAlignment>Halfline</VerticalAlignment>
    7775      </Text>
    78     </GraphicElement>
     76    </Graphics>
    7977    <LineUsage>
    8078      <AngleControl>FromAngle</AngleControl>
     
    109107  <SimpleSymbolDefinition>
    110108    <Name>LongDash-Dot-ShortDash-Dot</Name>
    111     <GraphicElement>
     109    <Graphics>
    112110      <Path>
    113111        <Geometry>
     
    119117        <LineColor>ff00000</LineColor>
    120118      </Path>
    121     </GraphicElement>
     119    </Graphics>
    122120    <LineUsage>
    123121      <VertexControl>OverlapWrap</VertexControl>
     
    143141    <Name>ThickRail</Name>
    144142    <Description>This is a railroad symbol</Description>
    145     <GraphicElement>
     143    <Graphics>
    146144      <Path>
    147145        <Geometry>
     
    153151        <LineJoin>Round</LineJoin>
    154152      </Path>
    155     </GraphicElement>
     153    </Graphics>
    156154    <LineUsage>
    157155      <VertexControl>OverlapWrap</VertexControl>
     
    186184      <SimpleSymbolDefinition>
    187185        <Name>GasStyle</Name>
    188         <GraphicElement>
     186        <Graphics>
    189187          <Path>
    190188            <Geometry>M 0,0 H 5 M 15,0 H 5</Geometry>
     
    193191            <LineJoin>Round</LineJoin>
    194192          </Path>
    195         </GraphicElement>
    196         <GraphicElement>
    197193          <Text>
    198194            <String>GAS</String>
     
    204200            <VerticalAlignment>Halfline</VerticalAlignment>
    205201          </Text>
    206         </GraphicElement>
     202        </Graphics>
    207203        <LineUsage>
    208204          <VertexControl>OverlapWrap</VertexControl>
     
    216212      <SimpleSymbolDefinition>
    217213        <Name>BlueSquare</Name>
    218         <GraphicElement>
     214        <Graphics>
    219215          <Path>
    220216            <Geometry>M -0.5,-0.5 H 1, V 1, H -1, Z</Geometry>
    221217            <FillColor>c00000ff</FillColor>
    222218          </Path>
    223         </GraphicElement>
     219        </Graphics>
    224220        <LineUsage>
    225221          <VertexControl>OverlapNoWrap</VertexControl>
     
    234230      <SimpleSymbolDefinition>
    235231        <Name>RedTriangle</Name>
    236         <GraphicElement>
     232        <Graphics>
    237233          <Path>
    238234            <Geometry>M -0.5,-0.5 H 1, L 0,1, Z</Geometry>
    239235            <FillColor>c0ff0000</FillColor>
    240236          </Path>
    241         </GraphicElement>
     237        </Graphics>
    242238        <LineUsage>
    243239          <VertexControl>OverlapNoWrap</VertexControl>
     
    292288      <SimpleSymbolDefinition>
    293289        <Name>UpperLowerDashing</Name>
    294         <GraphicElement>
     290        <Graphics>
    295291          <Path>
    296292            <Geometry>
     
    299295            </Geometry>
    300296          </Path>
    301         </GraphicElement>
     297        </Graphics>
    302298        <LineUsage>
    303299          <VertexControl>OverlapWrap</VertexControl>
     
    311307      <SimpleSymbolDefinition>
    312308        <Name>OffsetCrossTick</Name>
    313         <GraphicElement>
     309        <Graphics>
    314310          <Path>
    315311            <Geometry>M 0.0,-2.5 v 5</Geometry>
    316312          </Path>
    317         </GraphicElement>
     313        </Graphics>
    318314        <LineUsage>
    319315          <VertexControl>OverlapWrap</VertexControl>
     
    343339  <SimpleSymbolDefinition>
    344340    <Name>US_Interstate</Name>
    345     <GraphicElement>
     341    <Graphics>
    346342      <Image>
     343        <ResizeControl>AdjustToResizeBox</ResizeControl>
    347344        <Reference>Library%3A%2F%2FHighwaySymbols%2FInterstateImage.png</Reference>
    348345        <SizeX>10.8</SizeX>
     
    351348        <PositionY>0.8</PositionY>
    352349      </Image>
    353       <ResizeControl>AdjustToResizeBox</ResizeControl>
    354     </GraphicElement>
    355     <GraphicElement>
    356350      <Text>
     351        <ResizeControl>AddToResizeBox</ResizeControl>
    357352        <String>%INTERSTATE_NUMBER%</String>
    358353        <FontName>Arial</FontName>
     
    363358        <VerticalAlignment>Halfline</VerticalAlignment>
    364359      </Text>
    365       <ResizeControl>AddToResizeBox</ResizeControl>
    366     </GraphicElement>
     360    </Graphics>
    367361    <ResizeBox>
    368362      <PositionX>0</PositionX>
     
    392386}}}
    393387
    394 All we've done is include a !ResizeBox and specify the !ResizeControl for each !GraphicElement.  The !ResizeBox is positioned at the same location as the Text element, and has an initial size of 6 mm by 5 mm.  This box fits nicely in the Image element - as long as the text does not extend outside of this box then no resizing is needed.  The !GrowControl setting for the resize box is GrowInX, which means the box is only allowed to grow horizontally.
     388All we've done is include a !ResizeBox and specify the !ResizeControl for each graphic element.  The !ResizeBox is positioned at the same location as the Text element, and has an initial size of 6 mm by 5 mm.  This box fits nicely in the Image element - as long as the text does not extend outside of this box then no resizing is needed.  The !GrowControl setting for the resize box is GrowInX, which means the box is only allowed to grow horizontally.
    395389
    396390The Text element's !ResizeControl is set to !AddToResizeBox.  This means the graphical extent of the element is added to the resize box, and the box will grow, if necessary, to include that extent.  In the case of 1 or 2 digit interstate numbers no growth occurs, but in the case of a 3 digit number the box will grow horizontally to fit the text.
     
    410404}}}
    411405
    412 This means that the parameter named 1 can be set to an expression in the Layer Definition, based on style choices made by the map author.  The !SymbolDefinition must also declare this parameter in its !ParameterDefinition element.  Here it describes what that parameter does and also provides a default value for the parameter.  Here is a sample !SymbolDefinition with this !ParameterDefinition element:
     406This means that the parameter named 1 can be set to an expression in the !LayerDefinition, based on style choices made by the map author.  The !SymbolDefinition must also declare this parameter in its !ParameterDefinition element.  Here it describes what that parameter does and also provides a default value for the parameter.  Here is a sample !SymbolDefinition with this !ParameterDefinition element:
    413407
    414408{{{
     
    417411    <Name>ThickRail</Name>
    418412    <Description>This is a railroad symbol</Description>
    419     <GraphicElement>
     413    <Graphics>
    420414      <Path>
    421415        <Geometry>
     
    427421        <LineJoin>Round</LineJoin>
    428422      </Path>
    429     </GraphicElement>
     423    </Graphics>
    430424    <LineUsage>
    431425      <VertexControl>OverlapWrap</VertexControl>
     
    478472== Implications ==
    479473
    480 The new symbol definitions will have an imapct on the Layer Definition XML schema.  To preserve backwards compatibility, we propose to add a new !CompositeTypeStyle element that will be the only LDF element that references new symbol definitions.  The !CompositeTypeStyle inherits !FeatureTypeStyle alongside Area, Line and !PointTypeStyle.  Layers that have a !CompositeTypeStyle will use a new code path for stylization based on the new !SymbolDefinitions.  Stylization of layers that have one of the old !FeatureTypeStyles will not change.  One will therefore be able to mix the two kinds of layers within the same map.
     474The new symbol definitions will have an impact on the !LayerDefinition XML schema.  To preserve backwards compatibility, we propose to add a new !CompositeTypeStyle element that will be the only LDF element that references new symbol definitions.  The !CompositeTypeStyle inherits !FeatureTypeStyle alongside Area, Line and !PointTypeStyle.  Layers that have a !CompositeTypeStyle will use a new code path for stylization based on the new !SymbolDefinitions.  Stylization of layers that have one of the old !FeatureTypeStyles will not change.  One will therefore be able to mix the two kinds of layers within the same map.
    481475
    482476Just like the other !FeatureTypeStyles, the !CompositeTypeStyle will hold on to a symbolization object (!CompositeSymbolization) which defines the way features draw.  The !CompositeSymbolization will reference one or more !SymbolDefinitions and also optionally define theming expressions for properties of the !SymbolDefinition which are marked as parametrized.  Those allow for the symbol definition to take up styles based on attributes of the specific feature class that the !CompositeSymbolization is associated with.
    483477
    484 See Appendix A for a link to the schema for the proposed Layer Definition additions.
     478See Appendix A for a link to the schema for the proposed !LayerDefinition additions.
    485479
    486480== Test Plan ==
     
    498492 * [attachment:symbolization_v5.xsd symbolization_v5.xsd]
    499493
    500 Link to the proposed additions to the !MapGuide Layer Definition schema:
     494Link to the proposed additions to the !MapGuide !LayerDefinition schema:
    501495
    502496 * [attachment:mdf_changes_v5.xsd mdf_changes_v5.xsd]