add missing serialization of building symbolizer height, be explicit of double in polygon_symbolizer

This commit is contained in:
Dane Springmeyer 2009-07-24 06:10:42 +00:00
parent 8db8c27446
commit e0c9e5c826
3 changed files with 28 additions and 1 deletions

View file

@ -64,7 +64,7 @@ namespace mapnik
{
explicit building_symbolizer()
: fill_(color(128,128,128)),
height_(0),
height_(0.0),
opacity_(1.0)
{}

View file

@ -183,6 +183,10 @@ namespace mapnik
{
set_css( sym_node, "fill-opacity", sym.get_opacity() );
}
if ( sym.height() != dfl.height() || explicit_defaults_ )
{
set_css( sym_node, "height", sym.height() );
}
}
void operator () ( markers_symbolizer const& )

View file

@ -42,3 +42,26 @@ def test_render_image_to_file():
os.remove('test.png')
else:
return False
def get_paired_images(w,h,mapfile):
tmp_map = 'tmp_map.xml'
m = mapnik.Map(w,h)
mapnik.load_map(m,mapfile)
i = mapnik.Image(w,h)
m.zoom_all()
mapnik.render(m,i)
mapnik.save_map(m,tmp_map)
m2 = mapnik.Map(w,h)
mapnik.load_map(m2,tmp_map)
i2 = mapnik.Image(w,h)
m2.zoom_all()
mapnik.render(m2,i2)
os.remove(tmp_map)
return i,i2
def test_render_from_serialization():
i,i2 = get_paired_images(100,100,'../data/good_maps/building_symbolizer.xml')
eq_(i.tostring(),i2.tostring())
i,i2 = get_paired_images(100,100,'../data/good_maps/polygon_symbolizer.xml')
eq_(i.tostring(),i2.tostring())