mapnik/tests/visual_tests/styles/group-symbolizer-2.xml
Matt Amos f8097748a4 Added more tests for group symbolizer.
The first test shows how an obstacle under the group being displayed
will cause the whole group to not display. Above is an replica of
the same layout using non-grouped symbolizers, which shows that
only the parts which intersect the obstacle will not be drawn.

The second is a line placement test, which just tests placement
of groups on a line with variable spacing.

The third is a test of repeat key in group symbolizer.
The test shows two items with different repeat keys ("foo" and "bar")
and rows of other group symbolizers sensitive to either one. The
reference images show that the "bar"-sensitive rows are displaced
by the "bar" item, but not the "foo" item.
2014-02-18 15:06:40 -05:00

113 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- Without unlock-image -->
<!DOCTYPE Map>
<Map background-color="green" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" minimum-version="2.0.0">
<Layer name="obstacle" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>obstacle</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
lat,long,nr
0.33,0.4,0
-0.33,0.4,1
</Parameter>
</Datasource>
</Layer>
<Style name="obstacle">
<Rule>
<PointSymbolizer/>
</Rule>
</Style>
<Layer name="layer" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>grouped</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
lat,long,name1,ref1,name2,ref2
-0.33,-0.33,One,1,Two,2
-0.33,0.33,One,1,Two,2
</Parameter>
</Datasource>
</Layer>
<Style name="grouped">
<Rule>
<GroupSymbolizer start-column="1" num-columns="2" placement="point" avoid-edges="false" minimum-distance="10" spacing="20" repeat-key="[name%]+'-'+[ref%]">
<PairLayout item-margin="1"/>
<GroupRule>
<PointSymbolizer file="../../data/svg/rect.svg"/>
<TextSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" dy="10">[name%]</TextSymbolizer>
<TextSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" dy="-10">[ref%]</TextSymbolizer>
</GroupRule>
</GroupSymbolizer>
</Rule>
</Style>
<Layer name="layer" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>non-grouped</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
lat,long,name1,ref1,name2,ref2
0.33,-0.33,One,1,Two,2
0.33,0.33,One,1,Two,2
</Parameter>
</Datasource>
</Layer>
<Style name="non-grouped">
<Rule>
<ShieldSymbolizer face-name="DejaVu Sans Book" dx="-16.25" file="../../data/svg/rect.svg"/>
<TextSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" dx="-0.25" dy="10">[name1]</TextSymbolizer>
<TextSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" dx="-11.25" dy="-10">[ref1]</TextSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" dx="15" file="../../data/svg/rect.svg"/>
<TextSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" dx="0.25" dy="10">[name2]</TextSymbolizer>
<TextSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" dx="10" dy="-10">[ref2]</TextSymbolizer>
</Rule>
</Style>
<Layer name="layer2" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>frame</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
lat,long,nr
-1,-1,0
-1,1,1
1,-1,2
1,1,3
</Parameter>
</Datasource>
</Layer>
<Style name="frame">
<Rule>
<PointSymbolizer/>
</Rule>
</Style>
<Layer name="layer3" srs="+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs">
<StyleName>center</StyleName>
<Datasource>
<Parameter name="type">csv</Parameter>
<Parameter name="inline">
lat,long,nr
-0.33,-0.33,0
0.33,-0.33,1
-0.33,0.33,2
0.33,0.33,3
</Parameter>
</Datasource>
</Layer>
<Style name="center">
<Rule>
<PointSymbolizer allow-overlap="true" ignore-placement="true" file="../../data/raster/white-alpha.png"/>
</Rule>
</Style>
</Map>