Updated ShieldSymbolizer (markdown)

kunitoki 2011-12-05 03:35:20 -08:00
parent 41954a7e06
commit 59091de1ca

@ -10,41 +10,41 @@ see examples below.
| *parameter* | *value* | *default* | | *parameter* | *value* | *default* |
--------------|---------|-----------| --------------|---------|-----------|
|allow_overlap | Allow the symbolizer to overlap others | false| |allow-overlap | Allow the symbolizer to overlap others | false|
|avoid_edges | Attempts to stay away from the edge of the image | false| |avoid-edges | Attempts to stay away from the edge of the image | false|
|base | Base symbol template. See [#574](http://trac.mapnik.org/changeset/574) (XML config only) | | |base | Base symbol template. See [#574](http://trac.mapnik.org/changeset/574) (XML config only) | |
|character_spacing | Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement | 0| |character-spacing | Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement | 0|
|dx | Offset the text horizontally. Unit: pixels from the image's center | | |dx | Offset the text horizontally. Unit: pixels from the image's center | |
|dy | Offset the text vertically. Unit: pixels from the image's center. Also see note at vertical_alignment. | | |dy | Offset the text vertically. Unit: pixels from the image's center. Also see note at vertical_alignment. | |
|face_name | Font name for the shield text | | |face-name | Font name for the shield text | |
|file | The file to use for the shield background | | |file | The file to use for the shield background | |
|fill | Color of the shield text, e.g. #FFFFFF | | |fill | Color of the shield text, e.g. #FFFFFF | |
|fontset_name | Name of the FontSet to use. (XML config only) | | |fontset-name | Name of the FontSet to use. (XML config only) | |
|halo_fill | Color of the colored halo around the text, e.g. #AF2304. | white | |halo-fill | Color of the colored halo around the text, e.g. #AF2304. | white |
|halo_radius | Thickness of the colored halo around the text as an integer value in pixels | 0 | |halo-radius | Thickness of the colored halo around the text as an integer value in pixels | 0 |
|height | The height of the shield file | image's height | |height | The height of the shield file | image's height |
|horizontal_alignment | | middle | |horizontal-alignment | | middle |
|justify_alignment | | midle| |justify-alignment | | midle|
|line_spacing | Vertical spacing between lines of multi-line labels, in pixels | 0| |line-spacing | Vertical spacing between lines of multi-line labels, in pixels | 0|
|min_distance | Minimum distance to the next shield symbol, not necessarily the same shield | 0| |min-distance | Minimum distance to the next shield symbol, not necessarily the same shield | 0|
|name | This is the query field you want to use for the label text, e.g. "ref" | | |name | This is the query field you want to use for the label text, e.g. "ref" | |
|no_text | | false| |no-text | | false|
|opacity| opacity of the image used for the shield | 1| |opacity| opacity of the image used for the shield | 1|
|text-opacity | opacity of the text placed on top of the shield | 1| |text-opacity | opacity of the text placed on top of the shield | 1|
|placement | "line" or "point" | | |placement | "line" or "point" | |
|size | Font size of the shield text (a value of zero will prevent text from being written) | | |size | Font size of the shield text (a value of zero will prevent text from being written) | |
|spacing | The spacing between repeated occurrences of the same shield | | |spacing | The spacing between repeated occurrences of the same shield | |
|text_convert | Allows conversion of text to lower or upper case before display. Values are "none", "toupper", and "tolower". | "none"| |text-convert | Allows conversion of text to lower or upper case before display. Values are "none", "toupper", and "tolower". | "none"|
|type | Type of the shield file, e.g. "png" | | |type | Type of the shield file, e.g. "png" | |
|unlock_image | If "false", the symbol is placed relative to the text box center. If "true", the symbol is placed relative to the point position | "false"| |unlock-image | If "false", the symbol is placed relative to the text box center. If "true", the symbol is placed relative to the point position | "false"|
|vertical_alignment | Position of label relative to point position ("top" to label on top of a point, "middle", "bottom") for dy = 0, "bottom" for dy > 0, "top" for dy < 0 | "middle"| |vertical-alignment | Position of label relative to point position ("top" to label on top of a point, "middle", "bottom") for dy = 0, "bottom" for dy > 0, "top" for dy < 0 | "middle"|
|width | The width of the shield file| image's width | |width | The width of the shield file| image's width |
|wrap_before| | "false"| |wrap-before| | "false"|
|wrap_character | Use this character instead of a space to wrap long names | " "| |wrap-character | Use this character instead of a space to wrap long names | " "|
|wrap_width | Length before wrapping long names| 0 | |wrap-width | Length before wrapping long names| 0 |
| transform | *Development version (trunk)* [SVG transform] (http://www.w3.org/TR/SVG/coords.html#TransformAttribute) | | | transform | *Development version (trunk)* [SVG transform] (http://www.w3.org/TR/SVG/coords.html#TransformAttribute) | |
|shield_dx|offset the shield image horizontally | | |shield-dx|offset the shield image horizontally | |
|shield_dy|offset the shield image vertically | | |shield-dy|offset the shield image vertically | |
## Good to know ## Good to know
@ -73,7 +73,7 @@ http://groups.google.com/group/cugos/browse_thread/thread/b62b4890e1933bba
#!xml #!xml
<Style name="My Style"> <Style name="My Style">
<Rule> <Rule>
<ShieldSymbolizer name="NAME" face_name="DejaVu Sans Bold" size="6" fill="#000000" file="images/ushighway_shield_20.png" type="png" width="20" height="20" spacing="100" min_distance="50"></ShieldSymbolizer> <ShieldSymbolizer name="NAME" face-name="DejaVu Sans Bold" size="6" fill="#000000" file="images/ushighway_shield_20.png" type="png" width="20" height="20" spacing="100" min-distance="50"></ShieldSymbolizer>
</Rule> </Rule>
</Style> </Style>
@ -116,7 +116,7 @@ http://groups.google.com/group/cugos/browse_thread/thread/b62b4890e1933bba
#!xml #!xml
<Style name="My Style"> <Style name="My Style">
<Rule> <Rule>
<ShieldSymbolizer name="'ABC'" fontset_name="bold-fonts" size="10" fill="green" placement="line" file="/Users/artem/Desktop/svg/shield.svg" transform="scale(2.0,2.0)" min_distance="100" spacing="250"/> <ShieldSymbolizer name="'ABC'" fontset-name="bold-fonts" size="10" fill="green" placement="line" file="/Users/artem/Desktop/svg/shield.svg" transform="scale(2.0,2.0)" min-distance="100" spacing="250"/>
</Rule> </Rule>
</Style> </Style>