@versatiles/style 5.2.6 → 5.2.7
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/index.d.ts +274 -14
- package/dist/index.js +3650 -11
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/color/abstract.ts +83 -0
- package/src/color/hsl.test.ts +182 -0
- package/src/color/hsl.ts +122 -0
- package/src/color/hsv.test.ts +174 -0
- package/src/color/hsv.ts +100 -0
- package/src/color/index.test.ts +119 -0
- package/src/color/index.ts +38 -0
- package/src/color/random.test.ts +35 -0
- package/src/color/random.ts +165 -0
- package/src/color/rgb.test.ts +227 -0
- package/src/color/rgb.ts +248 -0
- package/src/color/utils.test.ts +86 -0
- package/src/color/utils.ts +13 -0
- package/src/guess_style/guess_style.test.ts +134 -0
- package/src/guess_style/guess_style.ts +166 -0
- package/{dist/guess_style/index.d.ts → src/guess_style/index.ts} +1 -0
- package/src/index.test.ts +77 -0
- package/src/index.ts +18 -0
- package/src/lib/utils.test.ts +197 -0
- package/src/lib/utils.ts +134 -0
- package/{dist/shortbread/index.d.ts → src/shortbread/index.ts} +1 -0
- package/src/shortbread/layers.test.ts +36 -0
- package/src/shortbread/layers.ts +564 -0
- package/src/shortbread/properties.test.ts +44 -0
- package/src/shortbread/properties.ts +142 -0
- package/src/shortbread/template.test.ts +43 -0
- package/src/shortbread/template.ts +343 -0
- package/src/style_builder/decorator.test.ts +67 -0
- package/src/style_builder/decorator.ts +135 -0
- package/src/style_builder/recolor.test.ts +306 -0
- package/src/style_builder/recolor.ts +110 -0
- package/src/style_builder/style_builder.test.ts +103 -0
- package/src/style_builder/style_builder.ts +134 -0
- package/src/style_builder/types.ts +141 -0
- package/src/styles/LICENSE.md +41 -0
- package/src/styles/colorful.ts +1041 -0
- package/src/styles/eclipse.ts +11 -0
- package/{dist/styles/empty.d.ts → src/styles/empty.ts} +7 -3
- package/src/styles/graybeard.ts +11 -0
- package/src/styles/index.ts +33 -0
- package/src/styles/neutrino.ts +429 -0
- package/{dist/types/index.d.ts → src/types/index.ts} +1 -0
- package/{dist/types/maplibre.d.ts → src/types/maplibre.ts} +3 -0
- package/src/types/tilejson.test.ts +94 -0
- package/src/types/tilejson.ts +125 -0
- package/src/types/vector_layer.test.ts +64 -0
- package/src/types/vector_layer.ts +69 -0
- package/dist/color/abstract.d.ts +0 -34
- package/dist/color/abstract.js +0 -53
- package/dist/color/abstract.js.map +0 -1
- package/dist/color/hsl.d.ts +0 -23
- package/dist/color/hsl.js +0 -98
- package/dist/color/hsl.js.map +0 -1
- package/dist/color/hsv.d.ts +0 -20
- package/dist/color/hsv.js +0 -100
- package/dist/color/hsv.js.map +0 -1
- package/dist/color/index.d.ts +0 -6
- package/dist/color/index.js +0 -29
- package/dist/color/index.js.map +0 -1
- package/dist/color/random.d.ts +0 -9
- package/dist/color/random.js +0 -134
- package/dist/color/random.js.map +0 -1
- package/dist/color/rgb.d.ts +0 -28
- package/dist/color/rgb.js +0 -195
- package/dist/color/rgb.js.map +0 -1
- package/dist/color/utils.d.ts +0 -3
- package/dist/color/utils.js +0 -10
- package/dist/color/utils.js.map +0 -1
- package/dist/guess_style/guess_style.d.ts +0 -8
- package/dist/guess_style/guess_style.js +0 -147
- package/dist/guess_style/guess_style.js.map +0 -1
- package/dist/guess_style/index.js +0 -2
- package/dist/guess_style/index.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -6
- package/dist/lib/utils.js +0 -126
- package/dist/lib/utils.js.map +0 -1
- package/dist/shortbread/index.js +0 -3
- package/dist/shortbread/index.js.map +0 -1
- package/dist/shortbread/layers.d.ts +0 -5
- package/dist/shortbread/layers.js +0 -521
- package/dist/shortbread/layers.js.map +0 -1
- package/dist/shortbread/properties.d.ts +0 -7
- package/dist/shortbread/properties.js +0 -125
- package/dist/shortbread/properties.js.map +0 -1
- package/dist/shortbread/template.d.ts +0 -4
- package/dist/shortbread/template.js +0 -339
- package/dist/shortbread/template.js.map +0 -1
- package/dist/style_builder/decorator.d.ts +0 -4
- package/dist/style_builder/decorator.js +0 -127
- package/dist/style_builder/decorator.js.map +0 -1
- package/dist/style_builder/recolor.d.ts +0 -22
- package/dist/style_builder/recolor.js +0 -89
- package/dist/style_builder/recolor.js.map +0 -1
- package/dist/style_builder/style_builder.d.ts +0 -15
- package/dist/style_builder/style_builder.js +0 -106
- package/dist/style_builder/style_builder.js.map +0 -1
- package/dist/style_builder/types.d.ts +0 -122
- package/dist/style_builder/types.js +0 -3
- package/dist/style_builder/types.js.map +0 -1
- package/dist/styles/colorful.d.ts +0 -11
- package/dist/styles/colorful.js +0 -956
- package/dist/styles/colorful.js.map +0 -1
- package/dist/styles/eclipse.d.ts +0 -5
- package/dist/styles/eclipse.js +0 -9
- package/dist/styles/eclipse.js.map +0 -1
- package/dist/styles/empty.js +0 -8
- package/dist/styles/empty.js.map +0 -1
- package/dist/styles/graybeard.d.ts +0 -5
- package/dist/styles/graybeard.js +0 -9
- package/dist/styles/graybeard.js.map +0 -1
- package/dist/styles/index.d.ts +0 -11
- package/dist/styles/index.js +0 -20
- package/dist/styles/index.js.map +0 -1
- package/dist/styles/neutrino.d.ts +0 -11
- package/dist/styles/neutrino.js +0 -401
- package/dist/styles/neutrino.js.map +0 -1
- package/dist/types/index.js +0 -3
- package/dist/types/index.js.map +0 -1
- package/dist/types/maplibre.js +0 -2
- package/dist/types/maplibre.js.map +0 -1
- package/dist/types/tilejson.d.ts +0 -32
- package/dist/types/tilejson.js +0 -87
- package/dist/types/tilejson.js.map +0 -1
- package/dist/types/vector_layer.d.ts +0 -14
- package/dist/types/vector_layer.js +0 -51
- package/dist/types/vector_layer.js.map +0 -1
package/dist/lib/utils.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { Color } from '../color/index.js';
|
|
2
|
-
// Utility function to deep clone an object
|
|
3
|
-
export function deepClone(obj) {
|
|
4
|
-
const type = typeof obj;
|
|
5
|
-
if (type !== 'object') {
|
|
6
|
-
switch (type) {
|
|
7
|
-
case 'boolean':
|
|
8
|
-
case 'number':
|
|
9
|
-
case 'string':
|
|
10
|
-
case 'undefined':
|
|
11
|
-
return obj;
|
|
12
|
-
default: throw new Error(`Not implemented yet: "${type}" case`);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
if (isSimpleObject(obj)) {
|
|
16
|
-
// @ts-expect-error: Too complicated to handle
|
|
17
|
-
return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, deepClone(value)]));
|
|
18
|
-
}
|
|
19
|
-
if (obj instanceof Array) {
|
|
20
|
-
// @ts-expect-error: Too complicated to handle
|
|
21
|
-
return obj.map((e) => deepClone(e));
|
|
22
|
-
}
|
|
23
|
-
if (obj instanceof Color) {
|
|
24
|
-
return obj.clone();
|
|
25
|
-
}
|
|
26
|
-
if (obj == null)
|
|
27
|
-
return obj;
|
|
28
|
-
console.log('obj', obj);
|
|
29
|
-
console.log('obj.prototype', Object.getPrototypeOf(obj));
|
|
30
|
-
throw Error();
|
|
31
|
-
}
|
|
32
|
-
export function isSimpleObject(item) {
|
|
33
|
-
if (item === null)
|
|
34
|
-
return false;
|
|
35
|
-
if (typeof item !== 'object')
|
|
36
|
-
return false;
|
|
37
|
-
if (Array.isArray(item))
|
|
38
|
-
return false;
|
|
39
|
-
const prototypeKeyCount = Object.keys(Object.getPrototypeOf(item)).length;
|
|
40
|
-
if (prototypeKeyCount !== 0)
|
|
41
|
-
return false;
|
|
42
|
-
if (item.constructor.name !== 'Object')
|
|
43
|
-
return false;
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
export function isBasicType(item) {
|
|
47
|
-
switch (typeof item) {
|
|
48
|
-
case 'boolean':
|
|
49
|
-
case 'number':
|
|
50
|
-
case 'string':
|
|
51
|
-
case 'undefined':
|
|
52
|
-
return true;
|
|
53
|
-
case 'object':
|
|
54
|
-
return false;
|
|
55
|
-
default:
|
|
56
|
-
throw Error('unknown type: ' + typeof item);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
export function deepMerge(source0, ...sources) {
|
|
60
|
-
const target = deepClone(source0);
|
|
61
|
-
for (const source of sources) {
|
|
62
|
-
if (typeof source !== 'object')
|
|
63
|
-
continue;
|
|
64
|
-
for (const key in source) {
|
|
65
|
-
if (!(key in source))
|
|
66
|
-
continue;
|
|
67
|
-
const sourceValue = source[key];
|
|
68
|
-
// *********
|
|
69
|
-
// overwrite
|
|
70
|
-
// *********
|
|
71
|
-
switch (typeof sourceValue) {
|
|
72
|
-
case 'number':
|
|
73
|
-
case 'string':
|
|
74
|
-
case 'boolean':
|
|
75
|
-
target[key] = sourceValue;
|
|
76
|
-
continue;
|
|
77
|
-
default:
|
|
78
|
-
}
|
|
79
|
-
if (isBasicType(target[key])) {
|
|
80
|
-
target[key] = deepClone(sourceValue);
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
if (sourceValue instanceof Color) {
|
|
84
|
-
// @ts-expect-error: Too complicated to handle
|
|
85
|
-
target[key] = sourceValue.clone();
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
if (isSimpleObject(target[key]) && isSimpleObject(sourceValue)) {
|
|
89
|
-
target[key] = deepMerge(target[key], sourceValue);
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
// *********
|
|
93
|
-
// merge
|
|
94
|
-
// *********
|
|
95
|
-
if (isSimpleObject(target[key]) && isSimpleObject(sourceValue)) {
|
|
96
|
-
target[key] = deepMerge(target[key], sourceValue);
|
|
97
|
-
continue;
|
|
98
|
-
}
|
|
99
|
-
console.log('target[key]:', target[key]);
|
|
100
|
-
console.log('source[key]:', source[key]);
|
|
101
|
-
throw Error('unpredicted case');
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return target;
|
|
105
|
-
}
|
|
106
|
-
export function resolveUrl(base, url) {
|
|
107
|
-
if (!base)
|
|
108
|
-
return url;
|
|
109
|
-
url = new URL(url, base).href;
|
|
110
|
-
url = url.replace(/%7B/gi, '{');
|
|
111
|
-
url = url.replace(/%7D/gi, '}');
|
|
112
|
-
return url;
|
|
113
|
-
}
|
|
114
|
-
export function basename(url) {
|
|
115
|
-
if (!url)
|
|
116
|
-
return '';
|
|
117
|
-
try {
|
|
118
|
-
url = new URL(url, 'http://example.org').pathname;
|
|
119
|
-
}
|
|
120
|
-
catch (_) {
|
|
121
|
-
// ignore
|
|
122
|
-
}
|
|
123
|
-
url = url.replace(/\/+$/, '');
|
|
124
|
-
return url.split('/').pop() ?? '';
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/lib/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C,2CAA2C;AAC3C,MAAM,UAAU,SAAS,CAAI,GAAM;IAClC,MAAM,IAAI,GAAG,OAAO,GAAG,CAAC;IACxB,IAAI,IAAI,KAAK,QAAQ,EAAE,CAAC;QACvB,QAAQ,IAAI,EAAE,CAAC;YACd,KAAK,SAAS,CAAC;YACf,KAAK,QAAQ,CAAC;YACd,KAAK,QAAQ,CAAC;YACd,KAAK,WAAW;gBACf,OAAO,GAAG,CAAC;YACZ,OAAO,CAAC,CAAC,MAAM,IAAI,KAAK,CAAC,yBAAyB,IAAI,QAAQ,CAAC,CAAC;QACjE,CAAC;IACF,CAAC;IAED,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,8CAA8C;QAC9C,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/F,CAAC;IAED,IAAI,GAAG,YAAY,KAAK,EAAE,CAAC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,CAAC;AACnC,CAAC"}
|
package/dist/shortbread/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/shortbread/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,521 +0,0 @@
|
|
|
1
|
-
export function getShortbreadLayers(option) {
|
|
2
|
-
const { language } = option;
|
|
3
|
-
const nameField = language ? '{name_' + language + '}' : '{name}';
|
|
4
|
-
return [
|
|
5
|
-
// background
|
|
6
|
-
{ id: 'background', type: 'background' },
|
|
7
|
-
// ocean
|
|
8
|
-
{ id: 'water-ocean', type: 'fill', 'source-layer': 'ocean' },
|
|
9
|
-
// land
|
|
10
|
-
{
|
|
11
|
-
id: 'land-glacier',
|
|
12
|
-
type: 'fill', 'source-layer': 'water_polygons',
|
|
13
|
-
filter: ['all', ['==', 'kind', 'glacier']],
|
|
14
|
-
},
|
|
15
|
-
...[
|
|
16
|
-
{ id: 'commercial', kinds: ['commercial', 'retail'] },
|
|
17
|
-
{ id: 'industrial', kinds: ['industrial', 'quarry', 'railway'] },
|
|
18
|
-
{ id: 'residential', kinds: ['garages', 'residential'] },
|
|
19
|
-
{ id: 'agriculture', kinds: ['brownfield', 'farmland', 'farmyard', 'greenfield', 'greenhouse_horticulture', 'orchard', 'plant_nursery', 'vineyard'] },
|
|
20
|
-
{ id: 'waste', kinds: ['landfill'] },
|
|
21
|
-
{ id: 'park', kinds: ['park', 'village_green', 'recreation_ground'] },
|
|
22
|
-
{ id: 'garden', kinds: ['allotments', 'garden'] },
|
|
23
|
-
{ id: 'burial', kinds: ['cemetery', 'grave_yard'] },
|
|
24
|
-
{ id: 'leisure', kinds: ['miniature_golf', 'playground', 'golf_course'] },
|
|
25
|
-
{ id: 'rock', kinds: ['bare_rock', 'scree', 'shingle'] },
|
|
26
|
-
{ id: 'forest', kinds: ['forest'] },
|
|
27
|
-
{ id: 'grass', kinds: ['grass', 'grassland', 'meadow', 'wet_meadow'] },
|
|
28
|
-
{ id: 'vegetation', kinds: ['heath', 'scrub'] },
|
|
29
|
-
{ id: 'sand', kinds: ['beach', 'sand'] },
|
|
30
|
-
{ id: 'wetland', kinds: ['bog', 'marsh', 'string_bog', 'swamp'] },
|
|
31
|
-
].map(({ id, kinds }) => ({
|
|
32
|
-
id: 'land-' + id,
|
|
33
|
-
type: 'fill',
|
|
34
|
-
'source-layer': 'land',
|
|
35
|
-
filter: ['all',
|
|
36
|
-
['in', 'kind', ...kinds],
|
|
37
|
-
],
|
|
38
|
-
})),
|
|
39
|
-
// water-lines
|
|
40
|
-
...['river', 'canal', 'stream', 'ditch'].map((t) => ({
|
|
41
|
-
id: 'water-' + t,
|
|
42
|
-
type: 'line',
|
|
43
|
-
'source-layer': 'water_lines',
|
|
44
|
-
filter: ['all',
|
|
45
|
-
['in', 'kind', t],
|
|
46
|
-
['!=', 'tunnel', true],
|
|
47
|
-
['!=', 'bridge', true],
|
|
48
|
-
],
|
|
49
|
-
})),
|
|
50
|
-
// water polygons
|
|
51
|
-
{
|
|
52
|
-
id: 'water-area',
|
|
53
|
-
type: 'fill', 'source-layer': 'water_polygons',
|
|
54
|
-
filter: ['==', 'kind', 'water'],
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: 'water-area-river',
|
|
58
|
-
type: 'fill', 'source-layer': 'water_polygons',
|
|
59
|
-
filter: ['==', 'kind', 'river'],
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
id: 'water-area-small',
|
|
63
|
-
type: 'fill', 'source-layer': 'water_polygons',
|
|
64
|
-
filter: ['in', 'kind', 'reservoir', 'basin', 'dock'],
|
|
65
|
-
},
|
|
66
|
-
// dam
|
|
67
|
-
{ id: 'water-dam-area', type: 'fill', 'source-layer': 'dam_polygons', filter: ['==', 'kind', 'dam'] },
|
|
68
|
-
{ id: 'water-dam', type: 'line', 'source-layer': 'dam_lines', filter: ['==', 'kind', 'dam'] },
|
|
69
|
-
// pier
|
|
70
|
-
{ id: 'water-pier-area', type: 'fill', 'source-layer': 'pier_polygons', filter: ['in', 'kind', 'pier', 'breakwater', 'groyne'] },
|
|
71
|
-
{ id: 'water-pier', type: 'line', 'source-layer': 'pier_lines', filter: ['in', 'kind', 'pier', 'breakwater', 'groyne'] },
|
|
72
|
-
// site
|
|
73
|
-
...['danger_area', 'sports_center', 'university', 'college', 'school', 'hospital', 'prison', 'parking', 'bicycle_parking', 'construction'].map((t) => ({
|
|
74
|
-
id: 'site-' + t.replace(/_/g, ''),
|
|
75
|
-
type: 'fill',
|
|
76
|
-
'source-layer': 'sites',
|
|
77
|
-
filter: ['in', 'kind', t],
|
|
78
|
-
})),
|
|
79
|
-
// airport
|
|
80
|
-
{
|
|
81
|
-
id: 'airport-area',
|
|
82
|
-
type: 'fill', 'source-layer': 'street_polygons', filter: ['in', 'kind', 'runway', 'taxiway'],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 'airport-taxiway:outline',
|
|
86
|
-
type: 'line', 'source-layer': 'streets', filter: ['==', 'kind', 'taxiway'],
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
id: 'airport-runway:outline',
|
|
90
|
-
type: 'line', 'source-layer': 'streets', filter: ['==', 'kind', 'runway'],
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: 'airport-taxiway',
|
|
94
|
-
type: 'line', 'source-layer': 'streets', filter: ['==', 'kind', 'taxiway'],
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
id: 'airport-runway',
|
|
98
|
-
type: 'line', 'source-layer': 'streets', filter: ['==', 'kind', 'runway'],
|
|
99
|
-
},
|
|
100
|
-
// building
|
|
101
|
-
{
|
|
102
|
-
id: 'building:outline',
|
|
103
|
-
type: 'fill', 'source-layer': 'buildings',
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
id: 'building',
|
|
107
|
-
type: 'fill', 'source-layer': 'buildings',
|
|
108
|
-
},
|
|
109
|
-
// tunnel-, street-, bridges-bridge
|
|
110
|
-
...['tunnel', 'street', 'bridge'].flatMap((c) => {
|
|
111
|
-
let filter;
|
|
112
|
-
let prefix;
|
|
113
|
-
let suffixes = [];
|
|
114
|
-
const results = [];
|
|
115
|
-
switch (c) {
|
|
116
|
-
case 'tunnel':
|
|
117
|
-
filter = [['==', 'tunnel', true]];
|
|
118
|
-
prefix = 'tunnel-';
|
|
119
|
-
suffixes = [':outline', ''];
|
|
120
|
-
break;
|
|
121
|
-
case 'street':
|
|
122
|
-
filter = [['!=', 'bridge', true], ['!=', 'tunnel', true]];
|
|
123
|
-
prefix = '';
|
|
124
|
-
suffixes = [':outline', ''];
|
|
125
|
-
break;
|
|
126
|
-
case 'bridge':
|
|
127
|
-
filter = [['==', 'bridge', true]];
|
|
128
|
-
prefix = 'bridge-';
|
|
129
|
-
suffixes = [':bridge', ':outline', ''];
|
|
130
|
-
break;
|
|
131
|
-
}
|
|
132
|
-
// in osm data streets on bridges are often not tagged as such
|
|
133
|
-
// to be able to have multiple levels of bridges cross over each
|
|
134
|
-
// other in the right order without using a secondary property.
|
|
135
|
-
// this results in bridge-polygons being rendered above streets.
|
|
136
|
-
// therefore bridge polygons are *under* surface streets here.
|
|
137
|
-
// this workaround is also wrong, but everyone is using it since
|
|
138
|
-
// it's simpler than removing all these tagging hacks from osm.
|
|
139
|
-
// bridges, above tunnel, below street
|
|
140
|
-
if (c === 'street')
|
|
141
|
-
results.push({
|
|
142
|
-
id: 'bridge',
|
|
143
|
-
type: 'fill',
|
|
144
|
-
'source-layer': 'bridges',
|
|
145
|
-
});
|
|
146
|
-
suffixes.forEach(suffix => {
|
|
147
|
-
// pedestrian zone — no outline
|
|
148
|
-
if (suffix === ':outline')
|
|
149
|
-
results.push({
|
|
150
|
-
id: prefix + 'street-pedestrian-zone',
|
|
151
|
-
type: 'fill',
|
|
152
|
-
'source-layer': 'street_polygons',
|
|
153
|
-
filter: ['all',
|
|
154
|
-
...filter,
|
|
155
|
-
['==', 'kind', 'pedestrian'],
|
|
156
|
-
],
|
|
157
|
-
});
|
|
158
|
-
// non-car streets
|
|
159
|
-
['footway', 'steps', 'path', 'cycleway'].forEach(t => {
|
|
160
|
-
results.push({
|
|
161
|
-
id: prefix + 'way-' + t.replace(/_/g, '') + suffix,
|
|
162
|
-
type: 'line',
|
|
163
|
-
'source-layer': 'streets',
|
|
164
|
-
filter: ['all',
|
|
165
|
-
...filter,
|
|
166
|
-
['in', 'kind', t],
|
|
167
|
-
],
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
// no links
|
|
171
|
-
const noDrivewayExpression = ['!=', 'service', 'driveway'];
|
|
172
|
-
['track', 'pedestrian', 'service', 'living_street', 'residential', 'unclassified'].forEach(t => {
|
|
173
|
-
results.push({
|
|
174
|
-
id: prefix + 'street-' + t.replace(/_/g, '') + suffix,
|
|
175
|
-
type: 'line',
|
|
176
|
-
'source-layer': 'streets',
|
|
177
|
-
filter: ['all',
|
|
178
|
-
['==', 'kind', t],
|
|
179
|
-
...filter,
|
|
180
|
-
...(t === 'service') ? [noDrivewayExpression] : [], // ignore driveways
|
|
181
|
-
],
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
// no links, bicycle=designated
|
|
185
|
-
if (suffix === '')
|
|
186
|
-
['track', 'pedestrian', 'service', 'living_street', 'residential', 'unclassified'].forEach(t => {
|
|
187
|
-
results.push({
|
|
188
|
-
id: prefix + 'street-' + t.replace(/_/g, '') + '-bicycle',
|
|
189
|
-
type: 'line',
|
|
190
|
-
'source-layer': 'streets',
|
|
191
|
-
filter: ['all',
|
|
192
|
-
['==', 'kind', t],
|
|
193
|
-
['==', 'bicycle', 'designated'],
|
|
194
|
-
...filter,
|
|
195
|
-
...(t === 'service') ? [noDrivewayExpression] : [], // ignore driveways
|
|
196
|
-
],
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
// links
|
|
200
|
-
['tertiary', 'secondary', 'primary', 'trunk', 'motorway'].forEach(t => {
|
|
201
|
-
results.push({
|
|
202
|
-
id: prefix + 'street-' + t.replace(/_/g, '') + '-link' + suffix,
|
|
203
|
-
type: 'line',
|
|
204
|
-
'source-layer': 'streets',
|
|
205
|
-
filter: ['all',
|
|
206
|
-
...filter,
|
|
207
|
-
['in', 'kind', t],
|
|
208
|
-
['==', 'link', true],
|
|
209
|
-
],
|
|
210
|
-
});
|
|
211
|
-
});
|
|
212
|
-
// main
|
|
213
|
-
['tertiary', 'secondary', 'primary', 'trunk', 'motorway'].forEach(t => {
|
|
214
|
-
results.push({
|
|
215
|
-
id: prefix + 'street-' + t.replace(/_/g, '') + suffix,
|
|
216
|
-
type: 'line',
|
|
217
|
-
'source-layer': 'streets',
|
|
218
|
-
filter: ['all',
|
|
219
|
-
...filter,
|
|
220
|
-
['in', 'kind', t],
|
|
221
|
-
['!=', 'link', true],
|
|
222
|
-
],
|
|
223
|
-
});
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
// separate outline for trains
|
|
227
|
-
[':outline', ''].forEach(suffix => {
|
|
228
|
-
// transport
|
|
229
|
-
['rail', 'light_rail', 'subway', 'narrow_gauge', 'tram', 'funicular', 'monorail', 'bus_guideway', 'busway'].reverse().forEach((t) => {
|
|
230
|
-
results.push({
|
|
231
|
-
id: prefix + 'transport-' + t.replace(/_/g, '') + suffix,
|
|
232
|
-
type: 'line',
|
|
233
|
-
'source-layer': 'streets',
|
|
234
|
-
filter: ['all',
|
|
235
|
-
['in', 'kind', t],
|
|
236
|
-
['!has', 'service'],
|
|
237
|
-
...filter,
|
|
238
|
-
],
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
if (c === 'street') {
|
|
242
|
-
// aerialway, no bridges, above street evel
|
|
243
|
-
['cable_car', 'gondola', 'goods', 'chair_lift', 'drag_lift', 't-bar', 'j-bar', 'platter', 'rope-tow'].reverse().forEach((t) => {
|
|
244
|
-
results.push({
|
|
245
|
-
id: 'aerialway-' + t.replace(/[_-]+/g, '') + suffix,
|
|
246
|
-
type: 'line',
|
|
247
|
-
'source-layer': 'aerialways',
|
|
248
|
-
filter: ['all',
|
|
249
|
-
...filter,
|
|
250
|
-
['in', 'kind', t],
|
|
251
|
-
],
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
// ferry — only on street level
|
|
255
|
-
results.push({
|
|
256
|
-
id: 'transport-ferry' + suffix,
|
|
257
|
-
type: 'line',
|
|
258
|
-
'source-layer': 'ferries',
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
return results;
|
|
263
|
-
}),
|
|
264
|
-
// poi, one layer per type
|
|
265
|
-
...['amenity', 'leisure', 'tourism', 'shop', 'man_made', 'historic', 'emergency', 'highway', 'office'].map((key) => ({
|
|
266
|
-
id: 'poi-' + key,
|
|
267
|
-
type: 'symbol',
|
|
268
|
-
'source-layer': 'pois',
|
|
269
|
-
filter: ['to-boolean', ['get', key]],
|
|
270
|
-
})),
|
|
271
|
-
// boundary
|
|
272
|
-
...[':outline', ''].flatMap((suffix) => [
|
|
273
|
-
{
|
|
274
|
-
id: 'boundary-country' + suffix,
|
|
275
|
-
type: 'line',
|
|
276
|
-
'source-layer': 'boundaries',
|
|
277
|
-
filter: ['all',
|
|
278
|
-
['==', 'admin_level', 2],
|
|
279
|
-
['!=', 'maritime', true],
|
|
280
|
-
['!=', 'disputed', true],
|
|
281
|
-
['!=', 'coastline', true],
|
|
282
|
-
],
|
|
283
|
-
},
|
|
284
|
-
{
|
|
285
|
-
id: 'boundary-country-disputed' + suffix,
|
|
286
|
-
type: 'line',
|
|
287
|
-
'source-layer': 'boundaries',
|
|
288
|
-
filter: ['all',
|
|
289
|
-
['==', 'admin_level', 2],
|
|
290
|
-
['==', 'disputed', true],
|
|
291
|
-
['!=', 'maritime', true],
|
|
292
|
-
['!=', 'coastline', true],
|
|
293
|
-
],
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
id: 'boundary-country-maritime' + suffix,
|
|
297
|
-
type: 'line',
|
|
298
|
-
'source-layer': 'boundaries',
|
|
299
|
-
filter: ['all',
|
|
300
|
-
['==', 'admin_level', 2],
|
|
301
|
-
['==', 'maritime', true],
|
|
302
|
-
['!=', 'disputed', true],
|
|
303
|
-
['!=', 'coastline', true],
|
|
304
|
-
],
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
id: 'boundary-state' + suffix,
|
|
308
|
-
type: 'line',
|
|
309
|
-
'source-layer': 'boundaries',
|
|
310
|
-
filter: ['all',
|
|
311
|
-
['==', 'admin_level', 4],
|
|
312
|
-
['!=', 'maritime', true],
|
|
313
|
-
['!=', 'disputed', true],
|
|
314
|
-
['!=', 'coastline', true],
|
|
315
|
-
],
|
|
316
|
-
},
|
|
317
|
-
]),
|
|
318
|
-
// label-address
|
|
319
|
-
{
|
|
320
|
-
id: 'label-address-housenumber',
|
|
321
|
-
type: 'symbol',
|
|
322
|
-
'source-layer': 'addresses',
|
|
323
|
-
filter: ['has', 'housenumber'],
|
|
324
|
-
layout: { 'text-field': '{housenumber}' },
|
|
325
|
-
},
|
|
326
|
-
// label-motorway
|
|
327
|
-
{
|
|
328
|
-
id: 'label-motorway-exit',
|
|
329
|
-
type: 'symbol',
|
|
330
|
-
'source-layer': 'street_labels_points', // docs say `streets_labels_points`, but layer is actually called `street_labels_points`
|
|
331
|
-
filter: ['==', 'kind', 'motorway_junction'],
|
|
332
|
-
layout: { 'text-field': '{ref}' },
|
|
333
|
-
// FIXME shield
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
id: 'label-motorway-shield',
|
|
337
|
-
type: 'symbol',
|
|
338
|
-
'source-layer': 'street_labels',
|
|
339
|
-
filter: ['==', 'kind', 'motorway'],
|
|
340
|
-
layout: { 'text-field': '{ref}' },
|
|
341
|
-
// FIXME shield
|
|
342
|
-
},
|
|
343
|
-
// label-street
|
|
344
|
-
...['pedestrian', 'living_street', 'residential', 'unclassified', 'tertiary', 'secondary', 'primary', 'trunk'].map((t) => ({
|
|
345
|
-
id: 'label-street-' + t.replace(/_/g, ''),
|
|
346
|
-
type: 'symbol',
|
|
347
|
-
'source-layer': 'street_labels',
|
|
348
|
-
filter: ['==', 'kind', t],
|
|
349
|
-
layout: { 'text-field': nameField },
|
|
350
|
-
})),
|
|
351
|
-
// label-place of small places
|
|
352
|
-
...[/*'locality', 'island', 'farm', 'dwelling',*/ 'neighbourhood', 'quarter', 'suburb', 'hamlet', 'village', 'town'].map((id) => ({
|
|
353
|
-
id: 'label-place-' + id.replace(/_/g, ''),
|
|
354
|
-
type: 'symbol',
|
|
355
|
-
'source-layer': 'place_labels',
|
|
356
|
-
filter: ['==', 'kind', id],
|
|
357
|
-
layout: { 'text-field': nameField },
|
|
358
|
-
})),
|
|
359
|
-
// label-boundary
|
|
360
|
-
{
|
|
361
|
-
id: 'label-boundary-state',
|
|
362
|
-
type: 'symbol',
|
|
363
|
-
'source-layer': 'boundary_labels',
|
|
364
|
-
filter: ['in', 'admin_level', 4, '4'],
|
|
365
|
-
layout: { 'text-field': nameField },
|
|
366
|
-
},
|
|
367
|
-
// label-place-* of large places
|
|
368
|
-
...['city', 'state_capital', 'capital'].map((id) => ({
|
|
369
|
-
id: 'label-place-' + id.replace(/_/g, ''),
|
|
370
|
-
type: 'symbol',
|
|
371
|
-
'source-layer': 'place_labels',
|
|
372
|
-
filter: ['==', 'kind', id],
|
|
373
|
-
layout: { 'text-field': nameField },
|
|
374
|
-
})),
|
|
375
|
-
{
|
|
376
|
-
id: 'label-boundary-country-small',
|
|
377
|
-
type: 'symbol',
|
|
378
|
-
'source-layer': 'boundary_labels',
|
|
379
|
-
filter: ['all',
|
|
380
|
-
['in', 'admin_level', 2, '2'],
|
|
381
|
-
['<=', 'way_area', 10000000],
|
|
382
|
-
],
|
|
383
|
-
layout: { 'text-field': nameField },
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
id: 'label-boundary-country-medium',
|
|
387
|
-
type: 'symbol',
|
|
388
|
-
'source-layer': 'boundary_labels',
|
|
389
|
-
filter: ['all',
|
|
390
|
-
['in', 'admin_level', 2, '2'],
|
|
391
|
-
['<', 'way_area', 90000000],
|
|
392
|
-
['>', 'way_area', 10000000],
|
|
393
|
-
],
|
|
394
|
-
layout: { 'text-field': nameField },
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
id: 'label-boundary-country-large',
|
|
398
|
-
type: 'symbol',
|
|
399
|
-
'source-layer': 'boundary_labels',
|
|
400
|
-
filter: ['all',
|
|
401
|
-
['in', 'admin_level', 2, '2'],
|
|
402
|
-
['>=', 'way_area', 90000000],
|
|
403
|
-
],
|
|
404
|
-
layout: { 'text-field': nameField },
|
|
405
|
-
},
|
|
406
|
-
// marking
|
|
407
|
-
{
|
|
408
|
-
id: 'marking-oneway', // streets → oneway
|
|
409
|
-
type: 'symbol',
|
|
410
|
-
'source-layer': 'streets',
|
|
411
|
-
filter: ['all',
|
|
412
|
-
['==', 'oneway', true],
|
|
413
|
-
['in', 'kind', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'living_street'],
|
|
414
|
-
],
|
|
415
|
-
layout: {
|
|
416
|
-
'symbol-placement': 'line',
|
|
417
|
-
'symbol-spacing': 175,
|
|
418
|
-
'icon-rotate': 90,
|
|
419
|
-
'icon-rotation-alignment': 'map',
|
|
420
|
-
'icon-padding': 5,
|
|
421
|
-
'symbol-avoid-edges': true,
|
|
422
|
-
},
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
id: 'marking-oneway-reverse', // oneway_reverse
|
|
426
|
-
type: 'symbol',
|
|
427
|
-
'source-layer': 'streets',
|
|
428
|
-
filter: ['all',
|
|
429
|
-
['==', 'oneway_reverse', true],
|
|
430
|
-
['in', 'kind', 'trunk', 'primary', 'secondary', 'tertiary', 'unclassified', 'residential', 'living_street'],
|
|
431
|
-
],
|
|
432
|
-
layout: {
|
|
433
|
-
'symbol-placement': 'line',
|
|
434
|
-
'symbol-spacing': 75,
|
|
435
|
-
'icon-rotate': -90,
|
|
436
|
-
'icon-rotation-alignment': 'map',
|
|
437
|
-
'icon-padding': 5,
|
|
438
|
-
'symbol-avoid-edges': true,
|
|
439
|
-
},
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
id: 'marking-bicycle', // bicycle=designated or kind=cycleway
|
|
443
|
-
type: 'symbol',
|
|
444
|
-
'source-layer': 'streets',
|
|
445
|
-
filter: ['all',
|
|
446
|
-
['==', 'bicycle', 'designated'],
|
|
447
|
-
['==', 'kind', 'cycleway'],
|
|
448
|
-
],
|
|
449
|
-
layout: {
|
|
450
|
-
'symbol-placement': 'line',
|
|
451
|
-
'symbol-spacing': 50,
|
|
452
|
-
},
|
|
453
|
-
},
|
|
454
|
-
// symbol
|
|
455
|
-
{
|
|
456
|
-
id: 'symbol-transit-bus',
|
|
457
|
-
type: 'symbol',
|
|
458
|
-
'source-layer': 'public_transport',
|
|
459
|
-
filter: ['==', 'kind', 'bus_stop'],
|
|
460
|
-
layout: { 'text-field': nameField },
|
|
461
|
-
},
|
|
462
|
-
{
|
|
463
|
-
id: 'symbol-transit-tram',
|
|
464
|
-
type: 'symbol',
|
|
465
|
-
'source-layer': 'public_transport',
|
|
466
|
-
filter: ['==', 'kind', 'tram_stop'],
|
|
467
|
-
layout: { 'text-field': nameField },
|
|
468
|
-
},
|
|
469
|
-
{
|
|
470
|
-
id: 'symbol-transit-subway',
|
|
471
|
-
type: 'symbol',
|
|
472
|
-
'source-layer': 'public_transport',
|
|
473
|
-
filter: ['all',
|
|
474
|
-
['in', 'kind', 'station', 'halt'],
|
|
475
|
-
['==', 'station', 'subway'],
|
|
476
|
-
],
|
|
477
|
-
layout: { 'text-field': nameField },
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
id: 'symbol-transit-lightrail',
|
|
481
|
-
type: 'symbol',
|
|
482
|
-
'source-layer': 'public_transport',
|
|
483
|
-
filter: ['all',
|
|
484
|
-
['in', 'kind', 'station', 'halt'],
|
|
485
|
-
['==', 'station', 'light_rail'],
|
|
486
|
-
],
|
|
487
|
-
layout: { 'text-field': nameField },
|
|
488
|
-
},
|
|
489
|
-
{
|
|
490
|
-
id: 'symbol-transit-station',
|
|
491
|
-
type: 'symbol',
|
|
492
|
-
'source-layer': 'public_transport',
|
|
493
|
-
filter: ['all',
|
|
494
|
-
['in', 'kind', 'station', 'halt'],
|
|
495
|
-
['!in', 'station', 'light_rail', 'subway'],
|
|
496
|
-
],
|
|
497
|
-
layout: { 'text-field': nameField },
|
|
498
|
-
},
|
|
499
|
-
{
|
|
500
|
-
id: 'symbol-transit-airfield',
|
|
501
|
-
type: 'symbol',
|
|
502
|
-
'source-layer': 'public_transport',
|
|
503
|
-
filter: ['all',
|
|
504
|
-
['==', 'kind', 'aerodrome'],
|
|
505
|
-
['!has', 'iata'],
|
|
506
|
-
],
|
|
507
|
-
layout: { 'text-field': nameField },
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
id: 'symbol-transit-airport',
|
|
511
|
-
type: 'symbol',
|
|
512
|
-
'source-layer': 'public_transport',
|
|
513
|
-
filter: ['all',
|
|
514
|
-
['==', 'kind', 'aerodrome'],
|
|
515
|
-
['has', 'iata'],
|
|
516
|
-
],
|
|
517
|
-
layout: { 'text-field': nameField },
|
|
518
|
-
},
|
|
519
|
-
];
|
|
520
|
-
}
|
|
521
|
-
//# sourceMappingURL=layers.js.map
|