From 003c5a72ab130862b6657644cf81c3a513955642 Mon Sep 17 00:00:00 2001 From: Si Parker Date: Wed, 11 Apr 2012 10:41:15 +0100 Subject: [PATCH] added MarkersSymbolizer python bindings for fill and stroke --- bindings/python/mapnik_markers_symbolizer.cpp | 10 +++++++++ tests/python_tests/object_test.py | 21 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/bindings/python/mapnik_markers_symbolizer.cpp b/bindings/python/mapnik_markers_symbolizer.cpp index d6388c6f7..aad93b7f7 100644 --- a/bindings/python/mapnik_markers_symbolizer.cpp +++ b/bindings/python/mapnik_markers_symbolizer.cpp @@ -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()), + &markers_symbolizer::set_fill, + "Set/get the marker fill color") + .add_property("stroke", + make_function(&markers_symbolizer::get_stroke, + return_value_policy()), + &markers_symbolizer::set_stroke, + "Set/get the marker stroke (outline)") ; } diff --git a/tests/python_tests/object_test.py b/tests/python_tests/object_test.py index 109efc6dd..563559e99 100644 --- a/tests/python_tests/object_test.py +++ b/tests/python_tests/object_test.py @@ -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...