@swr-data-lab/components 2.13.2 → 2.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DesignTokens/DesignTokens.svelte +13 -11
- package/dist/DesignTokens/DesignTokens.svelte.d.ts +1 -0
- package/dist/DesignTokens/Tokens.js +5 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/isDarkMode/index.d.ts +2 -0
- package/dist/isDarkMode/index.js +2 -0
- package/dist/isDarkMode/isDarkMode.svelte.d.ts +2 -0
- package/dist/isDarkMode/isDarkMode.svelte.js +6 -0
- package/dist/maplibre/AttributionControl/AttributionControl.svelte +1 -0
- package/dist/maplibre/GeocoderControl/GeocoderControl.svelte +20 -13
- package/dist/maplibre/Map/Map.svelte +19 -11
- package/dist/maplibre/MapStyle/SWRDataLabDark.d.ts +9 -0
- package/dist/maplibre/MapStyle/SWRDataLabDark.js +118 -0
- package/dist/maplibre/MapStyle/SWRDataLabLight.js +39 -7
- package/dist/maplibre/MapStyle/components/Admin.d.ts +1 -1
- package/dist/maplibre/MapStyle/components/Admin.js +6 -12
- package/dist/maplibre/MapStyle/components/Buildings.d.ts +1 -1
- package/dist/maplibre/MapStyle/components/Buildings.js +12 -13
- package/dist/maplibre/MapStyle/components/Landuse.d.ts +1 -1
- package/dist/maplibre/MapStyle/components/Landuse.js +5 -20
- package/dist/maplibre/MapStyle/components/PlaceLabels.d.ts +1 -1
- package/dist/maplibre/MapStyle/components/PlaceLabels.js +2 -3
- package/dist/maplibre/MapStyle/components/Roads.d.ts +1 -1
- package/dist/maplibre/MapStyle/components/Roads.js +173 -202
- package/dist/maplibre/MapStyle/components/Transit.d.ts +1 -1
- package/dist/maplibre/MapStyle/components/Transit.js +43 -44
- package/dist/maplibre/MapStyle/components/Walking.d.ts +1 -1
- package/dist/maplibre/MapStyle/components/Walking.js +61 -209
- package/dist/maplibre/MapStyle/icons/pin-14-dark.svg +10 -0
- package/dist/maplibre/MapStyle/index.d.ts +2 -1
- package/dist/maplibre/MapStyle/index.js +2 -1
- package/dist/maplibre/MapStyle/sprite/sprite.json +1 -1
- package/dist/maplibre/MapStyle/sprite/sprite.png +0 -0
- package/dist/maplibre/MapStyle/sprite/sprite@2x.json +1 -1
- package/dist/maplibre/MapStyle/sprite/sprite@2x.png +0 -0
- package/dist/maplibre/MapStyle/storyLocations.d.ts +47 -0
- package/dist/maplibre/MapStyle/storyLocations.js +21 -0
- package/dist/maplibre/NavigationControl/NavigationControl.svelte +12 -3
- package/dist/maplibre/ScaleControl/ScaleControl.svelte +1 -0
- package/dist/maplibre/Tooltip/Tooltip.svelte +3 -2
- package/package.json +1 -1
- package/dist/maplibre/Map/test.css +0 -687
- package/dist/maplibre/MapStyle/tokens.d.ts +0 -23
- package/dist/maplibre/MapStyle/tokens.js +0 -23
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script lang="ts">import { shades, semantics } from './Tokens';
|
|
2
|
-
|
|
2
|
+
import isDarkMode from '../isDarkMode';
|
|
3
|
+
let { theme = 'auto', children } = $props();
|
|
4
|
+
let computedTheme = $derived(theme === 'auto' ? ($isDarkMode ? 'dark' : 'light') : theme);
|
|
3
5
|
const colours = { ...shades, ...semantics };
|
|
4
6
|
const rules = [
|
|
5
7
|
...Object.keys(colours).map((key) => {
|
|
@@ -15,7 +17,7 @@ const rules = [
|
|
|
15
17
|
];
|
|
16
18
|
</script>
|
|
17
19
|
|
|
18
|
-
<div class="container" style={rules.join(';')}>
|
|
20
|
+
<div class="container" style={rules.join(';')} data-theme={computedTheme}>
|
|
19
21
|
{#if children}
|
|
20
22
|
{@render children()}
|
|
21
23
|
{/if}
|
|
@@ -40,16 +42,16 @@ const rules = [
|
|
|
40
42
|
--color-logoFill: var(--logoFill-light);
|
|
41
43
|
--color-pageFill: var(--pageFill-light);
|
|
42
44
|
--color-surfaceFill: var(--surfaceFill-light);
|
|
45
|
+
--color-surfaceBorder: var(--surfaceBorder-light);
|
|
43
46
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
47
|
+
.container[data-theme=dark] {
|
|
48
|
+
--color-logoFill: var(--logoFill-dark);
|
|
49
|
+
--color-pageFill: var(--pageFill-dark);
|
|
50
|
+
--color-surfaceFill: var(--surfaceFill-dark);
|
|
51
|
+
--color-surfaceBorder: var(--surfaceBorder-dark);
|
|
52
|
+
--color-textPrimary: var(--textPrimary-dark);
|
|
53
|
+
--color-textSecondary: var(--textSecondary-dark);
|
|
54
|
+
--color-textSecondaryHover: var(--textSecondaryHover-dark);
|
|
53
55
|
}
|
|
54
56
|
.container {
|
|
55
57
|
--swr-text: "SWR-VAR-Text", sans-serif;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as DesignTokens } from "./DesignTokens/DesignTokens.svelte";
|
|
2
2
|
export { tokens } from "./DesignTokens/index.js";
|
|
3
|
+
export { default as isDarkMode } from "./isDarkMode/isDarkMode.svelte";
|
|
3
4
|
export { default as Headline } from "./Headline/Headline.svelte";
|
|
4
5
|
export { default as Copy } from "./Copy/Copy.svelte";
|
|
5
6
|
export { default as Caption } from "./Caption/Caption.svelte";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Design Tokens
|
|
2
2
|
export { default as DesignTokens } from './DesignTokens/DesignTokens.svelte';
|
|
3
3
|
export { tokens as tokens } from './DesignTokens/index.js';
|
|
4
|
+
export { default as isDarkMode } from './isDarkMode/isDarkMode.svelte';
|
|
4
5
|
|
|
5
6
|
// Typography
|
|
6
7
|
export { default as Headline } from './Headline/Headline.svelte';
|
|
@@ -16,6 +16,7 @@ const { position = 'bottom-right', customAttribution } = $props();
|
|
|
16
16
|
letter-spacing: 0.005em;
|
|
17
17
|
word-spacing: 0.005em;
|
|
18
18
|
font-family: var(--swr-sans);
|
|
19
|
+
color: var(--color-textSecondary);
|
|
19
20
|
}
|
|
20
21
|
:global(.maplibregl-ctrl-attrib.maplibregl-compact-show) :global(.maplibregl-ctrl-attrib-inner) {
|
|
21
22
|
display: block;
|
|
@@ -23,19 +23,22 @@ const geocoder = new MaplibreGeocoder(geocoderAPI, {
|
|
|
23
23
|
<MapControl control={geocoder} position="top-left" />
|
|
24
24
|
|
|
25
25
|
<style>:global(.maplibregl-ctrl-geocoder) {
|
|
26
|
-
background-color:
|
|
26
|
+
background-color: var(--color-surfaceFill);
|
|
27
27
|
position: relative;
|
|
28
28
|
width: 100%;
|
|
29
29
|
z-index: 1;
|
|
30
30
|
font-family: var(--swr-sans);
|
|
31
31
|
font-size: var(--fs-small-1);
|
|
32
32
|
border-radius: var(--br-small);
|
|
33
|
-
border: 1px solid
|
|
34
|
-
box-shadow:
|
|
33
|
+
border: 1px solid var(--color-surfaceBorder);
|
|
34
|
+
box-shadow: 2px 2px 1px rgba(0, 0, 0, 0.075);
|
|
35
|
+
}
|
|
36
|
+
:global(.maplibregl-ctrl-geocoder) :global(button) {
|
|
37
|
+
cursor: pointer;
|
|
35
38
|
}
|
|
36
39
|
:global(.maplibre-gl-geocoder--error) {
|
|
37
40
|
font-size: var(--fs-small-2);
|
|
38
|
-
color: var(--
|
|
41
|
+
color: var(--color-textSecondary);
|
|
39
42
|
padding: 0.4em 0.65em;
|
|
40
43
|
}
|
|
41
44
|
:global(.maplibregl-ctrl-geocoder--input) {
|
|
@@ -44,10 +47,10 @@ const geocoder = new MaplibreGeocoder(geocoderAPI, {
|
|
|
44
47
|
font-family: inherit;
|
|
45
48
|
font-size: inherit;
|
|
46
49
|
background-color: transparent;
|
|
47
|
-
color: var(--
|
|
50
|
+
color: var(--color-textPrimary);
|
|
48
51
|
border: 0;
|
|
49
|
-
height: 1.
|
|
50
|
-
padding: 0 1.
|
|
52
|
+
height: 1.95em;
|
|
53
|
+
padding: 0 1.95em;
|
|
51
54
|
padding-top: 0.1em;
|
|
52
55
|
text-overflow: ellipsis;
|
|
53
56
|
white-space: nowrap;
|
|
@@ -55,10 +58,10 @@ const geocoder = new MaplibreGeocoder(geocoderAPI, {
|
|
|
55
58
|
}
|
|
56
59
|
:global(.maplibregl-ctrl-geocoder--input::placeholder) {
|
|
57
60
|
opacity: 1;
|
|
58
|
-
color: var(--
|
|
61
|
+
color: var(--color-textSecondary);
|
|
59
62
|
}
|
|
60
63
|
:global(.maplibregl-ctrl-geocoder--input:focus) {
|
|
61
|
-
color: var(--
|
|
64
|
+
color: var(--color-textPrimary);
|
|
62
65
|
outline: 0;
|
|
63
66
|
}
|
|
64
67
|
:global(.maplibregl-ctrl-geocoder) :global(.maplibregl-ctrl-geocoder--pin-right) > :global(*) {
|
|
@@ -71,7 +74,7 @@ const geocoder = new MaplibreGeocoder(geocoderAPI, {
|
|
|
71
74
|
border: 0;
|
|
72
75
|
}
|
|
73
76
|
:global(.maplibregl-ctrl-geocoder) :global(.suggestions) {
|
|
74
|
-
background:
|
|
77
|
+
background: var(--color-surfaceFill);
|
|
75
78
|
border: 1px solid rgba(0, 0, 0, 0.75);
|
|
76
79
|
box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
|
|
77
80
|
border-radius: var(--br-small);
|
|
@@ -94,14 +97,14 @@ const geocoder = new MaplibreGeocoder(geocoderAPI, {
|
|
|
94
97
|
padding: 0.5em 0.75em;
|
|
95
98
|
color: var(--gray-dark-5);
|
|
96
99
|
padding-bottom: 0.5em;
|
|
97
|
-
border-bottom: 1px solid var(--
|
|
100
|
+
border-bottom: 1px solid var(--color-surfaceBorder);
|
|
98
101
|
}
|
|
99
102
|
:global(.maplibregl-ctrl-geocoder) :global(.suggestions) > :global(li:last-child) > :global(a) {
|
|
100
103
|
border-bottom: 0;
|
|
101
104
|
}
|
|
102
105
|
:global(.maplibregl-ctrl-geocoder) :global(.suggestions) > :global(.active) > :global(a),
|
|
103
106
|
:global(.maplibregl-ctrl-geocoder) :global(.suggestions) > :global(li) > :global(a:hover) {
|
|
104
|
-
background: var(--
|
|
107
|
+
background: var(--color-surfaceHover);
|
|
105
108
|
text-decoration: none;
|
|
106
109
|
cursor: pointer;
|
|
107
110
|
}
|
|
@@ -129,12 +132,13 @@ const geocoder = new MaplibreGeocoder(geocoderAPI, {
|
|
|
129
132
|
display: none;
|
|
130
133
|
}
|
|
131
134
|
:global(.maplibregl-ctrl-geocoder--result-title) {
|
|
135
|
+
color: var(--color-textPrimary);
|
|
132
136
|
font-weight: 600;
|
|
133
137
|
letter-spacing: 0;
|
|
134
138
|
}
|
|
135
139
|
:global(.maplibregl-ctrl-geocoder--result-address) {
|
|
136
140
|
font-size: var(--fs-small-2);
|
|
137
|
-
color: var(--
|
|
141
|
+
color: var(--color-textSecondary);
|
|
138
142
|
line-height: 1.3;
|
|
139
143
|
}
|
|
140
144
|
:global(.maplibregl-ctrl-geocoder--icon) {
|
|
@@ -144,6 +148,9 @@ const geocoder = new MaplibreGeocoder(geocoderAPI, {
|
|
|
144
148
|
transform: translateY(-50%);
|
|
145
149
|
height: 1em;
|
|
146
150
|
}
|
|
151
|
+
:global(.maplibregl-ctrl-geocoder--icon) :global(path) {
|
|
152
|
+
fill: var(--color-textPrimary);
|
|
153
|
+
}
|
|
147
154
|
:global(.maplibregl-ctrl-geocoder--icon-close) {
|
|
148
155
|
right: 0;
|
|
149
156
|
}
|
|
@@ -82,7 +82,7 @@ $effect(() => {
|
|
|
82
82
|
mapContext.map?.scrollZoom.enable();
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
|
-
const debugValues = $derived(Object.entries({
|
|
85
|
+
const debugValues = $derived(Object.entries({ zoom, pitch, allowZoom, allowRotation }));
|
|
86
86
|
const handleDebugValueClick = (e) => {
|
|
87
87
|
if (e.target) {
|
|
88
88
|
const t = e.target;
|
|
@@ -106,10 +106,12 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
106
106
|
{/if}
|
|
107
107
|
{#if showDebug}
|
|
108
108
|
<ul class="debug">
|
|
109
|
+
<li>
|
|
110
|
+
[{center?.lat.toFixed(2)}, {center?.lng.toFixed(2)}]
|
|
111
|
+
</li>
|
|
109
112
|
{#each debugValues as [key, value]}
|
|
110
113
|
<li>
|
|
111
|
-
{key}
|
|
112
|
-
<button onclick={handleDebugValueClick}
|
|
114
|
+
{key}=<button onclick={handleDebugValueClick}
|
|
113
115
|
>{value?.toLocaleString('en', { maximumSignificantDigits: 6 })}</button
|
|
114
116
|
>
|
|
115
117
|
</li>
|
|
@@ -128,11 +130,14 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
128
130
|
position: absolute;
|
|
129
131
|
top: 0;
|
|
130
132
|
right: 0;
|
|
131
|
-
background: rgba(0, 0, 0, 0.
|
|
133
|
+
background: rgba(0, 0, 0, 0.75);
|
|
132
134
|
color: white;
|
|
133
135
|
z-index: 1000;
|
|
134
136
|
padding: 2px;
|
|
137
|
+
font-size: 10px;
|
|
135
138
|
font-family: monospace;
|
|
139
|
+
display: flex;
|
|
140
|
+
gap: 1em;
|
|
136
141
|
}
|
|
137
142
|
.debug li {
|
|
138
143
|
list-style: none;
|
|
@@ -142,7 +147,9 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
142
147
|
background: transparent;
|
|
143
148
|
font-family: inherit;
|
|
144
149
|
color: inherit;
|
|
150
|
+
font-size: inherit;
|
|
145
151
|
border: 0;
|
|
152
|
+
text-transform: uppercase;
|
|
146
153
|
cursor: pointer;
|
|
147
154
|
}
|
|
148
155
|
.debug button:hover, .debug button:focus-visible {
|
|
@@ -216,14 +223,15 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
216
223
|
transform: translate(0);
|
|
217
224
|
}
|
|
218
225
|
:global(.maplibregl-ctrl-group) {
|
|
219
|
-
background:
|
|
220
|
-
border: 1px solid
|
|
226
|
+
background: var(--color-surfaceFill);
|
|
227
|
+
border: 1px solid var(--color-surfaceBorder);
|
|
221
228
|
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.075);
|
|
222
229
|
border-radius: var(--br-small);
|
|
223
230
|
overflow: hidden;
|
|
224
231
|
}
|
|
225
232
|
:global(.maplibregl-ctrl-group) :global(button) {
|
|
226
233
|
background-color: transparent;
|
|
234
|
+
color: var(--color-textPrimary);
|
|
227
235
|
border: 0;
|
|
228
236
|
box-sizing: border-box;
|
|
229
237
|
cursor: pointer;
|
|
@@ -234,7 +242,7 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
234
242
|
width: 29px;
|
|
235
243
|
}
|
|
236
244
|
:global(.maplibregl-ctrl-group) :global(button) + :global(button) {
|
|
237
|
-
border-top: 1px solid
|
|
245
|
+
border-top: 1px solid var(--color-surfaceBorder);
|
|
238
246
|
}
|
|
239
247
|
:global(.maplibregl-ctrl) :global(button) :global(.maplibregl-ctrl-icon) {
|
|
240
248
|
background-position: 50%;
|
|
@@ -250,7 +258,7 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
250
258
|
opacity: 0.5;
|
|
251
259
|
}
|
|
252
260
|
:global(.maplibregl-ctrl) :global(button:not(:disabled):hover) {
|
|
253
|
-
background-color: var(--
|
|
261
|
+
background-color: var(--color-surfaceHover);
|
|
254
262
|
}
|
|
255
263
|
:global(.maplibregl-ctrl-group) :global(button:focus:focus-visible) {
|
|
256
264
|
box-shadow: 0 0 2px 2px #0096ff;
|
|
@@ -259,10 +267,10 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
259
267
|
box-shadow: none;
|
|
260
268
|
}
|
|
261
269
|
:global(.maplibregl-ctrl-group) :global(button:focus:first-child) {
|
|
262
|
-
border-radius:
|
|
270
|
+
border-radius: 2px 2px 0 0;
|
|
263
271
|
}
|
|
264
272
|
:global(.maplibregl-ctrl-group) :global(button:focus:last-child) {
|
|
265
|
-
border-radius: 0 0
|
|
273
|
+
border-radius: 0 0 2px 2px;
|
|
266
274
|
}
|
|
267
275
|
:global(.maplibregl-ctrl-group) :global(button:focus:only-child) {
|
|
268
276
|
border-radius: inherit;
|
|
@@ -274,7 +282,7 @@ const handleDebugCopyLocationClick = (e) => {
|
|
|
274
282
|
will-change: transform;
|
|
275
283
|
}
|
|
276
284
|
:global(.maplibregl-marker) :global(path) {
|
|
277
|
-
fill: var(--
|
|
285
|
+
fill: var(--color-textPrimary);
|
|
278
286
|
}
|
|
279
287
|
:global(.maplibregl-cooperative-gesture-screen) {
|
|
280
288
|
align-items: center;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { StyleSpecification } from 'maplibre-gl';
|
|
2
|
+
interface StyleOptions {
|
|
3
|
+
enableBuildingExtrusions?: boolean;
|
|
4
|
+
}
|
|
5
|
+
interface styleFunction {
|
|
6
|
+
(options?: StyleOptions): StyleSpecification;
|
|
7
|
+
}
|
|
8
|
+
declare const style: styleFunction;
|
|
9
|
+
export default style;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import makeAdmin from './components/Admin';
|
|
2
|
+
import makeBuildings from './components/Buildings';
|
|
3
|
+
import makeLanduse from './components/Landuse';
|
|
4
|
+
import makeTransit from './components/Transit';
|
|
5
|
+
import makePlaceLabels from './components/PlaceLabels';
|
|
6
|
+
import makeWalking from './components/Walking';
|
|
7
|
+
import makeRoads from './components/Roads';
|
|
8
|
+
const tokens = {
|
|
9
|
+
sans_regular: ['SWR Sans Regular'],
|
|
10
|
+
sans_medium: ['SWR Sans Medium'],
|
|
11
|
+
sans_bold: ['SWR Sans Bold'],
|
|
12
|
+
background: {
|
|
13
|
+
stops: [
|
|
14
|
+
[8, 'hsl(210, 9%, 13%)'],
|
|
15
|
+
[10, '#1e1f22']
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
water: 'hsl(210, 12%, 8%)',
|
|
19
|
+
water_light: 'hsl(210, 12%, 8%)',
|
|
20
|
+
water_ocean: 'hsl(210, 12%, 8%)',
|
|
21
|
+
marsh: 'hsl(180, 3%, 35%)',
|
|
22
|
+
grass: 'hsl(170, 20%, 14%)',
|
|
23
|
+
grass_dark: 'hsl(170, 16%, 12%)',
|
|
24
|
+
street_primary: 'hsl(220, 3%, 20%)',
|
|
25
|
+
street_primary_case: 'hsl(0, 11%, 7%)',
|
|
26
|
+
street_secondary: 'hsl(0, 0%, 22%)',
|
|
27
|
+
street_secondary_case: 'hsl(0, 0%, 0%)',
|
|
28
|
+
street_tertiary: 'hsl(0, 0%, 20%)',
|
|
29
|
+
street_tertiary_case: 'hsl(0, 0%, 14%)',
|
|
30
|
+
label_primary: 'hsl(240, 5%, 82%)',
|
|
31
|
+
label_secondary: 'hsl(0, 2%, 72%)',
|
|
32
|
+
label_tertiary: 'hsl(0, 1%, 55%)',
|
|
33
|
+
boundary_country: '#6e6f71',
|
|
34
|
+
boundary_country_case: '#181818',
|
|
35
|
+
boundary_state: 'hsl(218, 4%, 37%)',
|
|
36
|
+
rail: 'hsl(0, 0%, 33%)',
|
|
37
|
+
sand: 'hsl(0, 0%, 16%)',
|
|
38
|
+
building: '#232325'
|
|
39
|
+
};
|
|
40
|
+
const { landuse } = makeLanduse(tokens);
|
|
41
|
+
const { placeLabels, boundaryLabels } = makePlaceLabels(tokens);
|
|
42
|
+
const { admin } = makeAdmin(tokens);
|
|
43
|
+
const { airports, transitBridges, transitSurface, transitTunnels } = makeTransit(tokens);
|
|
44
|
+
const { walkingLabels, walkingTunnels, walkingSurface, walkingBridges } = makeWalking(tokens);
|
|
45
|
+
const { roadLabels, roadBridges, roadSurface, roadTunnels } = makeRoads(tokens);
|
|
46
|
+
const { buildingFootprints, buildingExtrusions, structureExtrusions } = makeBuildings(tokens);
|
|
47
|
+
const style = (opts) => {
|
|
48
|
+
const options = {
|
|
49
|
+
enableBuildingExtrusions: false,
|
|
50
|
+
...opts
|
|
51
|
+
};
|
|
52
|
+
return {
|
|
53
|
+
version: 8,
|
|
54
|
+
name: 'swr-datalab-dark',
|
|
55
|
+
metadata: { license: 'https://creativecommons.org/publicdomain/zero/1.0/' },
|
|
56
|
+
glyphs: 'https://static.datenhub.net/maps/fonts/{fontstack}/{range}.pbf',
|
|
57
|
+
sprite: 'https://static.datenhub.net/maps/styles/swr-datalab-light/sprite/sprite',
|
|
58
|
+
sources: {
|
|
59
|
+
'versatiles-osm': {
|
|
60
|
+
attribution: '<a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
|
|
61
|
+
tiles: ['https://tiles.versatiles.org/tiles/osm/{z}/{x}/{y}'],
|
|
62
|
+
bounds: [-180, -85.0511287798066, 180, 85.0511287798066],
|
|
63
|
+
type: 'vector',
|
|
64
|
+
scheme: 'xyz',
|
|
65
|
+
minzoom: 0,
|
|
66
|
+
maxzoom: 14
|
|
67
|
+
},
|
|
68
|
+
...(options.enableBuildingExtrusions && {
|
|
69
|
+
'basemap-de': {
|
|
70
|
+
attribution: 'GeoBasis-DE',
|
|
71
|
+
type: 'vector',
|
|
72
|
+
bounds: [5.8, 47.2, 15.1, 55.1],
|
|
73
|
+
maxzoom: 15,
|
|
74
|
+
minzoom: 0,
|
|
75
|
+
scheme: 'xyz',
|
|
76
|
+
tiles: [
|
|
77
|
+
'https://sgx.geodatenzentrum.de/gdz_basemapde_vektor/tiles/v2/bm_web_de_3857/{z}/{x}/{y}.pbf'
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
})
|
|
81
|
+
},
|
|
82
|
+
sky: {
|
|
83
|
+
'atmosphere-blend': ['interpolate', ['linear'], ['zoom'], 0, 0.1, 5, 0.1, 7, 0]
|
|
84
|
+
},
|
|
85
|
+
light: { anchor: 'viewport', color: 'white', intensity: 0.5 },
|
|
86
|
+
layers: [
|
|
87
|
+
// 1. Landuse
|
|
88
|
+
...landuse,
|
|
89
|
+
...airports,
|
|
90
|
+
// 2. Building footprints + Structures (ie. bridges)
|
|
91
|
+
...(!options.enableBuildingExtrusions ? [buildingFootprints] : []),
|
|
92
|
+
...(options.enableBuildingExtrusions ? [structureExtrusions] : []),
|
|
93
|
+
// 3. Tunnels
|
|
94
|
+
...walkingTunnels,
|
|
95
|
+
...roadTunnels,
|
|
96
|
+
...transitTunnels,
|
|
97
|
+
// 4. Surface ways
|
|
98
|
+
...walkingSurface,
|
|
99
|
+
...roadSurface,
|
|
100
|
+
...transitSurface,
|
|
101
|
+
// 5. Bridges ways
|
|
102
|
+
...walkingBridges,
|
|
103
|
+
...roadBridges,
|
|
104
|
+
...transitBridges,
|
|
105
|
+
// 6. Admin boundaries
|
|
106
|
+
...admin,
|
|
107
|
+
// 7. Labels
|
|
108
|
+
...walkingLabels,
|
|
109
|
+
...roadLabels,
|
|
110
|
+
// 8. Building extrusions
|
|
111
|
+
...(options.enableBuildingExtrusions ? [buildingExtrusions] : []),
|
|
112
|
+
// 8. Point labels
|
|
113
|
+
...placeLabels,
|
|
114
|
+
...boundaryLabels
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
export default style;
|
|
@@ -5,13 +5,45 @@ import makeTransit from './components/Transit';
|
|
|
5
5
|
import makePlaceLabels from './components/PlaceLabels';
|
|
6
6
|
import makeWalking from './components/Walking';
|
|
7
7
|
import makeRoads from './components/Roads';
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
const tokens = {
|
|
9
|
+
sans_regular: ['SWR Sans Regular'],
|
|
10
|
+
sans_medium: ['SWR Sans Medium'],
|
|
11
|
+
sans_bold: ['SWR Sans Bold'],
|
|
12
|
+
background: {
|
|
13
|
+
stops: [
|
|
14
|
+
[8, 'hsl(24, 29%, 98.5%)'],
|
|
15
|
+
[10, 'white']
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
water: 'hsl(210, 71%, 83%)',
|
|
19
|
+
water_light: 'hsl(210, 41%, 90%)',
|
|
20
|
+
water_ocean: 'hsl(209, 57%, 84%)',
|
|
21
|
+
marsh: 'hsl(200, 14%, 97%)',
|
|
22
|
+
grass: 'hsl(133, 36%, 95%)',
|
|
23
|
+
grass_dark: 'hsl(127, 49%, 93%)',
|
|
24
|
+
street_primary: 'hsl(0, 4%, 95%)',
|
|
25
|
+
street_primary_case: 'hsl(240, 1%, 84%)',
|
|
26
|
+
street_secondary: 'hsl(0, 0%, 95%)',
|
|
27
|
+
street_secondary_case: 'hsl(0, 0%, 75%)',
|
|
28
|
+
street_tertiary: 'hsl(0, 0%, 95%)',
|
|
29
|
+
street_tertiary_case: 'hsl(0, 0%, 70%)',
|
|
30
|
+
label_primary: 'hsl(240, 10%, 2%)',
|
|
31
|
+
label_secondary: 'hsl(0, 0%, 18%)',
|
|
32
|
+
label_tertiary: 'hsl(60, 1%, 50%)',
|
|
33
|
+
building: '#f3f2f1',
|
|
34
|
+
rail: '#d3d3d3',
|
|
35
|
+
sand: 'hsl(60,0%,95%)',
|
|
36
|
+
boundary_country: '#8b8a89',
|
|
37
|
+
boundary_state: 'hsl(37, 10%, 75%)',
|
|
38
|
+
boundary_country_case: 'white'
|
|
39
|
+
};
|
|
40
|
+
const { landuse } = makeLanduse(tokens);
|
|
41
|
+
const { placeLabels, boundaryLabels } = makePlaceLabels(tokens);
|
|
42
|
+
const { admin } = makeAdmin(tokens);
|
|
43
|
+
const { airports, transitBridges, transitSurface, transitTunnels } = makeTransit(tokens);
|
|
44
|
+
const { walkingLabels, walkingTunnels, walkingSurface, walkingBridges } = makeWalking(tokens);
|
|
45
|
+
const { roadLabels, roadBridges, roadSurface, roadTunnels } = makeRoads(tokens);
|
|
46
|
+
const { buildingFootprints, buildingExtrusions, structureExtrusions } = makeBuildings(tokens);
|
|
15
47
|
const style = (opts) => {
|
|
16
48
|
const options = {
|
|
17
49
|
enableBuildingExtrusions: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function makeAdmin(): any;
|
|
1
|
+
export default function makeAdmin(tokens: any): any;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import tokens from '../tokens';
|
|
2
1
|
import {} from '../../types';
|
|
3
|
-
export default function makeAdmin() {
|
|
2
|
+
export default function makeAdmin(tokens) {
|
|
4
3
|
const admin = [
|
|
5
4
|
{
|
|
6
5
|
id: 'boundary-country:case',
|
|
@@ -12,7 +11,7 @@ export default function makeAdmin() {
|
|
|
12
11
|
['!=', 'coastline', true]
|
|
13
12
|
],
|
|
14
13
|
paint: {
|
|
15
|
-
'line-color':
|
|
14
|
+
'line-color': tokens.boundary_country_case,
|
|
16
15
|
'line-blur': 1,
|
|
17
16
|
'line-width': {
|
|
18
17
|
stops: [
|
|
@@ -55,7 +54,7 @@ export default function makeAdmin() {
|
|
|
55
54
|
['!=', 'coastline', true]
|
|
56
55
|
],
|
|
57
56
|
paint: {
|
|
58
|
-
'line-color':
|
|
57
|
+
'line-color': tokens.boundary_country_case,
|
|
59
58
|
'line-blur': 1,
|
|
60
59
|
'line-width': {
|
|
61
60
|
stops: [
|
|
@@ -77,12 +76,7 @@ export default function makeAdmin() {
|
|
|
77
76
|
['!=', 'coastline', true]
|
|
78
77
|
],
|
|
79
78
|
paint: {
|
|
80
|
-
'line-color':
|
|
81
|
-
stops: [
|
|
82
|
-
[7, '#a5a5a5'],
|
|
83
|
-
[10, '#3f3b39']
|
|
84
|
-
]
|
|
85
|
-
},
|
|
79
|
+
'line-color': tokens.boundary_country,
|
|
86
80
|
'line-width': {
|
|
87
81
|
stops: [
|
|
88
82
|
[2, 0],
|
|
@@ -110,7 +104,7 @@ export default function makeAdmin() {
|
|
|
110
104
|
[10, 4]
|
|
111
105
|
]
|
|
112
106
|
},
|
|
113
|
-
'line-color':
|
|
107
|
+
'line-color': tokens.boundary_country,
|
|
114
108
|
'line-dasharray': [2, 1]
|
|
115
109
|
}
|
|
116
110
|
},
|
|
@@ -124,7 +118,7 @@ export default function makeAdmin() {
|
|
|
124
118
|
['!=', 'coastline', true]
|
|
125
119
|
],
|
|
126
120
|
paint: {
|
|
127
|
-
'line-color':
|
|
121
|
+
'line-color': tokens.boundary_state,
|
|
128
122
|
'line-width': {
|
|
129
123
|
stops: [
|
|
130
124
|
[7, 1],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function makeBuildings(): any;
|
|
1
|
+
export default function makeBuildings(tokens: any): any;
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import {} from '../../types';
|
|
2
|
-
|
|
3
|
-
const extrusionLayer = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
14
|
-
export default function makeBuildings() {
|
|
2
|
+
export default function makeBuildings(tokens) {
|
|
3
|
+
const extrusionLayer = {
|
|
4
|
+
source: 'basemap-de',
|
|
5
|
+
type: 'fill-extrusion',
|
|
6
|
+
minzoom: 14,
|
|
7
|
+
maxzoom: 20,
|
|
8
|
+
paint: {
|
|
9
|
+
'fill-extrusion-color': tokens.building,
|
|
10
|
+
'fill-extrusion-opacity': ['interpolate', ['linear'], ['zoom'], 14.5, 0, 15, 1],
|
|
11
|
+
'fill-extrusion-height': ['interpolate', ['linear'], ['zoom'], 14.5, 0, 15, ['get', 'hoehe']]
|
|
12
|
+
}
|
|
13
|
+
};
|
|
15
14
|
const buildingFootprints = {
|
|
16
15
|
id: 'building-footprints',
|
|
17
16
|
type: 'fill',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function makeLanduse(): any;
|
|
1
|
+
export default function makeLanduse(tokens: any): any;
|
|
@@ -1,17 +1,11 @@
|
|
|
1
|
-
import tokens from '../tokens';
|
|
2
1
|
import {} from '../../types';
|
|
3
|
-
export default function makeLanduse() {
|
|
2
|
+
export default function makeLanduse(tokens) {
|
|
4
3
|
const landuse = [
|
|
5
4
|
{
|
|
6
5
|
id: 'background',
|
|
7
6
|
type: 'background',
|
|
8
7
|
paint: {
|
|
9
|
-
'background-color':
|
|
10
|
-
stops: [
|
|
11
|
-
[8, tokens.background],
|
|
12
|
-
[10, 'white']
|
|
13
|
-
]
|
|
14
|
-
}
|
|
8
|
+
'background-color': tokens.background
|
|
15
9
|
}
|
|
16
10
|
},
|
|
17
11
|
{
|
|
@@ -22,15 +16,6 @@ export default function makeLanduse() {
|
|
|
22
16
|
'fill-color': tokens.water_ocean
|
|
23
17
|
}
|
|
24
18
|
},
|
|
25
|
-
{
|
|
26
|
-
id: 'land-glacier',
|
|
27
|
-
type: 'fill',
|
|
28
|
-
'source-layer': 'water_polygons',
|
|
29
|
-
filter: ['all', ['==', 'kind', 'glacier']],
|
|
30
|
-
paint: {
|
|
31
|
-
'fill-color': 'hsl(0,0%,100%)'
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
19
|
{
|
|
35
20
|
id: 'land-agriculture',
|
|
36
21
|
type: 'fill',
|
|
@@ -66,7 +51,7 @@ export default function makeLanduse() {
|
|
|
66
51
|
'source-layer': 'land',
|
|
67
52
|
filter: ['all', ['in', 'kind', 'landfill']],
|
|
68
53
|
paint: {
|
|
69
|
-
'fill-color':
|
|
54
|
+
'fill-color': tokens.sand,
|
|
70
55
|
'fill-opacity': {
|
|
71
56
|
stops: [
|
|
72
57
|
[10, 0],
|
|
@@ -163,9 +148,9 @@ export default function makeLanduse() {
|
|
|
163
148
|
id: 'land-sand',
|
|
164
149
|
type: 'fill',
|
|
165
150
|
'source-layer': 'land',
|
|
166
|
-
filter: ['all', ['in', 'kind', 'beach', 'sand']],
|
|
151
|
+
filter: ['all', ['in', 'kind', 'beach', 'sand', 'scree']],
|
|
167
152
|
paint: {
|
|
168
|
-
'fill-color':
|
|
153
|
+
'fill-color': tokens.sand
|
|
169
154
|
}
|
|
170
155
|
},
|
|
171
156
|
{
|