fully spell out parameters on the map object - refs #977
This commit is contained in:
parent
9e924bfa11
commit
9203639640
2 changed files with 12 additions and 12 deletions
|
@ -453,7 +453,7 @@ void export_map()
|
|||
)
|
||||
|
||||
.add_property("extra_attributes",make_function(attr_nonconst,return_value_policy<reference_existing_object>()),"TODO")
|
||||
.add_property("params",make_function(params_nonconst,return_value_policy<reference_existing_object>()),"TODO")
|
||||
.add_property("parameters",make_function(params_nonconst,return_value_policy<reference_existing_object>()),"TODO")
|
||||
|
||||
.add_property("aspect_fix_mode",
|
||||
&Map::get_aspect_fix_mode,
|
||||
|
|
|
@ -28,24 +28,24 @@ def test_arbitrary_parameters_attached_to_map():
|
|||
attr = m.extra_attributes
|
||||
eq_(len(attr),0)
|
||||
|
||||
eq_(len(m.params),6)
|
||||
eq_(m.params['key'],'value2')
|
||||
eq_(m.params['key3'],'value3')
|
||||
eq_(m.params['unicode'],u'iván')
|
||||
eq_(m.params['integer'],10)
|
||||
eq_(m.params['decimal'],.999)
|
||||
eq_(m.params['number-as-string'],u'.9998')
|
||||
eq_(len(m.parameters),6)
|
||||
eq_(m.parameters['key'],'value2')
|
||||
eq_(m.parameters['key3'],'value3')
|
||||
eq_(m.parameters['unicode'],u'iván')
|
||||
eq_(m.parameters['integer'],10)
|
||||
eq_(m.parameters['decimal'],.999)
|
||||
eq_(m.parameters['number-as-string'],u'.9998')
|
||||
|
||||
|
||||
def test_serializing_arbitrary_parameters():
|
||||
m = mapnik.Map(256,256)
|
||||
m.params.append(mapnik.Parameter('width',m.width))
|
||||
m.params.append(mapnik.Parameter('height',m.height))
|
||||
m.parameters.append(mapnik.Parameter('width',m.width))
|
||||
m.parameters.append(mapnik.Parameter('height',m.height))
|
||||
|
||||
m2 = mapnik.Map(1,1)
|
||||
mapnik.load_map_from_string(m2,mapnik.save_map_to_string(m))
|
||||
eq_(m2.params['width'],m.width)
|
||||
eq_(m2.params['height'],m.height)
|
||||
eq_(m2.parameters['width'],m.width)
|
||||
eq_(m2.parameters['height'],m.height)
|
||||
|
||||
if __name__ == "__main__":
|
||||
setup()
|
||||
|
|
Loading…
Reference in a new issue