Skip to content

Commit 1828d3f

Browse files
committed
Age-based opacity for heatmap
1 parent 061599f commit 1828d3f

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

Styles/OSM_traces.json

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,23 @@
1919
"paint": {
2020
"line-color": "yellow",
2121
"line-width": {"stops": [[8, 1], [10, 2.5]]},
22-
"line-opacity": 0.6
22+
"line-opacity": [
23+
"interpolate",
24+
["linear"],
25+
[
26+
"-",
27+
["+", 2023, ["/", 5, 12]],
28+
[
29+
"+",
30+
["to-number", ["slice", ["get", "start_time"], 0, 4]],
31+
["/", ["to-number", ["slice", ["get", "start_time"], 5, 7]], 12]
32+
]
33+
],
34+
0,
35+
0.6,
36+
3,
37+
0.1
38+
]
2339
}
2440
},
2541
{
@@ -33,7 +49,23 @@
3349
"line-color": "rgba(0, 128, 0, 1)",
3450
"line-blur": 0,
3551
"line-width": {"stops": [[8, 0.2], [10, 1]]},
36-
"line-opacity": 0.6
52+
"line-opacity": [
53+
"interpolate",
54+
["linear"],
55+
[
56+
"-",
57+
["+", 2023, ["/", 5, 12]],
58+
[
59+
"+",
60+
["to-number", ["slice", ["get", "start_time"], 0, 4]],
61+
["/", ["to-number", ["slice", ["get", "start_time"], 5, 7]], 12]
62+
]
63+
],
64+
0,
65+
0.6,
66+
3,
67+
0.1
68+
]
3769
}
3870
}
3971
],

0 commit comments

Comments
 (0)