Discussion of a Legending Spec for Mapnik
Should be configured with XML or a python class.
#536 tracks progress on this feature.
Possible Example
XML
<Legend> <Title breakline=true stroke-width="1" stroke="black">Education</title> <SubTitle> Level of Education Among Population Over Age 20</Subtitle> <Item> <Symbolizer> <CssParameter name="stroke">white</CssParameter> <CssParameter name="stroke-width">.5</CssParameter> <CssParameter name="fill">#93A462</CssParameter> <ItemText face_name="DejaVu Sans Bold" size="10" fill="black">Highest</ItemText> </Item> .... </Legend>
Python
Feature Wishlist
Layer symbolization using representative feature geometry
Default behavior would will be to use, for example, a filled rectangle to represent polygon geometries (like the example graphic above)
But an optional filter could be applied to direct the legend renderer to use a specific feature geometry (scaled to fit the legend layout) as the symbol
That would look something like:
Syntax might look like:
<Item> <Filter>[id] = 1</Filter> <Symbolizer> ... # or, more simplistically choose a random feature <Item use_feature="true"> <Symbolizer> ...
See also
Lars Ahlzen has written a Python script for TopOSM which creates HTML snippets with images from a Mapnik style file: http://wiki.openstreetmap.org/wiki/TopOSM#Map_legend
Attachments
-
legend_example.png
(3.8 kB) - added by jayd
15 months ago.
Example legend
- legend_feature_example.png (4.7 kB) - added by springmeyer 15 months ago.


