Configuration Options for ShieldSymbolizer
| name | This is the query field you want to use for the label text, e.g. "ref" |
| face_name | Font name for the shield text |
| size | Font size of the shield text |
| fill | Color of the shield text, e.g. #FFFFFF |
| file | The file to use for the shield background |
| type | Type of the shield file, e.g. "png" |
| width | The width of the shield file |
| height | The height of the shield file |
| spacing | The spacing between repeated occurrences of the same shield |
| min_distance | Minimum distance to the next shield symbol (not necessarily the same shield) |
| placement | "line" or "point" |
| allow_overlap | Allow the symbolizer to overlap others. Defaults to 'false' |
| dx/dy | Offset the text. Unit: pixels. |
Examples
Setting up a sample shield symbolizer, from the Cascade Users of OpenSource GeoSpatial (CUGOS) list: http://groups.google.com/group/cugos/browse_thread/thread/b62b4890e1933bba
Default
XML
<Style name="My Style"> <Rule> <ShieldSymbolizer name="NAME" face_name="DejaVu Sans Bold" size="6" fill="#000000" min_distance="50" file="images/ushighway_shield_20.png" type="png" width="20" height="20" spacing="100" min_distance="50"></ShieldSymbolizer> </Rule> </Style>
Python
shield = ShieldSymbolizer('NAME','DejaVu Sans Bold',6,Color('#000000'),'images/ushighway_shield_20.png','png',20,20) # parameters are: (name, font name, font size, font color, image file, image type, width, height) shield.minimum_distance = 50 shield.label_spacing = 100
C++
FIXME

