AC_LANG_CPLUSPLUS
AC_LANG_SAVE
AC_PROG_CXX
+ # Mapnik3 requires C++11. Viking will use C++11 as well.
+ CXXFLAGS="$CXXFLAGS -std=c++11"
# Too difficult to get check working under Windows (extra dependencies needed probably Boost)- so just skip it
if test "x$ac_cv_enable_windows" = "xno"; then
AC_CHECK_HEADER([mapnik/map.hpp],[],[AC_MSG_ERROR([mapnik/map.hpp is needed but not found - you will need to install package 'libmapnik-dev' or similar. The feature can be disabled with --disable-mapnik])])
fi
AC_CHECK_LIB([mapnik], [main], [], [AC_MSG_ERROR([libmapnik is needed but not found.])])
AC_CHECK_LIB([stdc++], [main], [], [AC_MSG_ERROR([libstdc++ is needed but not found.])])
+ # Required for Mapnik3 build (it's also in Mapnik2 but does not need to be specified for some reason)
+ # it's part of libmapnik install dependencies
+ AC_CHECK_LIB([icuuc], [main], [], [AC_MSG_ERROR([libicuuc is needed but not found.])])
AC_LANG_RESTORE
;;
esac
#include <mapnik/datasource_cache.hpp>
#include <mapnik/agg_renderer.hpp>
#include <mapnik/load_map.hpp>
+#include <mapnik/projection.hpp>
+#if MAPNIK_VERSION < 300000
#include <mapnik/graphics.hpp>
+#else
+#include <mapnik/value.hpp>
+#endif
#include <mapnik/image_util.hpp>
#include <exception>
#define zoom_to_box zoomToBox
#else
#include <mapnik/box2d.hpp>
+#if MAPNIK_VERSION >= 300000
+// In Mapnik3 'image_32' has changed names once again
+#define image_32 image_rgba8
+#define raw_data data
+#endif
#endif
#define MAPNIK_INTERFACE_TYPE (mapnik_interface_get_type ())
*/
static void set_copyright ( MapnikInterface* mi )
{
- if ( mi->copyright )
- g_free ( mi->copyright );
+ g_free ( mi->copyright );
+ mi->copyright = NULL;
mapnik::parameters pmts = mi->myMap->get_extra_parameters();
+#if MAPNIK_VERSION < 300000
for (mapnik::parameters::const_iterator ii = pmts.begin(); ii != pmts.end(); ii++) {
if ( ii->first == "attribution" || ii->first == "copyright" ) {
std::stringstream ss;
ss << ii->second;
// Copy it
mi->copyright = g_strdup ( (gchar*)ss.str().c_str() );
+ break;
}
}
+#else
+ if ( pmts.get<std::string>("attribution") )
+ mi->copyright = g_strdup ( (*pmts.get<std::string>("attribution")).c_str() );
+
+ if ( !mi->copyright )
+ if ( pmts.get<std::string>("copyright") )
+ mi->copyright = g_strdup ( (*pmts.get<std::string>("copyright")).c_str() );
+#endif
}
#define VIK_SETTINGS_MAPNIK_BUFFER_SIZE "mapnik_buffer_size"
GArray *array = g_array_new (FALSE, TRUE, sizeof(gchar*));
mapnik::parameters pmts = mi->myMap->get_extra_parameters();
- for (mapnik::parameters::const_iterator ii = pmts.begin(); ii != pmts.end(); ii++) {
- // Dodgy hacking to avoid using boost or mapnik::utils visitor stuff (not available in mapnik 2.2)
- // Simply want the strings of each parameter so we can display something...
+ // Simply want the strings of each parameter so we can display something...
+#if MAPNIK_VERSION < 300000
+ for (mapnik::parameters::const_iterator pmt = pmts.begin(); pmt != pmts.end(); pmt++) {
std::stringstream ss;
- ss << ii->first << ": " << ii->second;
+ ss << pmt->first << ": " << pmt->second;
+#else
+ for (auto const& pmt : pmts) {
+ std::stringstream ss;
+ ss << pmt.first << ": " << *(pmts.get<std::string>(pmt.first,"empty"));
+#endif
// Copy - otherwise ss goes output scope and junk memory would be referenced.
gchar *str2 = g_strdup ( (gchar*)ss.str().c_str() );
g_array_append_val ( array, str2 );
#else
if ( g_file_test ( "/usr/lib/mapnik/input", G_FILE_TEST_EXISTS ) )
data.s = g_strdup ( "/usr/lib/mapnik/input" );
+ // Current Debian locations
+ else if ( g_file_test ( "/usr/lib/mapnik/3.0/input", G_FILE_TEST_EXISTS ) )
+ data.s = g_strdup ( "/usr/lib/mapnik/3.0/input" );
else if ( g_file_test ( "/usr/lib/mapnik/2.2/input", G_FILE_TEST_EXISTS ) )
- // Current Debian location
data.s = g_strdup ( "/usr/lib/mapnik/2.2/input" );
else
data.s = g_strdup ( "" );