]> git.street.me.uk Git - andy/viking.git/commitdiff
SF Bugs#134: Replaced discontinued MapQuest tile service with rate limited Mapbox...
authorRob Norris <rw_norris@hotmail.com>
Sun, 7 Aug 2016 10:27:20 +0000 (11:27 +0100)
committerRob Norris <rw_norris@hotmail.com>
Mon, 8 Aug 2016 20:47:43 +0000 (21:47 +0100)
Choose an 'Outdoors' styled map to reflected presumed likely usage of Viking.

This is the default map, so users are likely to encounter service request limits.

help/C/figures/map_tile_info_dialog.png
help/C/viking.xml
src/map_ids.h
src/osm.c
src/vikmapslayer.c
test/OpenStreetMap.vik
tools/viking-cache.py

index 9a8725054e6f3926bb42a8d9026bb2024983dbc4..2c39c798bccaf319aa31ca9e8b690fb338582b45 100644 (file)
Binary files a/help/C/figures/map_tile_info_dialog.png and b/help/C/figures/map_tile_info_dialog.png differ
index b1fee61275c43e28c029b8fe87eda36bf88389c1..d39d8220e7bd4af31a9e300ed9eb18a2b19b7d0c 100644 (file)
@@ -1678,7 +1678,7 @@ Inbuilt maps include various <ulink url="http://openstreetmap.org/">OpenStreetMa
 </formalpara>
 <itemizedlist>
 <listitem><para>Bing Bird's Eye (Aerial) Maps (&appname; Version1.2+)</para></listitem>
-<listitem><para>OpenStreetMap (Mapquest) - This is the default (&appname; Version1.3+)</para></listitem>
+<listitem><para>Mapbox Outdoors - This is the default (&appname; Version1.7+)</para></listitem>
 <listitem><para>OpenStreetMap (Mapnik)</para></listitem>
 <listitem><para>OpenStreetMap (Cycle)</para></listitem>
 <listitem><para>OpenStreetMap (Transport) (&appname; Version1.3+)</para></listitem>
index 98e3ca73d6e63f108fadf5e9c99a478596f2a482..d22743dbd2f2344c0a683ded2de29a3caa8d3e28 100644 (file)
 #define MAP_ID_OSM_MAPNIK 13
 #define MAP_ID_BLUE_MARBLE 15
 #define MAP_ID_OSM_CYCLE 17
-#define MAP_ID_MAPQUEST_OSM 19
+//#define MAP_ID_MAPQUEST_OSM 19 // Tile Service discontinued
 #define MAP_ID_OSM_TRANSPORT 20
 #define MAP_ID_OSM_ON_DISK 21
 #define MAP_ID_OSM_HUMANITARIAN 22
 #define MAP_ID_MBTILES 23
 #define MAP_ID_OSM_METATILES 24
+#define MAP_ID_MAPBOX_OUTDOORS 25
  
 #define MAP_ID_BING_AERIAL 212
  
index 07a41cb92885bbd566d66996247025f5b49c74fa..1321a416d50f6ad962044b4852e7fe17c5cc88ec 100644 (file)
--- a/src/osm.c
+++ b/src/osm.c
@@ -89,21 +89,6 @@ void osm_init () {
                                 "license", "CC-BY-SA",
                                 "license-url", "http://www.openstreetmap.org/copyright",
                                 NULL));
-  VikMapSource *mapquest_type =
-    VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
-                                "id", MAP_ID_MAPQUEST_OSM,
-                                "name", "OSM-MapQuest",
-                                "label", "OpenStreetMap (MapQuest)",
-                                "hostname", "otile1.mqcdn.com",
-                                "url", "/tiles/1.0.0/osm/%d/%d/%d.png",
-                                "check-file-server-time", TRUE,
-                                "use-etag", FALSE,
-                                "zoom-min", 0,
-                                "zoom-max", 19,
-                                "copyright", "Tiles Courtesy of MapQuest © OpenStreetMap contributors",
-                                "license", "MapQuest Specific",
-                                "license-url", "http://developer.mapquest.com/web/info/terms-of-use",
-                                NULL));
   VikMapSource *hot_type =
     VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
                                 "id", MAP_ID_OSM_HUMANITARIAN,
@@ -152,7 +137,28 @@ void osm_init () {
                                 "is-osm-meta-tiles", TRUE,
                                 NULL));
 
-  maps_layer_register_map_source (mapquest_type);
+  // Note using a single global Viking registered key for the Mapbox Tileservice
+  //  which is not secret since it's right here!
+  // Thus not only will the (free) service allocation limit be reached by normal users
+  //  but by anymore who cares to read this source and use it themselves.
+  VikMapSource *mapbox_type =
+    VIK_MAP_SOURCE(g_object_new(VIK_TYPE_SLIPPY_MAP_SOURCE,
+                                "id", MAP_ID_MAPBOX_OUTDOORS,
+                                "name", "Mapbox-Outdoors",
+                                "label", "Mapbox Outdoors",
+                                "url", "https://api.tiles.mapbox.com/styles/v1/mapbox/outdoors-v9/tiles/256/%d/%d/%d?access_token=pk.eyJ1Ijoicndub3JyaXMiLCJhIjoiY2lxc294anN2MDA5bWhzbWFseWsxMW1ydiJ9.HcybKtZsiG6RVuOHg481Kg",
+                                "check-file-server-time", TRUE,
+                                "use-etag", FALSE,
+                                "zoom-min", 0,
+                                "zoom-max", 19,
+                                "copyright", "© Mapbox © OpenStreetMap",
+                                "license", "Mapbox Specific",
+                                "license-url", "https://www.mapbox.com/tos",
+                                NULL));
+
+  // NB The first registered map source is the default
+  //  (unless the user has specified Map Layer defaults)
+  maps_layer_register_map_source (mapbox_type);
   maps_layer_register_map_source (mapnik_type);
   maps_layer_register_map_source (cycle_type);
   maps_layer_register_map_source (transport_type);
index 6bb17a4af1a9b022973e92959d9d3b922a30d5e2..a0e2677fb28a2de0dcc90eb04b6242c020a6ff1e 100644 (file)
@@ -127,7 +127,7 @@ static VikLayerParamScale params_scales[] = {
  { 0, 255, 3, 0 }, /* alpha */
 };
 
-static VikLayerParamData id_default ( void ) { return VIK_LPD_UINT ( MAP_ID_MAPQUEST_OSM ); }
+static VikLayerParamData id_default ( void ) { return VIK_LPD_UINT ( MAP_ID_MAPBOX_OUTDOORS ); }
 static VikLayerParamData directory_default ( void )
 {
   VikLayerParamData data;
index c0a4347cf570c9e62885e686c3760d92271eedf3..f37fc3c64f1298f01aafa26e9602bacf16aaa68a 100644 (file)
@@ -27,13 +27,3 @@ autodownload=t
 mapzoom=0
 ~EndLayer
 
-
-~Layer Map
-name=MapQuest
-mode=19
-directory=
-alpha=255
-autodownload=t
-mapzoom=0
-~EndLayer
-
index 9b333a8fccf4e7836490d21e013077217457c4ed..85d02fdfa1e41aede95b383b39e04de0a156c578 100755 (executable)
@@ -354,6 +354,8 @@ def get_tile_path (tid):
         return "OSM-Transport"
     elif tile_id == 22:
         return "OSM-Humanitarian"
+    elif tile_id == 25:
+        return "Mapbox-Outdoors"
     elif tile_id == 212:
         return "Bing-Aerial"
     # Default extension Map ids (from data/maps.xml)