Merge pull request #1172 from caffeinate/master

MarkersSymbolizer - stroke/fill python bindings
This commit is contained in:
Dane Springmeyer 2012-04-19 12:15:43 -07:00
commit 61d3cf635a
2 changed files with 31 additions and 0 deletions

View file

@ -124,5 +124,15 @@ void export_markers_symbolizer()
&markers_symbolizer::get_height,
&markers_symbolizer::set_height,
"Set/get the marker height")
.add_property("fill",
make_function(&markers_symbolizer::get_fill,
return_value_policy<copy_const_reference>()),
&markers_symbolizer::set_fill,
"Set/get the marker fill color")
.add_property("stroke",
make_function(&markers_symbolizer::get_stroke,
return_value_policy<copy_const_reference>()),
&markers_symbolizer::set_stroke,
"Set/get the marker stroke (outline)")
;
}

View file

@ -113,6 +113,27 @@ def test_pointsymbolizer_init():
eq_(p.ignore_placement,True)
eq_(p.placement, mapnik.point_placement.INTERIOR)
# PointSymbolizer initialization
def test_markersymbolizer_init():
p = mapnik.MarkersSymbolizer()
eq_(p.allow_overlap, False)
eq_(p.opacity,1)
eq_(p.filename,'')
stroke = mapnik.Stroke()
stroke.color = mapnik.Color('black')
stroke.width = 1.0
p.stroke = stroke
p.fill = mapnik.Color('white')
p.allow_overlap = True
p.opacity = 0.5
eq_(p.allow_overlap, True)
eq_(p.opacity, 0.5)
# PointSymbolizer missing image file
# images paths are now PathExpressions are evaluated at runtime
# so it does not make sense to throw...