more python
This commit is contained in:
parent
007398725f
commit
50d9b88356
4 changed files with 5 additions and 4 deletions
|
@ -42,6 +42,7 @@ class _injector(object):
|
|||
class _coord(coord,_injector):
|
||||
def __repr__(self):
|
||||
return 'coord(%s,%s)' % (self.x, self.y)
|
||||
|
||||
class _envelope(envelope,_injector):
|
||||
def __repr__(self):
|
||||
return 'envelope(%s,%s,%s,%s)' % \
|
||||
|
@ -51,7 +52,7 @@ class _color(color,_injector):
|
|||
def __repr__(self):
|
||||
return 'color(%s,%s,%s,%s)' % \
|
||||
(self.r,self.g,self.b,self.a)
|
||||
|
||||
|
||||
#register datasources
|
||||
from mapnik import datasource_cache
|
||||
datasource_cache.instance().register_datasources("${PREFIX}/datasources")
|
||||
|
|
|
@ -50,6 +50,7 @@ void export_color ()
|
|||
.add_property("g",&Color::green,&Color::set_green)
|
||||
.add_property("b",&Color::blue,&Color::set_blue)
|
||||
.add_property("a",&Color::alpha)
|
||||
.def(self == self)
|
||||
.def_pickle(color_pickle_suite())
|
||||
;
|
||||
def("color_from_string",&create_from_string);
|
||||
|
|
|
@ -91,7 +91,6 @@ namespace
|
|||
{
|
||||
std::string key=extract<std::string>(keys[i]);
|
||||
std::string value=extract<std::string>(d[key]);
|
||||
std::cout<<key<<":"<<value<<std::endl;
|
||||
params.add(key,value);
|
||||
}
|
||||
return Layer(params);
|
||||
|
|
|
@ -86,12 +86,12 @@ void export_map()
|
|||
(&Map::getBackground,return_value_policy<copy_const_reference>()),
|
||||
&Map::setBackground)
|
||||
.def("scale", &Map::scale)
|
||||
.def("add",&Map::addLayer)
|
||||
.def("zoom_to_box",&Map::zoomToBox)
|
||||
.def("pan",&Map::pan)
|
||||
.def("zoom",&Map::zoom)
|
||||
.def("pan_and_zoom",&Map::pan_and_zoom)
|
||||
.def("layers",&Map::layers,return_value_policy<reference_existing_object>())
|
||||
.add_property("layers",make_function
|
||||
(&Map::layers,return_value_policy<reference_existing_object>()))
|
||||
.def_pickle(map_pickle_suite())
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue