diff --git a/config.xml b/config.xml index 34e245d..81916e6 100644 --- a/config.xml +++ b/config.xml @@ -33,4 +33,5 @@ + diff --git a/www/assets/js/manage.js b/www/assets/js/manage.js index fcb0aff..e71d311 100644 --- a/www/assets/js/manage.js +++ b/www/assets/js/manage.js @@ -67,7 +67,7 @@ $("#addpackagebtn").click(function () { } var address = ($("input[name=number]").val() + " " + $("input[name=street]").val()).toUpperCase(); - $.getJSON(geocodeapi, { + $.getJSON(SETTINGS.geocodeapi, { address: address + " " + $("input[name=citystate]").val().toUpperCase() }, function (resp) { if (resp.status == "OK") { diff --git a/www/assets/js/map_leaflet.js b/www/assets/js/map_leaflet.js index cc29885..2f7aa50 100644 --- a/www/assets/js/map_leaflet.js +++ b/www/assets/js/map_leaflet.js @@ -14,26 +14,20 @@ function leafletMap() { attributionControl: false }); - var mapSources = { - "offline": 'assets/tiles/{z}/{x}/{y}.png', - "liberty": 'https://maps.netsyms.net/styles/osm-liberty/{z}/{x}/{y}.png', - "terrain": 'https://maps.netsyms.net/styles/klokantech-terrain/{z}/{x}/{y}.png' - }; - if (localStorage.getItem("mapsource") == null) { - localStorage.setItem("mapsource", "offline"); + localStorage.setItem("mapsource", "liberty"); } if (localStorage.getItem("mapsource") == "offline") { map.setMaxBounds(L.latLngBounds(L.latLng(46.7384, -112.1429), L.latLng(46.5127, -111.7557))); map.setMinZoom(12); map.setMaxZoom(16); - L.tileLayer(mapSources[localStorage.getItem("mapsource")], { + L.tileLayer(SETTINGS.maptileurls[localStorage.getItem("mapsource")], { minZoom: 12, maxZoom: 16 }).addTo(map); } else { - L.tileLayer(mapSources[localStorage.getItem("mapsource")], { + L.tileLayer(SETTINGS.maptileurls[localStorage.getItem("mapsource")], { minZoom: 1, maxZoom: 19 }).addTo(map); diff --git a/www/assets/js/settings.js b/www/assets/js/settings.js index ecd9f57..9debfc5 100644 --- a/www/assets/js/settings.js +++ b/www/assets/js/settings.js @@ -117,6 +117,9 @@ function pickMapSource() { { text: 'Terrain' + (currentmapsource == "terrain" ? " (current)" : ""), }, + { + text: 'Dark Fiord' + (currentmapsource == "fiord" ? " (current)" : ""), + }, { text: 'Cancel', color: 'red' @@ -135,6 +138,9 @@ function pickMapSource() { case 2: mapsource = "terrain"; break; + case 3: + mapsource = "fiord"; + break; default: return; } diff --git a/www/index.html b/www/index.html index bbd8ac9..53ea780 100644 --- a/www/index.html +++ b/www/index.html @@ -19,16 +19,14 @@ - - + + diff --git a/www/settings.js b/www/settings.js new file mode 100644 index 0000000..0669a7c --- /dev/null +++ b/www/settings.js @@ -0,0 +1,9 @@ +var SETTINGS = { + "maptileurls": { + "offline": "assets/tiles/{z}/{x}/{y}.png", + "liberty": "https://maps.netsyms.net/styles/osm-liberty/{z}/{x}/{y}.png", + "terrain": "https://maps.netsyms.net/styles/klokantech-terrain/{z}/{x}/{y}.png", + "fiord": "https://maps.netsyms.net/styles/fiord-color/{z}/{x}/{y}.png" + }, + "geocodeapi": "https://apis.netsyms.net/packagehelper/geocode.php" +}