diff --git a/webgis/js/gis.js b/webgis/js/gis.js index f599d24..ad6e034 100644 --- a/webgis/js/gis.js +++ b/webgis/js/gis.js @@ -25,6 +25,9 @@ const GIS = {}; GIS.CENTER_COORDS = [40.5492, 14.2317]; GIS.INIT_ZOOM = 14; +GIS.MIN_ZOOM = 11; +GIS.MAX_ZOOM = 24; + const optionsVincoli = { color: '#222', opacity: 0.8, @@ -119,7 +122,7 @@ GIS.initMap = async function (mapId, zoomLevel = this.INIT_ZOOM) { let map = L.map(mapId, { //attributionControl: false, - minZoom: 11, + minZoom: GIS.MIN_ZOOM, }).setView(this.CENTER_COORDS, zoomLevel); map.crs = L.CRS.EPSG4326; @@ -368,16 +371,16 @@ GIS.initLayers = async function(map) { layerLopozzo.id = 'lopozzo'; let osmap = new L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { - maxNativeZoom : 22, - maxZoom: 22, + maxNativeZoom : GIS.MAX_ZOOM, + maxZoom: GIS.MAX_ZOOM, attribution: '© OpenStreetMap contributors' }); 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, - maxZoom: 22, + maxNativeZoom : GIS.MAX_ZOOM, + maxZoom: GIS.MAX_ZOOM, attribution: '© Mapbox' }); let boundaries = await this.loadLayer('confini.geojson', {}, false);