update: Change the nodes default map tile server URL away from MapBox (#527)

This commit is contained in:
Eric 2020-06-20 17:54:12 -07:00 committed by GitHub
parent d06bbaac2a
commit 31492676dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 5 deletions

View File

@ -10,4 +10,4 @@ config usb
config map config map
option leafletjs 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js' option leafletjs 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js'
option leafletcss 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css' option leafletcss 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css'
option maptiles 'http://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiazVkbHEiLCJhIjoiY2lqMnlieTM4MDAyNXUwa3A2eHMxdXE3MiJ9.BRFvx4q2vi70z5Uu2zRYQw' option maptiles 'http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg'

View File

@ -23,4 +23,4 @@ config button
config map config map
option leafletjs 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js' option leafletjs 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.js'
option leafletcss 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css' option leafletcss 'http://cdn.leafletjs.com/leaflet/v0.7.7/leaflet.css'
option maptiles 'http://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiazVkbHEiLCJhIjoiY2lqMnlieTM4MDAyNXUwa3A2eHMxdXE3MiJ9.BRFvx4q2vi70z5Uu2zRYQw' option maptiles 'http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg'

View File

@ -0,0 +1,11 @@
#!/bin/sh
#check for old default map tiles and change to the new map tiles if req'd
#will not change existing custom entries.
OLDTILES='http://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiazVkbHEiLCJhIjoiY2lqMnlieTM4MDAyNXUwa3A2eHMxdXE3MiJ9.BRFvx4q2vi70z5Uu2zRYQw'
NEWTILES='http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg'
MAPTILESERVER=$(/sbin/uci -c /etc/config.mesh get aredn.@map[0].maptiles)
if [ "$MAPTILESERVER" = "$OLDTILES" ]; then
/sbin/uci -c /etc/config.mesh set aredn.@map[0].maptiles="$NEWTILES"
/sbin/uci -c /etc/config.mesh commit aredn
fi
exit 0

View File

@ -48,7 +48,7 @@ push @setting, {
key => "aredn.\@map[0].maptiles", key => "aredn.\@map[0].maptiles",
type => "string", type => "string",
desc => "Specifies the URL of the location to access map tiles", desc => "Specifies the URL of the location to access map tiles",
default => "http://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiazVkbHEiLCJhIjoiY2lqMnlieTM4MDAyNXUwa3A2eHMxdXE3MiJ9.BRFvx4q2vi70z5Uu2zRYQw" default => "http://stamen-tiles-{s}.a.ssl.fastly.net/terrain/{z}/{x}/{y}.jpg"
}; };
push @setting, { push @setting, {
key => "aredn.\@map[0].leafletcss", key => "aredn.\@map[0].leafletcss",

View File

@ -1245,8 +1245,8 @@ print <<EOF;
{ {
maxZoom: 18, maxZoom: 18,
attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' + attribution: 'Map data &copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, ' +
'<a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, ' + '<a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>, ' +
'Imagery &copy;<a href="http://mapbox.com">Mapbox</a>', 'Imagery &copy;<a href="http://stamen.com">Stamen Design</a>',
id: 'mapbox.streets' id: 'mapbox.streets'
}).addTo(map); }).addTo(map);