本文整理汇总了C++中mapnik::Map::buffer_size方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::buffer_size方法的具体用法?C++ Map::buffer_size怎么用?C++ Map::buffer_size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapnik::Map
的用法示例。
在下文中一共展示了Map::buffer_size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render_with_vars
void render_with_vars(mapnik::Map const& map,
mapnik::image_any& image,
boost::python::dict const& d,
double scale_factor = 1.0,
unsigned offset_x = 0u,
unsigned offset_y = 0u)
{
mapnik::attributes vars = mapnik::dict2attr(d);
mapnik::request req(map.width(),map.height(),map.get_current_extent());
req.set_buffer_size(map.buffer_size());
python_unblock_auto_block b;
mapnik::util::apply_visitor(agg_renderer_visitor_3(map, req, vars, scale_factor, offset_x, offset_y), image);
}
示例2: backend
backend_type backend(tile,16);
mapnik::Map map(tile_size,tile_size,"+init=epsg:3857");
map.set_buffer_size(256);
mapnik::layer lyr("layer",map.srs());
mapnik::parameters params;
params["type"] = "gdal";
// created with:
// wget http://www.nacis.org/naturalearth/50m/raster/NE2_50m_SR_W.zip
// gdalwarp -t_srs EPSG:3857 -ts 1048 1048 -r bilinear NE2_50M_SR_W.tif natural_earth.tif
params["file"] = "test/natural_earth.tif";
MAPNIK_SHARED_PTR<mapnik::datasource> ds =
mapnik::datasource_cache::instance().create(params);
lyr.set_datasource(ds);
map.MAPNIK_ADD_LAYER(lyr);
mapnik::request m_req(tile_size,tile_size,bbox);
m_req.set_buffer_size(map.buffer_size());
renderer_type ren(backend,map,m_req,1.0,0,0,1,"jpeg",mapnik::SCALING_BILINEAR);
ren.apply();
CHECK(1 == tile.layers_size());
mapnik::vector::tile_layer const& layer = tile.layers(0);
CHECK(std::string("layer") == layer.name());
CHECK(1 == layer.features_size());
mapnik::vector::tile_feature const& f = layer.features(0);
CHECK(static_cast<mapnik::value_integer>(1) == static_cast<mapnik::value_integer>(f.id()));
CHECK(0 == f.geometry_size());
CHECK(f.has_raster());
std::string const& ras_buffer = f.raster();
CHECK(!ras_buffer.empty());
// debug
bool debug = false;
if (debug) {