Changes between Version 45 and Version 46 of MapGuideRfc14
- Timestamp:
- 02/21/07 07:57:04 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MapGuideRfc14
v45 v46 39 39 The 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. 40 40 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 setof 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.41 To 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 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 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. 44 44 45 45 The details on how the symbolization works are best gathered from the XML schema. Please refer to appendix A for the schema. … … 57 57 <SimpleSymbolDefinition> 58 58 <Name>US_Interstate</Name> 59 <Graphic Element>59 <Graphics> 60 60 <Image> 61 61 <Reference>Library%3A%2F%2FHighwaySymbols%2FInterstateImage.png</Reference> … … 65 65 <PositionY>0.8</PositionY> 66 66 </Image> 67 </GraphicElement>68 <GraphicElement>69 67 <Text> 70 68 <String>%INTERSTATE_NUMBER%</String> … … 76 74 <VerticalAlignment>Halfline</VerticalAlignment> 77 75 </Text> 78 </Graphic Element>76 </Graphics> 79 77 <LineUsage> 80 78 <AngleControl>FromAngle</AngleControl> … … 109 107 <SimpleSymbolDefinition> 110 108 <Name>LongDash-Dot-ShortDash-Dot</Name> 111 <Graphic Element>109 <Graphics> 112 110 <Path> 113 111 <Geometry> … … 119 117 <LineColor>ff00000</LineColor> 120 118 </Path> 121 </Graphic Element>119 </Graphics> 122 120 <LineUsage> 123 121 <VertexControl>OverlapWrap</VertexControl> … … 143 141 <Name>ThickRail</Name> 144 142 <Description>This is a railroad symbol</Description> 145 <Graphic Element>143 <Graphics> 146 144 <Path> 147 145 <Geometry> … … 153 151 <LineJoin>Round</LineJoin> 154 152 </Path> 155 </Graphic Element>153 </Graphics> 156 154 <LineUsage> 157 155 <VertexControl>OverlapWrap</VertexControl> … … 186 184 <SimpleSymbolDefinition> 187 185 <Name>GasStyle</Name> 188 <Graphic Element>186 <Graphics> 189 187 <Path> 190 188 <Geometry>M 0,0 H 5 M 15,0 H 5</Geometry> … … 193 191 <LineJoin>Round</LineJoin> 194 192 </Path> 195 </GraphicElement>196 <GraphicElement>197 193 <Text> 198 194 <String>GAS</String> … … 204 200 <VerticalAlignment>Halfline</VerticalAlignment> 205 201 </Text> 206 </Graphic Element>202 </Graphics> 207 203 <LineUsage> 208 204 <VertexControl>OverlapWrap</VertexControl> … … 216 212 <SimpleSymbolDefinition> 217 213 <Name>BlueSquare</Name> 218 <Graphic Element>214 <Graphics> 219 215 <Path> 220 216 <Geometry>M -0.5,-0.5 H 1, V 1, H -1, Z</Geometry> 221 217 <FillColor>c00000ff</FillColor> 222 218 </Path> 223 </Graphic Element>219 </Graphics> 224 220 <LineUsage> 225 221 <VertexControl>OverlapNoWrap</VertexControl> … … 234 230 <SimpleSymbolDefinition> 235 231 <Name>RedTriangle</Name> 236 <Graphic Element>232 <Graphics> 237 233 <Path> 238 234 <Geometry>M -0.5,-0.5 H 1, L 0,1, Z</Geometry> 239 235 <FillColor>c0ff0000</FillColor> 240 236 </Path> 241 </Graphic Element>237 </Graphics> 242 238 <LineUsage> 243 239 <VertexControl>OverlapNoWrap</VertexControl> … … 292 288 <SimpleSymbolDefinition> 293 289 <Name>UpperLowerDashing</Name> 294 <Graphic Element>290 <Graphics> 295 291 <Path> 296 292 <Geometry> … … 299 295 </Geometry> 300 296 </Path> 301 </Graphic Element>297 </Graphics> 302 298 <LineUsage> 303 299 <VertexControl>OverlapWrap</VertexControl> … … 311 307 <SimpleSymbolDefinition> 312 308 <Name>OffsetCrossTick</Name> 313 <Graphic Element>309 <Graphics> 314 310 <Path> 315 311 <Geometry>M 0.0,-2.5 v 5</Geometry> 316 312 </Path> 317 </Graphic Element>313 </Graphics> 318 314 <LineUsage> 319 315 <VertexControl>OverlapWrap</VertexControl> … … 343 339 <SimpleSymbolDefinition> 344 340 <Name>US_Interstate</Name> 345 <Graphic Element>341 <Graphics> 346 342 <Image> 343 <ResizeControl>AdjustToResizeBox</ResizeControl> 347 344 <Reference>Library%3A%2F%2FHighwaySymbols%2FInterstateImage.png</Reference> 348 345 <SizeX>10.8</SizeX> … … 351 348 <PositionY>0.8</PositionY> 352 349 </Image> 353 <ResizeControl>AdjustToResizeBox</ResizeControl>354 </GraphicElement>355 <GraphicElement>356 350 <Text> 351 <ResizeControl>AddToResizeBox</ResizeControl> 357 352 <String>%INTERSTATE_NUMBER%</String> 358 353 <FontName>Arial</FontName> … … 363 358 <VerticalAlignment>Halfline</VerticalAlignment> 364 359 </Text> 365 <ResizeControl>AddToResizeBox</ResizeControl> 366 </GraphicElement> 360 </Graphics> 367 361 <ResizeBox> 368 362 <PositionX>0</PositionX> … … 392 386 }}} 393 387 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.388 All 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. 395 389 396 390 The 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. … … 410 404 }}} 411 405 412 This 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:406 This 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: 413 407 414 408 {{{ … … 417 411 <Name>ThickRail</Name> 418 412 <Description>This is a railroad symbol</Description> 419 <Graphic Element>413 <Graphics> 420 414 <Path> 421 415 <Geometry> … … 427 421 <LineJoin>Round</LineJoin> 428 422 </Path> 429 </Graphic Element>423 </Graphics> 430 424 <LineUsage> 431 425 <VertexControl>OverlapWrap</VertexControl> … … 478 472 == Implications == 479 473 480 The new symbol definitions will have an im apct 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.474 The 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. 481 475 482 476 Just 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. 483 477 484 See Appendix A for a link to the schema for the proposed LayerDefinition additions.478 See Appendix A for a link to the schema for the proposed !LayerDefinition additions. 485 479 486 480 == Test Plan == … … 498 492 * [attachment:symbolization_v5.xsd symbolization_v5.xsd] 499 493 500 Link to the proposed additions to the !MapGuide LayerDefinition schema:494 Link to the proposed additions to the !MapGuide !LayerDefinition schema: 501 495 502 496 * [attachment:mdf_changes_v5.xsd mdf_changes_v5.xsd]