From: Rob Norris Date: Fri, 31 Mar 2017 00:20:41 +0000 (+0100) Subject: Use configurable apikey for OSM Cyclemap tiles. X-Git-Url: https://git.street.me.uk/andy/viking.git/commitdiff_plain/e22353c2381d5ecd63d14e1b90c69445bbf5f1e7 Use configurable apikey for OSM Cyclemap tiles. Thunderforest tiles now require apikey to access tiles. Otherwise they are currently returned with a large watermark and no doubt in the future requests without apikeys will be ignored. --- diff --git a/configure.ac b/configure.ac index c4cc37af..f1b26d70 100644 --- a/configure.ac +++ b/configure.ac @@ -440,6 +440,16 @@ AC_ARG_WITH(mapbox_access_token, AC_DEFINE_UNQUOTED(VIK_CONFIG_MAPBOX_TOKEN, ${VIK_CONFIG_MAPBOX_TOKEN}, [Mapbox Token]) +dnl Compile time defined key +AC_ARG_WITH(thunderforest_apikey, + [AC_HELP_STRING([--with-thunderforest_apikey], + [API Key for Thunderforest (OSM Cyclemap) tiles. + Please register your own if you're going to distribute the + package, as requests are limited per key.])], + [VIK_CONFIG_THUNDERFOREST_KEY="\"${withval}\""], + [VIK_CONFIG_THUNDERFOREST_KEY="\"7387c111d85642b18f63608bd4cb8b4f\""]) +AC_DEFINE_UNQUOTED(VIK_CONFIG_THUNDERFOREST_KEY, ${VIK_CONFIG_THUNDERFOREST_KEY}, [Thunderforest key]) + AC_ARG_WITH(geonames_username, [AC_HELP_STRING([--with-geonames_username], [Username for the GeoNames webservice. diff --git a/src/osm.c b/src/osm.c index 48c5ef23..858dc668 100644 --- a/src/osm.c +++ b/src/osm.c @@ -64,8 +64,7 @@ void osm_init () { "id", MAP_ID_OSM_CYCLE, "label", _("OpenStreetMap (Cycle)"), "name", "OSM-Cycle", - "hostname", "tile.opencyclemap.org", - "url", "/cycle/%d/%d/%d.png", + "url", "https://tile.thunderforest.com/cycle/%d/%d/%d.png?apikey="VIK_CONFIG_THUNDERFOREST_KEY, "check-file-server-time", TRUE, "use-etag", FALSE, "zoom-min", 0,