本文整理汇总了C++中mapnik::Map::set_background方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::set_background方法的具体用法?C++ Map::set_background怎么用?C++ Map::set_background使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mapnik::Map
的用法示例。
在下文中一共展示了Map::set_background方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
std::cout << "Generating tiles on rank " << rank << "...... \n" << std::flush;
g_gProj = GoogleProjection(maxZoom);
double dummy = 0.0;
#ifdef _DEBUG
std::string plugin_path = mapnik_dir + "input/debug/";
std::cout << "..set plugin-path to "<<plugin_path<<"\n"<< std::flush;
#else
std::string plugin_path = mapnik_dir + "input/release/";
std::cout << "..set plugin-path to "<<plugin_path<<"\n"<< std::flush;
#endif
datasource_cache::instance()->register_datasources(plugin_path.c_str());
std::string font_dir = mapnik_dir + "fonts/dejavu-fonts-ttf-2.30/ttf/";
{
std::cout << "..looking for DejaVuSans fonts in... " << font_dir << "\n"<< std::flush;
}
if (boost::filesystem3::exists( font_dir ) )
{
boost::filesystem3::directory_iterator end_itr; // default construction yields past-the-end
for ( boost::filesystem3::directory_iterator itr( font_dir );
itr != end_itr;
++itr )
{
if (!boost::filesystem3::is_directory(itr->status()) )
{
freetype_engine::register_font(itr->path().string());
}
}
std::cout << "....Ok!\n" << std::flush;
} else { std::cout << "....#Error# Font directory not found!\n" << std::flush; }
//---------------------------------------------------------------------------
// -- Generate map container
g_map.set_background(color_factory::from_string("white"));
std::cout << "..loading map file \"" << map_file << "\".....";
load_map(g_map,map_file);
std::cout << "....Ok!\n" << std::flush;
g_mapnikProj = projection(g_map.srs());
//---------------------------------------------------------------------------
// -- Create outputpath
if(!FileSystem::DirExists(output_path))
FileSystem::makedir(output_path);
bool bDone = false;
//---------------------------------------------------------------------------
// -- performance measurement
int tileCount = 0;
int currentJobQueueSize = 0;
clock_t t_0, t_1;
t_0 = clock();
while (!bDone)
{
if (rank == 0)
{
std::vector<SJob> vJobs;
GenerateRenderJobs(totalnodes*queueSize, vJobs);
currentJobQueueSize = vJobs.size();
tileCount += currentJobQueueSize;
if (vJobs.size() == 0) // no more jobs
{
bDone = true;
t_1 = clock();
double time=(double(t_1-t_0)/double(CLOCKS_PER_SEC));
double tps = tileCount/time;
std::cout << ">>> Finished rendering " << tileCount << " tiles at " << tps << " tiles per second! TOTAL TIME: " << time << "<<<\n" << std::flush;
}