Pre-warm map resources to make subsequent loads faster

This commit is contained in:
Skylar Ittner 2022-05-02 18:34:19 -06:00
parent c5e52c7845
commit 77da43f2bc
2 changed files with 7 additions and 4 deletions

View File

@ -10,6 +10,9 @@ var firstload = true;
function mapboxMap() {
/* Pre-load workers and stuff, and enable re-using them even after map unloaded */
mapboxgl.prewarm();
var mapsource = "auto";
if (getStorage("mapsource") == null) {

View File

@ -27,10 +27,10 @@ var SETTINGS = {
bgcolor: "#EDF5F3"
},
satellite: {
url: "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/{z}/{x}/{y}?access_token={mapboxpublictoken}",
json: "mapbox://styles/mapbox/satellite-streets-v11",
name: "Satellite",
bgcolor: "#EDF5F3"
url: "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/{z}/{x}/{y}?access_token={mapboxpublictoken}",
json: "mapbox://styles/mapbox/satellite-streets-v11",
name: "Satellite",
bgcolor: "#EDF5F3"
},
fiord: {
url: "https://maps.netsyms.net/styles/fiord-color/{z}/{x}/{y}.png",