addLayer -> add_layer (change also coming in expr-v2 branch)

This commit is contained in:
Dane Springmeyer 2014-01-26 13:41:30 -08:00
parent 9944ca65ee
commit 8181aa9dec
6 changed files with 17 additions and 17 deletions

View file

@ -191,7 +191,7 @@ int main ( int argc , char** argv)
lyr.set_datasource(datasource_cache::instance().create(p));
lyr.add_style("provinces");
lyr.set_srs(srs_lcc);
m.addLayer(lyr);
m.add_layer(lyr);
}
// Drainage
@ -203,7 +203,7 @@ int main ( int argc , char** argv)
lyr.set_datasource(datasource_cache::instance().create(p));
lyr.set_srs(srs_lcc);
lyr.add_style("drainage");
m.addLayer(lyr);
m.add_layer(lyr);
}
{
@ -214,7 +214,7 @@ int main ( int argc , char** argv)
lyr.set_datasource(datasource_cache::instance().create(p));
lyr.set_srs(srs_lcc);
lyr.add_style("drainage");
m.addLayer(lyr);
m.add_layer(lyr);
}
// Provincial boundaries
@ -226,7 +226,7 @@ int main ( int argc , char** argv)
lyr.set_srs(srs_lcc);
lyr.set_datasource(datasource_cache::instance().create(p));
lyr.add_style("provlines");
m.addLayer(lyr);
m.add_layer(lyr);
}
// Roads
@ -243,7 +243,7 @@ int main ( int argc , char** argv)
lyr.add_style("highway-border");
lyr.add_style("highway-fill");
m.addLayer(lyr);
m.add_layer(lyr);
}
// popplaces
{
@ -255,7 +255,7 @@ int main ( int argc , char** argv)
lyr.set_srs(srs_lcc);
lyr.set_datasource(datasource_cache::instance().create(p));
lyr.add_style("popplaces");
m.addLayer(lyr);
m.add_layer(lyr);
}
m.zoom_to_box(box2d<double>(-8024477.28459,5445190.38849,-7381388.20071,5662941.44855));

View file

@ -205,24 +205,24 @@ public:
/*! \brief Add a layer to the map.
* @param l The layer to add.
*/
void addLayer(layer const& l);
void add_layer(layer const& l);
/*! \brief Get a layer.
* @param index layer number.
* @return Constant layer.
*/
layer const& getLayer(size_t index) const;
layer const& get_layer(size_t index) const;
/*! \brief Get a layer.
* @param index layer number.
* @return Non-constant layer.
*/
layer& getLayer(size_t index);
layer& get_layer(size_t index);
/*! \brief Remove a layer.
* @param index layer number.
*/
void removeLayer(size_t index);
void remove_layer(size_t index);
/*! \brief Get all layers.
* @return Constant layers.

View file

@ -745,7 +745,7 @@ void map_parser::parse_layer(Map & map, xml_node const& node)
}
}
}
map.addLayer(lyr);
map.add_layer(lyr);
}
catch (config_error const& ex)
{

View file

@ -204,12 +204,12 @@ size_t Map::layer_count() const
return layers_.size();
}
void Map::addLayer(layer const& l)
void Map::add_layer(layer const& l)
{
layers_.push_back(l);
}
void Map::removeLayer(size_t index)
void Map::remove_layer(size_t index)
{
layers_.erase(layers_.begin()+index);
}
@ -220,12 +220,12 @@ void Map::remove_all()
styles_.clear();
}
layer const& Map::getLayer(size_t index) const
layer const& Map::get_layer(size_t index) const
{
return layers_[index];
}
layer& Map::getLayer(size_t index)
layer& Map::get_layer(size_t index)
{
return layers_[index];
}

View file

@ -62,7 +62,7 @@ int main(int argc, char** argv)
l.set_datasource(ds);
l.add_style("style");
mapnik::Map m = map;
m.addLayer(l);
m.add_layer(l);
m.zoom_all();
mapnik::image_32 im(m.width(),m.height());
mapnik::agg_renderer<mapnik::image_32> ren(m,im);

View file

@ -56,7 +56,7 @@ int main(int argc, char** argv)
mapnik::layer lyr("layer");
lyr.set_datasource(ds);
lyr.add_style("style");
m.addLayer(lyr);
m.add_layer(lyr);
mapnik::feature_type_style the_style;
mapnik::rule the_rule;
mapnik::text_symbolizer text_sym(mapnik::parse_expression("[name]"),10,mapnik::color(0,0,0));