@fusion.dev/helix-map 0.0.0-dev
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/LICENSE +21 -0
- package/README.md +66 -0
- package/dist/connect-map/connect-map.d.ts +317 -0
- package/dist/connect-map/connect-map.d.ts.map +1 -0
- package/dist/connect-map/connect-map.js +847 -0
- package/dist/connect-map/connect-map.js.map +1 -0
- package/dist/connect-map/index.d.ts +3 -0
- package/dist/connect-map/index.d.ts.map +1 -0
- package/dist/connect-map/index.js +2 -0
- package/dist/connect-map/index.js.map +1 -0
- package/dist/contours/contours.d.ts +71 -0
- package/dist/contours/contours.d.ts.map +1 -0
- package/dist/contours/contours.js +314 -0
- package/dist/contours/contours.js.map +1 -0
- package/dist/credit/credit.d.ts +20 -0
- package/dist/credit/credit.d.ts.map +1 -0
- package/dist/credit/credit.js +65 -0
- package/dist/credit/credit.js.map +1 -0
- package/dist/credit/index.d.ts +3 -0
- package/dist/credit/index.d.ts.map +1 -0
- package/dist/credit/index.js +2 -0
- package/dist/credit/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/leaflet/index.d.ts +3 -0
- package/dist/leaflet/index.d.ts.map +1 -0
- package/dist/leaflet/index.js +2 -0
- package/dist/leaflet/index.js.map +1 -0
- package/dist/leaflet/leaflet-driver.d.ts +126 -0
- package/dist/leaflet/leaflet-driver.d.ts.map +1 -0
- package/dist/leaflet/leaflet-driver.js +241 -0
- package/dist/leaflet/leaflet-driver.js.map +1 -0
- package/dist/maplibre/index.d.ts +5 -0
- package/dist/maplibre/index.d.ts.map +1 -0
- package/dist/maplibre/index.js +3 -0
- package/dist/maplibre/index.js.map +1 -0
- package/dist/maplibre/map-images.d.ts +17 -0
- package/dist/maplibre/map-images.d.ts.map +1 -0
- package/dist/maplibre/map-images.js +138 -0
- package/dist/maplibre/map-images.js.map +1 -0
- package/dist/maplibre/maplibre-driver.d.ts +276 -0
- package/dist/maplibre/maplibre-driver.d.ts.map +1 -0
- package/dist/maplibre/maplibre-driver.js +1114 -0
- package/dist/maplibre/maplibre-driver.js.map +1 -0
- package/dist/motion/index.d.ts +3 -0
- package/dist/motion/index.d.ts.map +1 -0
- package/dist/motion/index.js +2 -0
- package/dist/motion/index.js.map +1 -0
- package/dist/motion/motion.d.ts +41 -0
- package/dist/motion/motion.d.ts.map +1 -0
- package/dist/motion/motion.js +167 -0
- package/dist/motion/motion.js.map +1 -0
- package/dist/points/index.d.ts +3 -0
- package/dist/points/index.d.ts.map +1 -0
- package/dist/points/index.js +2 -0
- package/dist/points/index.js.map +1 -0
- package/dist/points/points.d.ts +20 -0
- package/dist/points/points.d.ts.map +1 -0
- package/dist/points/points.js +41 -0
- package/dist/points/points.js.map +1 -0
- package/dist/snapshot/camera.d.ts +44 -0
- package/dist/snapshot/camera.d.ts.map +1 -0
- package/dist/snapshot/camera.js +42 -0
- package/dist/snapshot/camera.js.map +1 -0
- package/dist/snapshot/index.d.ts +5 -0
- package/dist/snapshot/index.d.ts.map +1 -0
- package/dist/snapshot/index.js +3 -0
- package/dist/snapshot/index.js.map +1 -0
- package/dist/snapshot/snapshot.d.ts +75 -0
- package/dist/snapshot/snapshot.d.ts.map +1 -0
- package/dist/snapshot/snapshot.js +290 -0
- package/dist/snapshot/snapshot.js.map +1 -0
- package/dist/style/index.d.ts +5 -0
- package/dist/style/index.d.ts.map +1 -0
- package/dist/style/index.js +3 -0
- package/dist/style/index.js.map +1 -0
- package/dist/style/map-colors.d.ts +69 -0
- package/dist/style/map-colors.d.ts.map +1 -0
- package/dist/style/map-colors.js +82 -0
- package/dist/style/map-colors.js.map +1 -0
- package/dist/style/map-style.d.ts +99 -0
- package/dist/style/map-style.d.ts.map +1 -0
- package/dist/style/map-style.js +440 -0
- package/dist/style/map-style.js.map +1 -0
- package/dist/style/oklab.d.ts +36 -0
- package/dist/style/oklab.d.ts.map +1 -0
- package/dist/style/oklab.js +76 -0
- package/dist/style/oklab.js.map +1 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +2 -0
- package/dist/theme/index.js.map +1 -0
- package/dist/theme/watch-theme.d.ts +14 -0
- package/dist/theme/watch-theme.d.ts.map +1 -0
- package/dist/theme/watch-theme.js +30 -0
- package/dist/theme/watch-theme.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { MapColors } from './map-colors.js';
|
|
2
|
+
/** Where the tiles and the type come from, where not OpenFreeMap, and how legible the type is. */
|
|
3
|
+
export interface MapStyleOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The contrast ratio every label clears against the land it is haloed in.
|
|
6
|
+
* 4.5 by default, WCAG's AA for text, and what a theme's contrast target
|
|
7
|
+
* sets: a label that would fall short is drawn nearer the ink until it
|
|
8
|
+
* does not, and one that clears it already keeps its place in the order.
|
|
9
|
+
*/
|
|
10
|
+
contrast?: number | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The typeface labels are drawn in, as one CSS font family the page has
|
|
13
|
+
* loaded, such as what `mapFontFrom` reads from the theme. MapLibre draws
|
|
14
|
+
* the letters in the page from it, so no glyphs are fetched. Absent, the
|
|
15
|
+
* labels are Noto Sans from the glyph server.
|
|
16
|
+
*/
|
|
17
|
+
font?: string | undefined;
|
|
18
|
+
/** The font glyphs, a URL with `{fontstack}` and `{range}` in it, where there is no `font`. */
|
|
19
|
+
glyphs?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Draws the world as a globe when the map is zoomed out, turning into the
|
|
22
|
+
* flat map as it zooms in. `true` by default. Set `false` for a flat map at
|
|
23
|
+
* every zoom, which MapLibre 4 also needs, since it has no globe.
|
|
24
|
+
*/
|
|
25
|
+
globe?: boolean | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The language labels are written in, where the tiles carry it, falling back
|
|
28
|
+
* to the Latin name and then the local one. `en` by default.
|
|
29
|
+
*/
|
|
30
|
+
language?: string | undefined;
|
|
31
|
+
/** A TileJSON URL for vector tiles in the OpenMapTiles schema. */
|
|
32
|
+
tiles?: string | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A MapLibre style, as far as this compiler writes one. Typed here rather than
|
|
36
|
+
* imported, so this package still depends on no renderer; MapLibre's own
|
|
37
|
+
* `StyleSpecification` accepts it.
|
|
38
|
+
*/
|
|
39
|
+
export interface MapLibreStyle {
|
|
40
|
+
glyphs?: string;
|
|
41
|
+
/**
|
|
42
|
+
* What the driver draws for each image the layers name: a landmark's icon
|
|
43
|
+
* on a disc in its color, and a highway's sign. `helix:images`, by id.
|
|
44
|
+
*/
|
|
45
|
+
metadata: {
|
|
46
|
+
'helix:images': Record<string, MapImage>;
|
|
47
|
+
};
|
|
48
|
+
layers: Array<Record<string, unknown>>;
|
|
49
|
+
name: string;
|
|
50
|
+
/** How the world is drawn: a globe, unless the style is asked for a flat map. */
|
|
51
|
+
projection?: {
|
|
52
|
+
type: 'globe';
|
|
53
|
+
};
|
|
54
|
+
/** The sky over the horizon and the atmosphere round a globe. */
|
|
55
|
+
sky?: Record<string, unknown>;
|
|
56
|
+
sources: Record<string, Record<string, unknown>>;
|
|
57
|
+
version: 8;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* An image a style names and the driver draws when the map asks for it:
|
|
61
|
+
* a landmark's icon on a disc, or a highway sign of a shape for its network.
|
|
62
|
+
*/
|
|
63
|
+
export type MapImage = {
|
|
64
|
+
color: string;
|
|
65
|
+
icon: {
|
|
66
|
+
content: string;
|
|
67
|
+
viewBox: string;
|
|
68
|
+
};
|
|
69
|
+
ink: string;
|
|
70
|
+
kind: 'landmark';
|
|
71
|
+
} | {
|
|
72
|
+
design: 'interstate' | 'plate' | 'state' | 'us';
|
|
73
|
+
edge?: string | undefined;
|
|
74
|
+
fill?: string | undefined;
|
|
75
|
+
/** The CSS font family the number is drawn in, at bold. */
|
|
76
|
+
font: string;
|
|
77
|
+
/** The number's color. */
|
|
78
|
+
ink: string;
|
|
79
|
+
kind: 'sign';
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* A MapLibre style in the page's theme.
|
|
83
|
+
*
|
|
84
|
+
* **Everything is the land moved toward something else**, in OKLab: the
|
|
85
|
+
* water toward `info`, the parks toward `success`, the motorways and major
|
|
86
|
+
* roads toward the brand, and the smaller roads, buildings, borders and labels
|
|
87
|
+
* toward the ink by how much each has to be seen. So the same colors draw a
|
|
88
|
+
* light map on a light theme and a dark map on a dark one, and a brand that
|
|
89
|
+
* moves the palette moves the map with it. Only the
|
|
90
|
+
* labels reach most of the way to the ink, since a place name is the one thing
|
|
91
|
+
* on a map somebody reads, and every one is haloed in the land.
|
|
92
|
+
*
|
|
93
|
+
* **The tiles are OpenFreeMap's**, in the OpenMapTiles schema, until Helix
|
|
94
|
+
* serves its own in the same schema, which is why it is the schema this is
|
|
95
|
+
* written against. Their credit arrives in the source's TileJSON, where
|
|
96
|
+
* `connectMap` reads it.
|
|
97
|
+
*/
|
|
98
|
+
export declare const mapLibreStyle: (colors: MapColors, options?: MapStyleOptions) => MapLibreStyle;
|
|
99
|
+
//# sourceMappingURL=map-style.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-style.d.ts","sourceRoot":"","sources":["../../src/style/map-style.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAGhD,kGAAkG;AAClG,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,+FAA+F;IAC/F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS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,CAAA;CACb,CAAA;AAgGL;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa,WAAY,SAAS,YAAW,eAAe,KAAQ,aA+ehF,CAAA"}
|
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { bed, firstAid, forkKnife, graduationCap, shoppingBag, star, train, tree, trophy, } from '@fusion.dev/helix-icons';
|
|
2
|
+
import { contrast, cssColor, mix, parseColor, rehue } from './oklab.js';
|
|
3
|
+
const OPENFREEMAP = {
|
|
4
|
+
glyphs: 'https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf',
|
|
5
|
+
tiles: 'https://tiles.openfreemap.org/planet',
|
|
6
|
+
};
|
|
7
|
+
const LANDMARKS = [
|
|
8
|
+
{
|
|
9
|
+
classes: ['park', 'garden', 'playground', 'campsite', 'golf', 'zoo'],
|
|
10
|
+
group: 'nature',
|
|
11
|
+
hue: 145,
|
|
12
|
+
icon: tree,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
classes: ['museum', 'art_gallery', 'theatre', 'cinema', 'castle', 'monument', 'attraction'],
|
|
16
|
+
group: 'culture',
|
|
17
|
+
hue: 350,
|
|
18
|
+
icon: star,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
classes: ['college', 'school', 'university', 'library'],
|
|
22
|
+
group: 'learning',
|
|
23
|
+
hue: 65,
|
|
24
|
+
icon: graduationCap,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
classes: ['restaurant', 'fast_food', 'cafe', 'bar', 'pub', 'beer', 'ice_cream', 'bakery'],
|
|
28
|
+
everyday: true,
|
|
29
|
+
group: 'food',
|
|
30
|
+
hue: 45,
|
|
31
|
+
icon: forkKnife,
|
|
32
|
+
},
|
|
33
|
+
{ classes: ['lodging'], group: 'lodging', hue: 300, icon: bed },
|
|
34
|
+
{
|
|
35
|
+
classes: ['hospital', 'pharmacy', 'doctors', 'dentist'],
|
|
36
|
+
group: 'health',
|
|
37
|
+
hue: 20,
|
|
38
|
+
icon: firstAid,
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
classes: ['railway', 'ferry_terminal', 'aerialway'],
|
|
42
|
+
group: 'transit',
|
|
43
|
+
hue: 245,
|
|
44
|
+
icon: train,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
classes: ['shop', 'grocery', 'clothing_store', 'alcohol_shop'],
|
|
48
|
+
everyday: true,
|
|
49
|
+
group: 'shopping',
|
|
50
|
+
hue: 85,
|
|
51
|
+
icon: shoppingBag,
|
|
52
|
+
},
|
|
53
|
+
{ classes: ['stadium', 'pitch', 'swimming'], group: 'sport', hue: 190, icon: trophy },
|
|
54
|
+
];
|
|
55
|
+
const SIGNS = {
|
|
56
|
+
'us-highway': 'us',
|
|
57
|
+
'us-interstate': 'interstate',
|
|
58
|
+
'us-state': 'state',
|
|
59
|
+
};
|
|
60
|
+
const idOf = (color) => color.replace(/[^0-9a-z]/gi, '');
|
|
61
|
+
const widen = (from, to) => [
|
|
62
|
+
'interpolate',
|
|
63
|
+
['exponential', 1.5],
|
|
64
|
+
['zoom'],
|
|
65
|
+
from[0],
|
|
66
|
+
from[1],
|
|
67
|
+
to[0],
|
|
68
|
+
to[1],
|
|
69
|
+
];
|
|
70
|
+
const lines = ['match', ['geometry-type'], ['LineString', 'MultiLineString'], true, false];
|
|
71
|
+
const shapes = ['match', ['geometry-type'], ['Polygon', 'MultiPolygon'], true, false];
|
|
72
|
+
const notTunnel = ['!=', ['get', 'brunnel'], 'tunnel'];
|
|
73
|
+
export const mapLibreStyle = (colors, options = {}) => {
|
|
74
|
+
const need = (name) => {
|
|
75
|
+
const parsed = parseColor(colors[name]);
|
|
76
|
+
if (!parsed) {
|
|
77
|
+
throw new Error(`mapLibreStyle: \`${name}\` is \`${colors[name]}\`, and a map style takes #hex, rgb() or rgba(). mapColorsFrom() resolves a page's tokens to those.`);
|
|
78
|
+
}
|
|
79
|
+
return parsed;
|
|
80
|
+
};
|
|
81
|
+
const land = need('surface');
|
|
82
|
+
const ink = need('foreground');
|
|
83
|
+
const toward = (amount) => cssColor(mix(land, ink, amount));
|
|
84
|
+
const brand = need('primary');
|
|
85
|
+
const branded = (amount) => cssColor(mix(land, brand, amount));
|
|
86
|
+
const water = mix(land, need('info'), 0.3);
|
|
87
|
+
const green = mix(land, need('success'), 0.16);
|
|
88
|
+
const language = options.language ?? 'en';
|
|
89
|
+
const name = ['coalesce', ['get', `name:${language}`], ['get', 'name:latin'], ['get', 'name']];
|
|
90
|
+
const halo = cssColor(land);
|
|
91
|
+
const target = options.contrast ?? 4.5;
|
|
92
|
+
const face = options.font;
|
|
93
|
+
const REGULAR = face ? [face] : ['Noto Sans Regular'];
|
|
94
|
+
const MEDIUM = face ? [`${face} Medium`, face] : ['Noto Sans Regular'];
|
|
95
|
+
const BOLD = face ? [`${face} Bold`, face] : ['Noto Sans Bold'];
|
|
96
|
+
const ITALIC = face ? [`${face} Italic`, face] : ['Noto Sans Italic'];
|
|
97
|
+
const glyphs = face ? options.glyphs : (options.glyphs ?? OPENFREEMAP.glyphs);
|
|
98
|
+
const legible = (from, amount) => {
|
|
99
|
+
const at = (step) => parseColor(cssColor(mix(from, ink, step)));
|
|
100
|
+
if (contrast(at(amount), land) >= target) {
|
|
101
|
+
return cssColor(at(amount));
|
|
102
|
+
}
|
|
103
|
+
if (contrast(ink, land) < target) {
|
|
104
|
+
return cssColor(ink);
|
|
105
|
+
}
|
|
106
|
+
let low = amount;
|
|
107
|
+
let high = 1;
|
|
108
|
+
for (let round = 0; round < 20; round++) {
|
|
109
|
+
const middle = (low + high) / 2;
|
|
110
|
+
if (contrast(at(middle), land) >= target) {
|
|
111
|
+
high = middle;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
low = middle;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return cssColor(at(high));
|
|
118
|
+
};
|
|
119
|
+
const road = (id, classes, color, width, minzoom) => ({
|
|
120
|
+
filter: ['all', lines, notTunnel, ['match', ['get', 'class'], classes, true, false]],
|
|
121
|
+
id,
|
|
122
|
+
layout: { 'line-cap': 'round', 'line-join': 'round' },
|
|
123
|
+
minzoom,
|
|
124
|
+
paint: { 'line-color': color, 'line-width': widen(...width) },
|
|
125
|
+
source: 'openmaptiles',
|
|
126
|
+
'source-layer': 'transportation',
|
|
127
|
+
type: 'line',
|
|
128
|
+
});
|
|
129
|
+
const place = (id, filter, amount, size, font, minzoom) => ({
|
|
130
|
+
filter,
|
|
131
|
+
id,
|
|
132
|
+
layout: {
|
|
133
|
+
'text-field': name,
|
|
134
|
+
'text-font': font,
|
|
135
|
+
'text-max-width': 8,
|
|
136
|
+
'text-size': ['interpolate', ['linear'], ['zoom'], ...size[0], ...size[1]],
|
|
137
|
+
},
|
|
138
|
+
minzoom,
|
|
139
|
+
paint: { 'text-color': legible(land, amount), 'text-halo-color': halo, 'text-halo-width': 1.5 },
|
|
140
|
+
source: 'openmaptiles',
|
|
141
|
+
'source-layer': 'place',
|
|
142
|
+
type: 'symbol',
|
|
143
|
+
});
|
|
144
|
+
const hued = (hue) => rehue(brand, hue);
|
|
145
|
+
const images = {};
|
|
146
|
+
const landmarkImage = ['match', ['get', 'class']];
|
|
147
|
+
const landmarkColor = ['match', ['get', 'class']];
|
|
148
|
+
for (const { classes, group, hue, icon } of LANDMARKS) {
|
|
149
|
+
const color = cssColor(hued(hue));
|
|
150
|
+
const id = `helix-landmark-${group}-${idOf(color)}`;
|
|
151
|
+
images[id] = {
|
|
152
|
+
color,
|
|
153
|
+
icon: { content: icon.content, viewBox: icon.viewBox },
|
|
154
|
+
ink: halo,
|
|
155
|
+
kind: 'landmark',
|
|
156
|
+
};
|
|
157
|
+
landmarkImage.push([...classes], id);
|
|
158
|
+
landmarkColor.push([...classes], legible(hued(hue), 0));
|
|
159
|
+
}
|
|
160
|
+
landmarkImage.push('');
|
|
161
|
+
landmarkColor.push(legible(land, 0.6));
|
|
162
|
+
const classesOf = (everyday) => LANDMARKS.filter((one) => (one.everyday === true) === everyday).flatMap(({ classes }) => classes);
|
|
163
|
+
const signFont = face ? `"${face}", sans-serif` : 'sans-serif';
|
|
164
|
+
images['helix-sign-interstate'] = {
|
|
165
|
+
design: 'interstate',
|
|
166
|
+
font: signFont,
|
|
167
|
+
ink: '#ffffff',
|
|
168
|
+
kind: 'sign',
|
|
169
|
+
};
|
|
170
|
+
images['helix-sign-us'] = { design: 'us', font: signFont, ink: '#1a1a1a', kind: 'sign' };
|
|
171
|
+
images['helix-sign-state'] = { design: 'state', font: signFont, ink: '#1a1a1a', kind: 'sign' };
|
|
172
|
+
const plate = { edge: toward(0.5), fill: halo };
|
|
173
|
+
images[`helix-sign-plate-${idOf(plate.fill + plate.edge)}`] = {
|
|
174
|
+
...plate,
|
|
175
|
+
design: 'plate',
|
|
176
|
+
font: signFont,
|
|
177
|
+
ink: cssColor(ink),
|
|
178
|
+
kind: 'sign',
|
|
179
|
+
};
|
|
180
|
+
const signShape = ['match', ['get', 'network']];
|
|
181
|
+
for (const [network, shape] of Object.entries(SIGNS)) {
|
|
182
|
+
signShape.push(network, shape);
|
|
183
|
+
}
|
|
184
|
+
signShape.push(`plate-${idOf(plate.fill + plate.edge)}`);
|
|
185
|
+
return {
|
|
186
|
+
...(glyphs ? { glyphs } : {}),
|
|
187
|
+
layers: [
|
|
188
|
+
{ id: 'land', paint: { 'background-color': cssColor(land) }, type: 'background' },
|
|
189
|
+
{
|
|
190
|
+
filter: [
|
|
191
|
+
'all',
|
|
192
|
+
shapes,
|
|
193
|
+
['match', ['get', 'class'], ['wood', 'grass', 'wetland'], true, false],
|
|
194
|
+
],
|
|
195
|
+
id: 'landcover',
|
|
196
|
+
paint: { 'fill-color': cssColor(mix(land, green, 0.6)) },
|
|
197
|
+
source: 'openmaptiles',
|
|
198
|
+
'source-layer': 'landcover',
|
|
199
|
+
type: 'fill',
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
filter: ['all', shapes, ['!=', ['get', 'class'], 'historic']],
|
|
203
|
+
id: 'park',
|
|
204
|
+
paint: { 'fill-color': cssColor(green) },
|
|
205
|
+
source: 'openmaptiles',
|
|
206
|
+
'source-layer': 'park',
|
|
207
|
+
type: 'fill',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
filter: ['all', shapes, notTunnel],
|
|
211
|
+
id: 'water',
|
|
212
|
+
paint: { 'fill-color': cssColor(water) },
|
|
213
|
+
source: 'openmaptiles',
|
|
214
|
+
'source-layer': 'water',
|
|
215
|
+
type: 'fill',
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
filter: ['all', lines, notTunnel],
|
|
219
|
+
id: 'waterway',
|
|
220
|
+
paint: { 'line-color': cssColor(water), 'line-width': widen([8, 0.5], [18, 6]) },
|
|
221
|
+
source: 'openmaptiles',
|
|
222
|
+
'source-layer': 'waterway',
|
|
223
|
+
type: 'line',
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: 'building',
|
|
227
|
+
minzoom: 13,
|
|
228
|
+
paint: { 'fill-color': toward(0.07), 'fill-outline-color': toward(0.12) },
|
|
229
|
+
source: 'openmaptiles',
|
|
230
|
+
'source-layer': 'building',
|
|
231
|
+
type: 'fill',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
filter: [
|
|
235
|
+
'all',
|
|
236
|
+
lines,
|
|
237
|
+
['match', ['get', 'class'], ['rail', 'transit'], true, false],
|
|
238
|
+
notTunnel,
|
|
239
|
+
],
|
|
240
|
+
id: 'rail',
|
|
241
|
+
minzoom: 11,
|
|
242
|
+
paint: { 'line-color': toward(0.2), 'line-dasharray': [2, 2], 'line-width': 1 },
|
|
243
|
+
source: 'openmaptiles',
|
|
244
|
+
'source-layer': 'transportation',
|
|
245
|
+
type: 'line',
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
...road('path', ['path', 'track'], toward(0.14), [
|
|
249
|
+
[14, 0.5],
|
|
250
|
+
[18, 2],
|
|
251
|
+
], 14),
|
|
252
|
+
paint: {
|
|
253
|
+
'line-color': toward(0.14),
|
|
254
|
+
'line-dasharray': [1.5, 1.5],
|
|
255
|
+
'line-width': widen([14, 0.5], [18, 2]),
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
road('road-minor', ['minor', 'service'], toward(0.1), [
|
|
259
|
+
[12, 0.5],
|
|
260
|
+
[18, 10],
|
|
261
|
+
], 12),
|
|
262
|
+
road('road-secondary', ['secondary', 'tertiary'], toward(0.16), [
|
|
263
|
+
[10, 0.5],
|
|
264
|
+
[18, 14],
|
|
265
|
+
], 10),
|
|
266
|
+
road('road-major', ['primary', 'trunk'], branded(0.4), [
|
|
267
|
+
[8, 0.5],
|
|
268
|
+
[18, 16],
|
|
269
|
+
], 8),
|
|
270
|
+
road('road-motorway', ['motorway'], branded(0.6), [
|
|
271
|
+
[5, 0.5],
|
|
272
|
+
[18, 18],
|
|
273
|
+
], 5),
|
|
274
|
+
{
|
|
275
|
+
filter: ['all', ['==', ['get', 'admin_level'], 2], ['!=', ['get', 'maritime'], 1]],
|
|
276
|
+
id: 'border-country',
|
|
277
|
+
paint: { 'line-color': toward(0.4), 'line-width': widen([3, 0.75], [12, 2]) },
|
|
278
|
+
source: 'openmaptiles',
|
|
279
|
+
'source-layer': 'boundary',
|
|
280
|
+
type: 'line',
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
filter: [
|
|
284
|
+
'all',
|
|
285
|
+
['>=', ['get', 'admin_level'], 3],
|
|
286
|
+
['<=', ['get', 'admin_level'], 4],
|
|
287
|
+
['!=', ['get', 'maritime'], 1],
|
|
288
|
+
],
|
|
289
|
+
id: 'border-state',
|
|
290
|
+
minzoom: 3,
|
|
291
|
+
paint: {
|
|
292
|
+
'line-color': toward(0.28),
|
|
293
|
+
'line-dasharray': [3, 2],
|
|
294
|
+
'line-width': widen([3, 0.5], [12, 1.5]),
|
|
295
|
+
},
|
|
296
|
+
source: 'openmaptiles',
|
|
297
|
+
'source-layer': 'boundary',
|
|
298
|
+
type: 'line',
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
filter: lines,
|
|
302
|
+
id: 'label-water',
|
|
303
|
+
layout: {
|
|
304
|
+
'symbol-placement': 'line',
|
|
305
|
+
'text-field': name,
|
|
306
|
+
'text-font': ITALIC,
|
|
307
|
+
'text-size': 12,
|
|
308
|
+
},
|
|
309
|
+
minzoom: 12,
|
|
310
|
+
paint: {
|
|
311
|
+
'text-color': legible(water, 0.55),
|
|
312
|
+
'text-halo-color': halo,
|
|
313
|
+
'text-halo-width': 1.5,
|
|
314
|
+
},
|
|
315
|
+
source: 'openmaptiles',
|
|
316
|
+
'source-layer': 'waterway',
|
|
317
|
+
type: 'symbol',
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
id: 'label-sea',
|
|
321
|
+
layout: { 'text-field': name, 'text-font': ITALIC, 'text-max-width': 8, 'text-size': 13 },
|
|
322
|
+
paint: {
|
|
323
|
+
'text-color': legible(water, 0.55),
|
|
324
|
+
'text-halo-color': halo,
|
|
325
|
+
'text-halo-width': 1.5,
|
|
326
|
+
},
|
|
327
|
+
source: 'openmaptiles',
|
|
328
|
+
'source-layer': 'water_name',
|
|
329
|
+
type: 'symbol',
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
id: 'label-road',
|
|
333
|
+
layout: {
|
|
334
|
+
'symbol-placement': 'line',
|
|
335
|
+
'text-field': name,
|
|
336
|
+
'text-font': REGULAR,
|
|
337
|
+
'text-size': ['interpolate', ['linear'], ['zoom'], 13, 10, 18, 13],
|
|
338
|
+
},
|
|
339
|
+
minzoom: 13,
|
|
340
|
+
paint: {
|
|
341
|
+
'text-color': legible(land, 0.6),
|
|
342
|
+
'text-halo-color': halo,
|
|
343
|
+
'text-halo-width': 1.5,
|
|
344
|
+
},
|
|
345
|
+
source: 'openmaptiles',
|
|
346
|
+
'source-layer': 'transportation_name',
|
|
347
|
+
type: 'symbol',
|
|
348
|
+
},
|
|
349
|
+
{
|
|
350
|
+
filter: [
|
|
351
|
+
'all',
|
|
352
|
+
['has', 'ref'],
|
|
353
|
+
['<=', ['get', 'ref_length'], 6],
|
|
354
|
+
['match', ['get', 'class'], ['motorway', 'trunk', 'primary'], true, false],
|
|
355
|
+
],
|
|
356
|
+
id: 'label-shield',
|
|
357
|
+
layout: {
|
|
358
|
+
'icon-image': ['concat', 'helix-sign-', signShape, '|', ['get', 'ref']],
|
|
359
|
+
'icon-rotation-alignment': 'viewport',
|
|
360
|
+
'symbol-placement': 'line',
|
|
361
|
+
'symbol-spacing': 320,
|
|
362
|
+
},
|
|
363
|
+
minzoom: 7,
|
|
364
|
+
source: 'openmaptiles',
|
|
365
|
+
'source-layer': 'transportation_name',
|
|
366
|
+
type: 'symbol',
|
|
367
|
+
},
|
|
368
|
+
...[false, true].map((everyday) => ({
|
|
369
|
+
filter: ['match', ['get', 'class'], classesOf(everyday), true, false],
|
|
370
|
+
id: everyday ? 'label-landmark-everyday' : 'label-landmark',
|
|
371
|
+
layout: {
|
|
372
|
+
'icon-image': landmarkImage,
|
|
373
|
+
'symbol-sort-key': ['get', 'rank'],
|
|
374
|
+
'text-anchor': 'left',
|
|
375
|
+
'text-field': name,
|
|
376
|
+
'text-font': MEDIUM,
|
|
377
|
+
'text-justify': 'left',
|
|
378
|
+
'text-max-width': 8,
|
|
379
|
+
'text-offset': [1.1, 0],
|
|
380
|
+
'text-size': 11,
|
|
381
|
+
},
|
|
382
|
+
minzoom: everyday ? 16 : 14,
|
|
383
|
+
paint: { 'text-color': landmarkColor, 'text-halo-color': halo, 'text-halo-width': 1.5 },
|
|
384
|
+
source: 'openmaptiles',
|
|
385
|
+
'source-layer': 'poi',
|
|
386
|
+
type: 'symbol',
|
|
387
|
+
})),
|
|
388
|
+
place('label-village', ['match', ['get', 'class'], ['village', 'hamlet'], true, false], 0.65, [
|
|
389
|
+
[10, 10],
|
|
390
|
+
[16, 14],
|
|
391
|
+
], REGULAR, 11),
|
|
392
|
+
{
|
|
393
|
+
...place('label-neighbourhood', ['match', ['get', 'class'], ['suburb', 'neighbourhood', 'quarter'], true, false], 0.55, [
|
|
394
|
+
[11, 9],
|
|
395
|
+
[16, 13],
|
|
396
|
+
], MEDIUM, 11),
|
|
397
|
+
layout: {
|
|
398
|
+
'text-field': name,
|
|
399
|
+
'text-font': MEDIUM,
|
|
400
|
+
'text-letter-spacing': 0.12,
|
|
401
|
+
'text-max-width': 8,
|
|
402
|
+
'text-size': ['interpolate', ['linear'], ['zoom'], 11, 9, 16, 13],
|
|
403
|
+
'text-transform': 'uppercase',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
place('label-town', ['==', ['get', 'class'], 'town'], 0.75, [
|
|
407
|
+
[8, 11],
|
|
408
|
+
[16, 16],
|
|
409
|
+
], REGULAR, 8),
|
|
410
|
+
place('label-city', ['==', ['get', 'class'], 'city'], 0.88, [
|
|
411
|
+
[4, 11],
|
|
412
|
+
[14, 20],
|
|
413
|
+
], BOLD, 4),
|
|
414
|
+
place('label-state', ['==', ['get', 'class'], 'state'], 0.55, [
|
|
415
|
+
[4, 10],
|
|
416
|
+
[8, 13],
|
|
417
|
+
], REGULAR, 4),
|
|
418
|
+
place('label-country', ['==', ['get', 'class'], 'country'], 0.8, [
|
|
419
|
+
[2, 10],
|
|
420
|
+
[6, 15],
|
|
421
|
+
], BOLD, 2),
|
|
422
|
+
],
|
|
423
|
+
metadata: { 'helix:images': images },
|
|
424
|
+
name: 'Helix',
|
|
425
|
+
...(options.globe !== false
|
|
426
|
+
? {
|
|
427
|
+
projection: { type: 'globe' },
|
|
428
|
+
sky: {
|
|
429
|
+
'atmosphere-blend': ['interpolate', ['linear'], ['zoom'], 0, 1, 5, 1, 7, 0],
|
|
430
|
+
'horizon-color': cssColor(land),
|
|
431
|
+
'sky-color': cssColor(water),
|
|
432
|
+
'sky-horizon-blend': 0.5,
|
|
433
|
+
},
|
|
434
|
+
}
|
|
435
|
+
: {}),
|
|
436
|
+
sources: { openmaptiles: { type: 'vector', url: options.tiles ?? OPENFREEMAP.tiles } },
|
|
437
|
+
version: 8,
|
|
438
|
+
};
|
|
439
|
+
};
|
|
440
|
+
//# sourceMappingURL=map-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"map-style.js","sourceRoot":"","sources":["../../src/style/map-style.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,QAAQ,EACR,SAAS,EACT,aAAa,EAEb,WAAW,EACX,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,MAAM,GACP,MAAM,yBAAyB,CAAA;AAEhC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,UAAU,EAAY,KAAK,EAAE,MAAM,YAAY,CAAA;AA0DjF,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,6DAA6D;IACrE,KAAK,EAAE,sCAAsC;CAC9C,CAAA;AAwBD,MAAM,SAAS,GAQT;IACJ;QACE,OAAO,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC;QACpE,KAAK,EAAE,QAAQ;QACf,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,IAAI;KACX;IACD;QAEE,OAAO,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,CAAC;QAC3F,KAAK,EAAE,SAAS;QAChB,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,IAAI;KACX;IACD;QACE,OAAO,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,CAAC;QACvD,KAAK,EAAE,UAAU;QACjB,GAAG,EAAE,EAAE;QACP,IAAI,EAAE,aAAa;KACpB;IACD;QACE,OAAO,EAAE,CAAC,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,CAAC;QACzF,QAAQ,EAAE,IAAI;QACd,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J;gBACE,CAAC,CAAC,EAAE,EAAE,CAAC;gBACP,CAAC,CAAC,EAAE,EAAE,CAAC;aACR,EACD,OAAO,EACP,CAAC,CACF;YACD,KAAK,CACH,eAAe,EACf,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,SAAS,CAAC,EACnC,GAAG,EACH;gBACE,CAAC,CAAC,EAAE,EAAE,CAAC;gBACP,CAAC,CAAC,EAAE,EAAE,CAAC;aACR,EACD,IAAI,EACJ,CAAC,CACF;SACF;QACD,QAAQ,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE;QACpC,IAAI,EAAE,OAAO;QACb,GAAG,CAAC,OAAO,CAAC,KAAK,KAAK,KAAK;YACzB,CAAC,CAAC;gBACE,UAAU,EAAE,EAAE,IAAI,EAAE,OAAgB,EAAE;gBAKtC,GAAG,EAAE;oBACH,kBAAkB,EAAE,CAAC,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;oBAC3E,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC;oBAC/B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC;oBAC5B,mBAAmB,EAAE,GAAG;iBACzB;aACF;YACH,CAAC,CAAC,EAAE,CAAC;QACP,OAAO,EAAE,EAAE,YAAY,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,CAAC,KAAK,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE;QACtF,OAAO,EAAE,CAAC;KACX,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/** A color as three channels from 0 to 1, and its opacity. */
|
|
2
|
+
export interface Rgb {
|
|
3
|
+
alpha: number;
|
|
4
|
+
blue: number;
|
|
5
|
+
green: number;
|
|
6
|
+
red: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* A color written as `#rgb`, `#rrggbb`, `rgb()` or `rgba()`, or nothing.
|
|
10
|
+
*
|
|
11
|
+
* **Only the forms a map style can be handed.** What a page's tokens resolve
|
|
12
|
+
* to, `oklch()` and `color-mix()` among them, is turned into one of these by
|
|
13
|
+
* `mapColorsFrom` before it arrives, and a theme derived by `helix-theme` is
|
|
14
|
+
* already hex.
|
|
15
|
+
*/
|
|
16
|
+
export declare const parseColor: (value: string) => Rgb | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* `amount` of the way from one color to another, in OKLab, the way CSS's own
|
|
19
|
+
* `color-mix(in oklab, ...)` goes: a tenth of the way from the land to the ink
|
|
20
|
+
* reads as a tenth darker on a light theme and a tenth lighter on a dark one.
|
|
21
|
+
*/
|
|
22
|
+
export declare const mix: (from: Rgb, to: Rgb, amount: number) => Rgb;
|
|
23
|
+
/**
|
|
24
|
+
* A color of the same lightness and colorfulness as `like`, at another hue,
|
|
25
|
+
* in degrees round OKLCH's wheel: how a set of kinds can each keep a hue of
|
|
26
|
+
* their own and still sit in one theme, light or dark. `least` is the
|
|
27
|
+
* colorfulness it takes at the least, so a gray brand still gives hues.
|
|
28
|
+
*/
|
|
29
|
+
export declare const rehue: (like: Rgb, hue: number, least?: number) => Rgb;
|
|
30
|
+
/** A color from its OKLCH lightness, colorfulness, and hue in degrees. */
|
|
31
|
+
export declare const oklch: (lightness: number, chroma: number, hue: number) => Rgb;
|
|
32
|
+
/** A color as the `rgb()` or `rgba()` a map style takes. */
|
|
33
|
+
export declare const cssColor: ({ alpha, blue, green, red }: Rgb) => string;
|
|
34
|
+
/** The WCAG contrast ratio between two colors, from 1 to 21. */
|
|
35
|
+
export declare const contrast: (one: Rgb, other: Rgb) => number;
|
|
36
|
+
//# sourceMappingURL=oklab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oklab.d.ts","sourceRoot":"","sources":["../../src/style/oklab.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,MAAM,WAAW,GAAG;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,UAAW,MAAM,KAAG,GAAG,GAAG,SA0BhD,CAAA;AAkCD;;;;GAIG;AACH,eAAO,MAAM,GAAG,SAAU,GAAG,MAAM,GAAG,UAAU,MAAM,KAAG,GAOxD,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,SAAU,GAAG,OAAO,MAAM,qBAAgB,GAK3D,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,KAAK,cAAe,MAAM,UAAU,MAAM,OAAO,MAAM,KAAG,GAGtE,CAAA;AAED,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,gCAAiC,GAAG,KAAG,MAK3D,CAAA;AAMD,gEAAgE;AAChE,eAAO,MAAM,QAAQ,QAAS,GAAG,SAAS,GAAG,KAAG,MAG/C,CAAA"}
|