|
|
|
@ -10,17 +10,27 @@ var firstload = true;
|
|
|
|
|
|
|
|
|
|
function mapboxMap() {
|
|
|
|
|
|
|
|
|
|
var mapsource = "auto";
|
|
|
|
|
|
|
|
|
|
if (getStorage("mapsource") == null) {
|
|
|
|
|
setStorage("mapsource", "liberty");
|
|
|
|
|
setStorage("mapsource", "auto");
|
|
|
|
|
}
|
|
|
|
|
mapsource = getStorage("mapsource");
|
|
|
|
|
|
|
|
|
|
if (mapsource == "auto") {
|
|
|
|
|
if ($("#app").hasClass("theme-dark")) {
|
|
|
|
|
mapsource = "libertydark";
|
|
|
|
|
} else {
|
|
|
|
|
mapsource = "liberty";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$("#mapbox").css("background-color", SETTINGS.maptileurls[getStorage("mapsource")].bgcolor);
|
|
|
|
|
$("#mapbox").css("background-color", SETTINGS.maptileurls[mapsource].bgcolor);
|
|
|
|
|
|
|
|
|
|
mapboxgl.accessToken = SETTINGS.mapboxpublictoken;
|
|
|
|
|
var map = new mapboxgl.Map({
|
|
|
|
|
container: 'mapbox',
|
|
|
|
|
style: SETTINGS.maptileurls[getStorage("mapsource")].json,
|
|
|
|
|
//attributionControl: false,
|
|
|
|
|
style: SETTINGS.maptileurls[mapsource].json,
|
|
|
|
|
dragPan: true,
|
|
|
|
|
pitch: 0,
|
|
|
|
|
zoom: 2,
|
|
|
|
|