Skip to content

Commit

Permalink
interpolate atmosphere in hybrid-terrain example (#4975)
Browse files Browse the repository at this point in the history
* interpolate atmosphere in hybrid-terrain example

* proj globe, because we finally can

* don't change style

* format

* remove double newline
  • Loading branch information
birkskyum authored Nov 4, 2024
1 parent e4760d0 commit 1383326
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/examples/hybrid-terrain.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

map.setStyle('https://api.maptiler.com/maps/hybrid/style.json?key=get_your_own_OpIi9ZULNHzrESv6T2vL', {
transformStyle: (previousStyle, nextStyle) => {
nextStyle.projection = {type: 'globe'};
nextStyle.sources = {
...nextStyle.sources, terrainSource: {
type: 'raster-dem',
Expand All @@ -42,7 +43,15 @@
exaggeration: 1
}

nextStyle.sky = {}
nextStyle.sky = {
'atmosphere-blend': [
'interpolate',
['linear'],
['zoom'],
0, 1,
2, 0
],
}

nextStyle.layers.push({
id: 'hills',
Expand All @@ -64,6 +73,7 @@
})
);


map.addControl(
new maplibregl.GlobeControl()
);
Expand All @@ -76,4 +86,4 @@
);
</script>
</body>
</html>
</html>

0 comments on commit 1383326

Please sign in to comment.