Skip to content

Commit

Permalink
Updated terrain exagerration to get high elevation points more in lin…
Browse files Browse the repository at this point in the history
…e with lower ones, updated smoothing coefficient and target pitch, updated how unidentified features display on the navigation box UI
  • Loading branch information
sdl60660 committed Nov 7, 2021
1 parent 4d9496f commit 92ee576
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/components/Map.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
let altitudeChange = false;
let paused = false;
let playbackSpeed = 1;
const smoothingCoefficient = 4;
const smoothingCoefficient = 3;
// let currentFlowrateIndex = 0;
let currentFlowrate = { level: 10000, index: 0 };
Expand Down Expand Up @@ -122,7 +122,7 @@
mapBounds = map.getBounds();
map.dragRotate.disable();
map.touchZoomRotate.disable();
// map.touchZoomRotate.disable();
map.on("load", () => {
// If there's feature data passed in as a prop (doesn't really happen anymore), render rivers on load
Expand Down Expand Up @@ -400,7 +400,7 @@
.flat();
drawFlowPath({ map, featureData: [combinedFlowlines], lineWidth: 3 });
let terrainElevationMultiplier = 1.7;
let terrainElevationMultiplier = 1.2;
let cameraBaseAltitude = 4300;
const elevationArrayStep = Math.min(coordinatePath.length / 2 - 1, 100);
Expand All @@ -421,7 +421,7 @@
terrainElevationMultiplier *
Math.round(elevations[0]));
const targetPitch = 69;
const targetPitch = 70;
const distanceGap =
(initialElevation * Math.tan((targetPitch * Math.PI) / 180)) / 1000;
Expand Down Expand Up @@ -597,7 +597,8 @@
(a, b) => b.properties.hydroseq - a.properties.hydroseq
);
flowlinesData.features.forEach((feature) => {
feature.properties.feature_name = feature.properties.nameid === "unknown" ? "Unidentified River/Stream" : feature.properties.nameid;
console.log({ feature });
feature.properties.feature_name = feature.properties.nameid === "unknown" ? `Unidentified River ${feature.properties.levelpathi}` : feature.properties.nameid;
feature.properties.feature_id = feature.properties.nameid === "unknown" ? feature.properties.levelpathi : feature.properties.nameid;
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/utils/mapboxUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const addTopoLayer = ({ map }) => {
});

// add the DEM source as a terrain layer with exaggerated height
map.setTerrain({ source: "mapbox-dem", exaggeration: 1.7 });
map.setTerrain({ source: "mapbox-dem", exaggeration: 1.2 });

map.addLayer({
id: "sky",
Expand Down

1 comment on commit 92ee576

@vercel
Copy link

@vercel vercel bot commented on 92ee576 Nov 7, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.