Skip to content

Commit

Permalink
+ temp fix : provide get_fill_opacity_impl to avoid
Browse files Browse the repository at this point in the history
  "No to_python (by-value) converter found for C++ type: float"
  • Loading branch information
artemp committed Aug 7, 2012
1 parent ee6ddbf commit 60d843a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion bindings/python/mapnik_markers_symbolizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ struct markers_symbolizer_pickle_suite : boost::python::pickle_suite

};

PyObject* get_fill_opacity_impl(markers_symbolizer & sym)
{
boost::optional<float> fill_opacity = sym.get_fill_opacity();
if (fill_opacity)
return ::PyFloat_FromDouble(*fill_opacity);
return Py_None;
}

void export_markers_symbolizer()
{
using namespace boost::python;
Expand Down Expand Up @@ -117,7 +125,7 @@ void export_markers_symbolizer()
&markers_symbolizer::set_opacity,
"Set/get the overall opacity")
.add_property("fill_opacity",
&markers_symbolizer::get_fill_opacity,
&get_fill_opacity_impl,
&markers_symbolizer::set_fill_opacity,
"Set/get the fill opacity")
.add_property("ignore_placement",
Expand Down

1 comment on commit 60d843a

@artemp
Copy link
Member Author

@artemp artemp commented on 60d843a May 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@springmeyer

>>> import mapnik
>>> sym=mapnik.MarkersSymbolizer()
>>> sym.fill_opacity

>>> sym.fill_opacity=0.5
>>> sym.fill_opacity
0.5

Please sign in to comment.