Support for Mapnik >= 4 no longer using boost:optional (#436)

This commit is contained in:
Hummeltech
2024-06-04 13:24:04 -07:00
committed by GitHub
parent cbd63598ae
commit b9c048a6ac

View File

@ -15,7 +15,9 @@
* along with this program; If not, see http://www.gnu.org/licenses/.
*/
#if MAPNIK_MAJOR_VERSION < 4
#include <boost/optional.hpp>
#endif
#include <mapnik/datasource.hpp>
#include <mapnik/datasource_cache.hpp>
#include <mapnik/layer.hpp>
@ -65,7 +67,11 @@ static void parameterize_map_language(mapnik::Map &m, char *parameter)
mapnik::parameters params = l.datasource()->params();
if (params.find("table") != params.end()) {
#if MAPNIK_MAJOR_VERSION >= 4
std::optional<std::string> table = params.get<std::string>("table");
#else
boost::optional<std::string> table = params.get<std::string>("table");
#endif
if (table && table->find(",name") != std::string::npos) {
std::string str = *table;