This commit is contained in:
Generated
+1132
-107
File diff suppressed because it is too large
Load Diff
+6
-6
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^9.19.0",
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@vitejs/plugin-vue": "^6.0.8",
|
||||
"eslint": "^9.19.0",
|
||||
"eslint-plugin-vue": "^9.32.0",
|
||||
"globals": "^15.14.0",
|
||||
"eslint": "^10.9.1",
|
||||
"eslint-plugin-vue": "^10.10.0",
|
||||
"globals": "^17.11.0",
|
||||
"vite": "^8.1.5"
|
||||
},
|
||||
"name": "livetrail",
|
||||
@@ -23,8 +23,8 @@
|
||||
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
||||
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
||||
"@fortawesome/vue-fontawesome": "^3.2.0",
|
||||
"@uppy/core": "^5.2.0",
|
||||
"@uppy/xhr-upload": "^5.2.0",
|
||||
"@uppy/core": "^6.0.0",
|
||||
"@uppy/xhr-upload": "^6.0.0",
|
||||
"autosize": "^6.0.1",
|
||||
"maplibre-gl": "^6.0.0",
|
||||
"sass": "^1.97.2",
|
||||
|
||||
@@ -155,6 +155,10 @@ export default {
|
||||
addTerrain() {
|
||||
// MapLibre terrain's fog matrix is only implemented for Mercator.
|
||||
this.map.setProjection({type: 'mercator'});
|
||||
//One shared raster-dem source feeds both the 3D elevation mesh
|
||||
//(setTerrain) and the hillshade layer below - they used to be two
|
||||
//separate sources pointed at the identical tile URL, which meant
|
||||
//every DEM tile was downloaded and decoded twice per viewport.
|
||||
if(!this.map.getSource('terrain-dem')) {
|
||||
this.map.addSource('terrain-dem', {
|
||||
type: 'raster-dem',
|
||||
@@ -164,20 +168,11 @@ export default {
|
||||
encoding: 'terrarium'
|
||||
});
|
||||
}
|
||||
if(!this.map.getSource('hillshade-dem')) {
|
||||
this.map.addSource('hillshade-dem', {
|
||||
type: 'raster-dem',
|
||||
tiles: ['https://s3.amazonaws.com/elevation-tiles-prod/terrarium/{z}/{x}/{y}.png'],
|
||||
tileSize: 256,
|
||||
maxzoom: 13,
|
||||
encoding: 'terrarium'
|
||||
});
|
||||
}
|
||||
if(!this.map.getLayer('terrain-hillshade')) {
|
||||
this.map.addLayer({
|
||||
id: 'terrain-hillshade',
|
||||
type: 'hillshade',
|
||||
source: 'hillshade-dem',
|
||||
source: 'terrain-dem',
|
||||
paint: {
|
||||
'hillshade-exaggeration': 0.35,
|
||||
'hillshade-shadow-color': '#2d342b',
|
||||
@@ -191,7 +186,6 @@ export default {
|
||||
if(!this.map) return;
|
||||
if(this.map.getTerrain()) this.map.setTerrain(null);
|
||||
if(this.map.getLayer('terrain-hillshade')) this.map.removeLayer('terrain-hillshade');
|
||||
if(this.map.getSource('hillshade-dem')) this.map.removeSource('hillshade-dem');
|
||||
if(this.map.getSource('terrain-dem')) this.map.removeSource('terrain-dem');
|
||||
this.map.setProjection({type: 'globe'});
|
||||
},
|
||||
|
||||
@@ -75,7 +75,7 @@ export default class Projects {
|
||||
iElevDrop += Math.min(iElevDelta, 0);
|
||||
iElevGain += Math.max(iElevDelta, 0);
|
||||
|
||||
let iSpeedCorrecRatio = 0;
|
||||
let iSpeedCorrecRatio;
|
||||
const iAngle = iElevDelta / iSegDistance;
|
||||
if(iAngle < -1) iSpeedCorrecRatio = 0.5;
|
||||
else if(iAngle < -0.2) iSpeedCorrecRatio = 1.25;
|
||||
|
||||
Reference in New Issue
Block a user