add changes missed in r2287

This commit is contained in:
Dane Springmeyer 2010-10-15 02:16:37 +00:00
parent 3011f53205
commit aef676c090
3 changed files with 54 additions and 6 deletions

View file

@ -36,16 +36,18 @@ namespace mapnik
point_symbolizer::point_symbolizer() point_symbolizer::point_symbolizer()
: symbolizer_with_image(path_expression_ptr(new path_expression)), // FIXME : symbolizer_with_image(path_expression_ptr(new path_expression)), // FIXME
symbolizer_base(), symbolizer_base(),
overlap_(false) {} overlap_(false),
ignore_placement_(false) {}
point_symbolizer::point_symbolizer(path_expression_ptr file) point_symbolizer::point_symbolizer(path_expression_ptr file)
: symbolizer_with_image(file), symbolizer_base(), : symbolizer_with_image(file), symbolizer_base(),
overlap_(false) {} overlap_(false),
ignore_placement_(false) {}
point_symbolizer::point_symbolizer(point_symbolizer const& rhs) point_symbolizer::point_symbolizer(point_symbolizer const& rhs)
: symbolizer_with_image(rhs), symbolizer_base(rhs), : symbolizer_with_image(rhs), symbolizer_base(rhs),
overlap_(rhs.overlap_) overlap_(rhs.overlap_),
{} ignore_placement_(rhs.ignore_placement_) {}
void point_symbolizer::set_allow_overlap(bool overlap) void point_symbolizer::set_allow_overlap(bool overlap)
{ {
@ -57,5 +59,15 @@ bool point_symbolizer::get_allow_overlap() const
return overlap_; return overlap_;
} }
void point_symbolizer::set_ignore_placement(bool ignore_placement)
{
ignore_placement_ = ignore_placement;
}
bool point_symbolizer::get_ignore_placement() const
{
return ignore_placement_;
}
} }

View file

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE Map >
<Map background-color="#b5d0d0" srs="+init=epsg:4326" min_version="0.7.1">
<Style name="1">
<Rule title="foo1">
<Filter>([name]='Brazil' or [name]='Mongolia' or [name]='Sudan')</Filter>
<PointSymbolizer file="../svg/ellipses.svg" allow_overlap="true"/>
</Rule>
<Rule title="foo">
<ElseFilter />
<PointSymbolizer ignore_placement="true" file="../svg/ellipses.svg"/>
<PointSymbolizer />
</Rule>
</Style>
<Layer name="point" srs="+init=epsg:4326">
<StyleName>1</StyleName>
<Datasource>
<Parameter name="extent">-180,-70,180,70</Parameter>
<Parameter name="file">../sqlite/qgis_spatiallite.sqlite</Parameter>
<Parameter name="geometry_field">geometry</Parameter>
<Parameter name="key_field">pkuid</Parameter>
<Parameter name="table">point</Parameter>
<Parameter name="type">sqlite</Parameter>
<Parameter name="use_spatial_index">1</Parameter>
<Parameter name="wkb_format">spatialite</Parameter>
</Datasource>
</Layer>
</Map>

View file

@ -61,11 +61,16 @@ def test_pointsymbolizer_init():
eq_(p.allow_overlap, False) eq_(p.allow_overlap, False)
eq_(p.opacity,1) eq_(p.opacity,1)
eq_(p.filename,'') eq_(p.filename,'')
eq_(p.ignore_placement,False)
p = mapnik2.PointSymbolizer(mapnik2.PathExpression("../data/images/dummy.png")) p = mapnik2.PointSymbolizer(mapnik2.PathExpression("../data/images/dummy.png"))
eq_(p.allow_overlap, False) p.allow_overlap = True
eq_(p.opacity, 1) p.opacity = 0.5
p.ignore_placement = True
eq_(p.allow_overlap, True)
eq_(p.opacity, 0.5)
eq_(p.filename,'../data/images/dummy.png') eq_(p.filename,'../data/images/dummy.png')
eq_(p.ignore_placement,True)
# PointSymbolizer missing image file # PointSymbolizer missing image file
# images paths are now PathExpressions are evaluated at runtime # images paths are now PathExpressions are evaluated at runtime
@ -83,6 +88,7 @@ def test_pointsymbolizer_pickle():
eq_(p.filename, p2.filename) eq_(p.filename, p2.filename)
eq_(p.allow_overlap, p2.allow_overlap) eq_(p.allow_overlap, p2.allow_overlap)
eq_(p.opacity, p2.opacity) eq_(p.opacity, p2.opacity)
eq_(p.ignore_placement, p2.ignore_placement)
# PolygonSymbolizer initialization # PolygonSymbolizer initialization
def test_polygonsymbolizer_init(): def test_polygonsymbolizer_init():