bool Initialize(const std::string& map, const std::string& style) { osmscout::DatabaseParameter databaseParameter; databaseParameter.SetDebugPerformance(true); database=new osmscout::Database(databaseParameter); if (!database->Open(map.c_str())) { std::cerr << "Cannot open database" << std::endl; return false; } styleConfig=new osmscout::StyleConfig(database->GetTypeConfig()); if (!osmscout::LoadStyleConfig(style.c_str(), *styleConfig)) { std::cerr << "Cannot open style" << std::endl; } searchParameter.SetUseLowZoomOptimization(true); return true; }
bool Initialize(const std::string& map, const std::string& style) { osmscout::DatabaseParameter databaseParameter; database=std::make_shared<osmscout::Database>(databaseParameter); mapService=std::make_shared<osmscout::MapService>(database); if (!database->Open(map.c_str())) { std::cerr << "Cannot open database" << std::endl; return false; } styleConfig=std::make_shared<osmscout::StyleConfig>(database->GetTypeConfig()); if (!styleConfig->Load(style)) { std::cerr << "Cannot open style" << std::endl; return false; } searchParameter.SetUseLowZoomOptimization(true); return true; }