-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a hillshade layer #1157
base: main
Are you sure you want to change the base?
Add a hillshade layer #1157
Changes from 1 commit
6fb25d0
e12f62c
56760ba
ad3e8cb
6ff4bcd
6eeca39
0f98db3
4025dcb
607eeff
1394349
021c041
4977f95
ca32102
1dc4523
b951717
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const hillshading = { | ||
id: "hillshading", | ||
type: "hillshade", | ||
source: "dem", | ||
paint: { | ||
"hillshade-exaggeration": [ | ||
"interpolate", | ||
["linear"], | ||
["zoom"], | ||
3, | ||
0.2, | ||
12, | ||
0.5, | ||
], | ||
"hillshade-shadow-color": "rgba(102,85,51,1)", | ||
"hillshade-highlight-color": "rgba(255,255,204,1)", | ||
"hillshade-accent-color": "rgba(0,0,0,1)", | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -8,6 +8,7 @@ import * as lyrBackground from "./background.js"; | |||||
import * as lyrBoundary from "./boundary.js"; | ||||||
import * as lyrConstruction from "./construction.js"; | ||||||
import * as lyrHighwayShield from "./highway_shield.js"; | ||||||
import * as lyrHillshade from "./hillshade.js"; | ||||||
import * as lyrLanduse from "./landuse.js"; | ||||||
import * as lyrOneway from "./oneway.js"; | ||||||
import * as lyrPark from "./park.js"; | ||||||
|
@@ -83,6 +84,8 @@ export function build(locales) { | |||||
|
||||||
lyrFerry.ferry, | ||||||
|
||||||
lyrHillshade.hillshading, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Terrarium tiles are a bit sensitive to artificial structures like dams that look a bit strange over water, like the Lock and Dam Number 12 on the Mississippi River at Bellevue, Iowa: If we move this layer lower in the stack, such as right below However, the tradeoff is that the “hill” shading would no longer double as a bathymetry layer at sea:
While bathymetry is pretty cool, I think it’s far enough out of scope of a (land) transportation map as to be a distraction. It also looks a bit discolored without hypsometric tinting, whereas on land the absence of that tinting is quite reasonable on a non-topographic map. (General-purpose overview maps would prioritize showing the continental shelf using hypsometric tinting before bothering with elevation shading.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately this means farewell to "tunnels under terrain", which was pretty cute. It's a little odd to see the ocean floor load and then get covered with water but it makes sense when you think about it. Now there are no longer enormous glitches all over the entire ocean, just a few. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incidentally, #995 gives tunnels a different treatment that wouldn’t really exhibit the cute underlapping effect anyways. The flash of bathymetry feels like an unsubtle Easter egg, of which we have too few in this project. 🙃 In seriousness, maybe we could load the DEM source and hillshade layer only after the main sources and layers load, to avoid jank and unnecessary bandwidth and power usage. To avoid distracting the user on land, we could fade in the hillshade layer with a |
||||||
|
||||||
lyrAeroway.runway, | ||||||
lyrAeroway.runwayArea, | ||||||
lyrAeroway.taxiway, | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these colors, some road lines don’t have a lot of contrast against the background, while the knockouts around labels stand out enough to look like halos again. Maybe we could try moving all three colors closer to the preexisting background color. This could also help the layer recede into the background while still conveying information about rugged terrain to those who look for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tamed it a lot. Since the hillshade is now restricted to the luminance space, I increase the exaggeration at low zooms since it no longer fights with other colors. It fades away at high zooms to avoid ruining the foreground by being a murky blob, and to avoid getting confused by things like stadiums.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the flat lands, the old version made it actually look like a crumpled paper map :-D