Use mapbox for satellite layer
This commit is contained in:
parent
3f9f62db2e
commit
9f5c6c606d
11
js/gis.js
11
js/gis.js
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
import UI from "./ui.js";
|
import UI from "./ui.js";
|
||||||
|
|
||||||
|
const MAPBOX_TOKEN = 'pk.eyJ1Ijoibmljb3BhIiwiYSI6ImNseWNwZjJjbjFidzcya3BoYTU0bHg4NnkifQ.3036JnCXZTEMt6jVgMzVRw';
|
||||||
|
|
||||||
// Global leaflet
|
// Global leaflet
|
||||||
/**
|
/**
|
||||||
* @namespace GIS
|
* @namespace GIS
|
||||||
@ -155,10 +157,13 @@ GIS.initLayers = async function(map) {
|
|||||||
maxZoom: 22,
|
maxZoom: 22,
|
||||||
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
|
||||||
});
|
});
|
||||||
let esriSat = new L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
|
let mapbox = new L.tileLayer(`https://api.mapbox.com/v4/{id}/{z}/{x}/{y}@2x.jpg90?access_token=${MAPBOX_TOKEN}`, {
|
||||||
|
id : 'mapbox.satellite',
|
||||||
|
tileSize : 512,
|
||||||
|
zoomOffset : -1,
|
||||||
maxNativeZoom : 22,
|
maxNativeZoom : 22,
|
||||||
maxZoom: 22,
|
maxZoom: 22,
|
||||||
attribution: '© Esri'
|
attribution: '© Mapbox'
|
||||||
});
|
});
|
||||||
let boundaries = await this.loadLayer('confini.geojson', {}, false);
|
let boundaries = await this.loadLayer('confini.geojson', {}, false);
|
||||||
let buildings = await this.loadLayer('fabbricati.geojson', optionsPaesistici, false);
|
let buildings = await this.loadLayer('fabbricati.geojson', optionsPaesistici, false);
|
||||||
@ -178,7 +183,7 @@ GIS.initLayers = async function(map) {
|
|||||||
sitesGroup.addTo(map);
|
sitesGroup.addTo(map);
|
||||||
const baseMap = {
|
const baseMap = {
|
||||||
"OpenStreetMap" : osmap,
|
"OpenStreetMap" : osmap,
|
||||||
"Satellite" : esriSat,
|
"Satellite" : mapbox,
|
||||||
"Cartografia catastale" : baseCatasto,
|
"Cartografia catastale" : baseCatasto,
|
||||||
};
|
};
|
||||||
const archeo = {
|
const archeo = {
|
||||||
|
Loading…
Reference in New Issue
Block a user