]> git.street.me.uk Git - andy/viking.git/commitdiff
Use configurable apikey for OSM Cyclemap tiles.
authorRob Norris <rw_norris@hotmail.com>
Fri, 31 Mar 2017 00:20:41 +0000 (01:20 +0100)
committerRob Norris <rw_norris@hotmail.com>
Fri, 31 Mar 2017 00:21:39 +0000 (01:21 +0100)
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.

configure.ac
src/osm.c

index c4cc37af7d381d30b9673fd62d31cd8c2b08a8a8..f1b26d703b2704daf74bed63c221005ce979da4a 100644 (file)
@@ -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.
index 48c5ef2344e1b6c65ea34944ecef21ebf89fafa5..858dc6681f0e7722945156ed46a5a51a6414ca7b 100644 (file)
--- 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,