From d546bd0d1845bd10fcf135e7ae95f99838619692 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Thu, 21 Jul 2022 15:12:39 +0100 Subject: [PATCH] update openstreetmap tile provider since although opentopomap has nicer maps, it's too slow/unreliable --- apps/openstmap/ChangeLog | 1 + apps/openstmap/custom.html | 7 ++++--- apps/openstmap/metadata.json | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/openstmap/ChangeLog b/apps/openstmap/ChangeLog index 6cb9d061e..64e0bd80d 100644 --- a/apps/openstmap/ChangeLog +++ b/apps/openstmap/ChangeLog @@ -10,3 +10,4 @@ 0.10: Improve scale factor calculation to fix scaling issues (#984) 0.11: Add slight offset to OSM data to align it properly (fix #984) Fix alignment of satellite info text +0.12: switch to using normal OpenStreetMap tiles (opentopomap was too slow) diff --git a/apps/openstmap/custom.html b/apps/openstmap/custom.html index 6e79a6e9a..a1dfaafb0 100644 --- a/apps/openstmap/custom.html +++ b/apps/openstmap/custom.html @@ -64,9 +64,10 @@ TODO: var OSMTILECOUNT = 3; // how many tiles do we download in each direction (Math.floor(MAPSIZE / OSMTILESIZE)+1) /* Can see possible tiles on http://leaflet-extras.github.io/leaflet-providers/preview/ However some don't allow cross-origin use */ - var TILELAYER = 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png'; // simple, high contrast - var PREVIEWTILELAYER = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + //var TILELAYER = 'https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png'; // simple, high contrast, TOO SLOW //var TILELAYER = 'http://a.tile.stamen.com/toner/{z}/{x}/{y}.png'; // black and white + var TILELAYER = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; + var PREVIEWTILELAYER = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'; // Create map and try and set the location to where the browser thinks we are var map = L.map('map').locate({setView: true, maxZoom: 16, enableHighAccuracy:true}); @@ -128,7 +129,7 @@ TODO: var min = Math.min(rgba[i+0],rgba[i+1],rgba[i+2]); var max = Math.max(rgba[i+0],rgba[i+1],rgba[i+2]); var d = max-min; - if (max<120) { // black + if (max<120 || (d<8 && max<215)) { // black, or a darker grey rgba[i+0]=0; rgba[i+1]=0; rgba[i+2]=0; diff --git a/apps/openstmap/metadata.json b/apps/openstmap/metadata.json index 2dc9bd427..33b5918a1 100644 --- a/apps/openstmap/metadata.json +++ b/apps/openstmap/metadata.json @@ -2,7 +2,7 @@ "id": "openstmap", "name": "OpenStreetMap", "shortName": "OpenStMap", - "version": "0.11", + "version": "0.12", "description": "Loads map tiles from OpenStreetMap onto your Bangle.js and displays a map of where you are. Once installed this also adds map functionality to `GPS Recorder` and `Recorder` apps", "icon": "app.png", "tags": "outdoors,gps,osm",