@geogdev/styles 0.1.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/README.md +189 -0
- package/dist/cjs/index.cjs +16 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/index.d.cts +325 -0
- package/dist/esm/index.d.ts +325 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/styles/dark.json +2909 -0
- package/dist/styles/gray.json +2909 -0
- package/dist/styles/light.json +2909 -0
- package/dist/styles/warm.json +2909 -0
- package/dist/styles.js +16 -0
- package/dist/styles.js.map +1 -0
- package/package.json +52 -0
- package/src/cli.ts +27 -0
- package/src/config/features.json +48 -0
- package/src/config/languages.json +207 -0
- package/src/config/poi.json +205 -0
- package/src/config/styles/dark.json +129 -0
- package/src/config/styles/gray.json +129 -0
- package/src/config/styles/light.json +129 -0
- package/src/config/styles/warm.json +129 -0
- package/src/config/zoom.json +40 -0
- package/src/constants.ts +243 -0
- package/src/generateStyle.ts +70 -0
- package/src/index.ts +76 -0
- package/src/language.ts +320 -0
- package/src/layers/background.ts +91 -0
- package/src/layers/boundaries.ts +51 -0
- package/src/layers/buildings.ts +23 -0
- package/src/layers/index.ts +132 -0
- package/src/layers/labels.ts +775 -0
- package/src/layers/landcover.ts +323 -0
- package/src/layers/pois.ts +165 -0
- package/src/layers/roads.ts +688 -0
- package/src/layers/transit.ts +232 -0
- package/src/styles.ts +182 -0
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { LayerSpecification, FilterSpecification, ExpressionSpecification, SymbolLayerSpecification, LineLayerSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
|
|
3
|
+
interface LanguageScriptPair {
|
|
4
|
+
lang: string;
|
|
5
|
+
full_name: string;
|
|
6
|
+
script: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LANGUAGE_SCRIPT_PAIRS: LanguageScriptPair[];
|
|
9
|
+
declare function getCountryName(lang: string, script?: string): (string | (string | string[])[] | {
|
|
10
|
+
"text-font": (string | string[])[];
|
|
11
|
+
} | {
|
|
12
|
+
"text-font"?: undefined;
|
|
13
|
+
})[];
|
|
14
|
+
declare function getMultilineName(lang: string, script?: string, regular?: string): (string | (string | (string | (string | string[])[] | {
|
|
15
|
+
"text-font": (string | string[])[];
|
|
16
|
+
} | {
|
|
17
|
+
"text-font"?: undefined;
|
|
18
|
+
})[] | (string | (string | {
|
|
19
|
+
"text-font"?: undefined;
|
|
20
|
+
} | (string | (string | (string | string[])[])[])[] | {
|
|
21
|
+
"text-font": (string | (string | string[])[])[];
|
|
22
|
+
})[])[])[] | (string | (string | (string | string[])[] | {
|
|
23
|
+
"text-font": (string | (string | string[])[])[];
|
|
24
|
+
} | {
|
|
25
|
+
"text-font"?: undefined;
|
|
26
|
+
})[] | (string | (string | (string | (string | string[])[])[])[] | (string | (string | string[])[] | {
|
|
27
|
+
"text-font": (string | (string | string[])[])[];
|
|
28
|
+
} | {
|
|
29
|
+
"text-font"?: undefined;
|
|
30
|
+
})[])[])[])[];
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Valid style name strings
|
|
34
|
+
*/
|
|
35
|
+
declare const STYLE_NAMES: readonly ["light", "dark", "gray", "warm"];
|
|
36
|
+
/**
|
|
37
|
+
* Type for valid style names
|
|
38
|
+
*/
|
|
39
|
+
type StyleName = (typeof STYLE_NAMES)[number];
|
|
40
|
+
/**
|
|
41
|
+
* Type guard to check if a string is a valid style name
|
|
42
|
+
*/
|
|
43
|
+
declare function isValidStyleName(name: string): name is StyleName;
|
|
44
|
+
interface Style {
|
|
45
|
+
background: string;
|
|
46
|
+
earth: string;
|
|
47
|
+
park_a: string;
|
|
48
|
+
park_b: string;
|
|
49
|
+
hospital: string;
|
|
50
|
+
industrial: string;
|
|
51
|
+
school: string;
|
|
52
|
+
wood_a: string;
|
|
53
|
+
wood_b: string;
|
|
54
|
+
pedestrian: string;
|
|
55
|
+
scrub_a: string;
|
|
56
|
+
scrub_b: string;
|
|
57
|
+
glacier: string;
|
|
58
|
+
sand: string;
|
|
59
|
+
beach: string;
|
|
60
|
+
aerodrome: string;
|
|
61
|
+
runway: string;
|
|
62
|
+
water: string;
|
|
63
|
+
zoo: string;
|
|
64
|
+
military: string;
|
|
65
|
+
tunnel_other_casing: string;
|
|
66
|
+
tunnel_minor_casing: string;
|
|
67
|
+
tunnel_link_casing: string;
|
|
68
|
+
tunnel_major_casing: string;
|
|
69
|
+
tunnel_highway_casing: string;
|
|
70
|
+
tunnel_other: string;
|
|
71
|
+
tunnel_minor: string;
|
|
72
|
+
tunnel_link: string;
|
|
73
|
+
tunnel_major: string;
|
|
74
|
+
tunnel_highway: string;
|
|
75
|
+
pier: string;
|
|
76
|
+
buildings: string;
|
|
77
|
+
minor_service_casing: string;
|
|
78
|
+
minor_casing: string;
|
|
79
|
+
link_casing: string;
|
|
80
|
+
major_casing_late: string;
|
|
81
|
+
highway_casing_late: string;
|
|
82
|
+
other: string;
|
|
83
|
+
minor_service: string;
|
|
84
|
+
minor_a: string;
|
|
85
|
+
minor_b: string;
|
|
86
|
+
link: string;
|
|
87
|
+
major_casing_early: string;
|
|
88
|
+
major: string;
|
|
89
|
+
highway_casing_early: string;
|
|
90
|
+
highway: string;
|
|
91
|
+
railway: string;
|
|
92
|
+
boundaries: string;
|
|
93
|
+
bridges_other_casing: string;
|
|
94
|
+
bridges_minor_casing: string;
|
|
95
|
+
bridges_link_casing: string;
|
|
96
|
+
bridges_major_casing: string;
|
|
97
|
+
bridges_highway_casing: string;
|
|
98
|
+
bridges_other: string;
|
|
99
|
+
bridges_minor: string;
|
|
100
|
+
bridges_link: string;
|
|
101
|
+
bridges_major: string;
|
|
102
|
+
bridges_highway: string;
|
|
103
|
+
roads_label_minor: string;
|
|
104
|
+
roads_label_minor_halo: string;
|
|
105
|
+
roads_label_major: string;
|
|
106
|
+
roads_label_major_halo: string;
|
|
107
|
+
ocean_label: string;
|
|
108
|
+
subplace_label: string;
|
|
109
|
+
subplace_label_halo: string;
|
|
110
|
+
city_label: string;
|
|
111
|
+
city_label_halo: string;
|
|
112
|
+
state_label: string;
|
|
113
|
+
state_label_halo: string;
|
|
114
|
+
country_label: string;
|
|
115
|
+
address_label: string;
|
|
116
|
+
address_label_halo: string;
|
|
117
|
+
regular?: string;
|
|
118
|
+
bold?: string;
|
|
119
|
+
italic?: string;
|
|
120
|
+
medium?: string;
|
|
121
|
+
pois?: Pois;
|
|
122
|
+
landcover?: Landcover;
|
|
123
|
+
shields?: Shields;
|
|
124
|
+
transit_rail?: string;
|
|
125
|
+
transit_freight?: string;
|
|
126
|
+
transit_bus?: string;
|
|
127
|
+
transit_heritage?: string;
|
|
128
|
+
}
|
|
129
|
+
interface Pois {
|
|
130
|
+
blue: string;
|
|
131
|
+
green: string;
|
|
132
|
+
lapis: string;
|
|
133
|
+
pink: string;
|
|
134
|
+
red: string;
|
|
135
|
+
slategray: string;
|
|
136
|
+
tangerine: string;
|
|
137
|
+
turquoise: string;
|
|
138
|
+
}
|
|
139
|
+
interface Landcover {
|
|
140
|
+
barren: string;
|
|
141
|
+
farmland: string;
|
|
142
|
+
forest: string;
|
|
143
|
+
glacier: string;
|
|
144
|
+
grassland: string;
|
|
145
|
+
scrub: string;
|
|
146
|
+
urban_area: string;
|
|
147
|
+
rock: string;
|
|
148
|
+
wetland: string;
|
|
149
|
+
}
|
|
150
|
+
interface Shields {
|
|
151
|
+
interstate_fill: string;
|
|
152
|
+
interstate_stroke: string;
|
|
153
|
+
interstate_text: string;
|
|
154
|
+
us_highway_fill: string;
|
|
155
|
+
us_highway_stroke: string;
|
|
156
|
+
us_highway_text: string;
|
|
157
|
+
state_fill: string;
|
|
158
|
+
state_stroke: string;
|
|
159
|
+
state_text: string;
|
|
160
|
+
county_fill: string;
|
|
161
|
+
county_stroke: string;
|
|
162
|
+
county_text: string;
|
|
163
|
+
default_fill: string;
|
|
164
|
+
default_stroke: string;
|
|
165
|
+
default_text: string;
|
|
166
|
+
banner_text: string;
|
|
167
|
+
banner_text_halo: string;
|
|
168
|
+
}
|
|
169
|
+
declare const LIGHT: Style;
|
|
170
|
+
declare const DARK: Style;
|
|
171
|
+
declare const GRAY: Style;
|
|
172
|
+
declare const WARM: Style;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Creates background and base terrain layers
|
|
176
|
+
*/
|
|
177
|
+
declare function createBackgroundLayers(source: string, style: Style): LayerSpecification[];
|
|
178
|
+
/**
|
|
179
|
+
* Creates water layers (polygons and waterways)
|
|
180
|
+
*/
|
|
181
|
+
declare function createWaterLayers(source: string, style: Style): LayerSpecification[];
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Creates administrative boundary layers
|
|
185
|
+
*/
|
|
186
|
+
declare function createBoundaryLayers(source: string, style: Style): LayerSpecification[];
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Creates building layers
|
|
190
|
+
*/
|
|
191
|
+
declare function createBuildingLayers(source: string, style: Style): LayerSpecification[];
|
|
192
|
+
|
|
193
|
+
type FontStyle = "regular" | "italic" | "bold" | "medium";
|
|
194
|
+
interface LabelLayerConfig {
|
|
195
|
+
id: string;
|
|
196
|
+
source: string;
|
|
197
|
+
sourceLayer: string;
|
|
198
|
+
style: Style;
|
|
199
|
+
lang: string;
|
|
200
|
+
script?: string;
|
|
201
|
+
filter?: FilterSpecification;
|
|
202
|
+
minzoom?: number;
|
|
203
|
+
maxzoom?: number;
|
|
204
|
+
fontStyle?: FontStyle;
|
|
205
|
+
textSize?: number | ExpressionSpecification;
|
|
206
|
+
textColor: string;
|
|
207
|
+
haloColor: string;
|
|
208
|
+
haloWidth?: number;
|
|
209
|
+
letterSpacing?: number;
|
|
210
|
+
maxWidth?: number;
|
|
211
|
+
textTransform?: "uppercase" | "lowercase" | "none";
|
|
212
|
+
symbolPlacement?: "point" | "line" | "line-center";
|
|
213
|
+
useCountryName?: boolean;
|
|
214
|
+
}
|
|
215
|
+
declare function createLabelLayer(config: LabelLayerConfig): SymbolLayerSpecification;
|
|
216
|
+
/**
|
|
217
|
+
* Creates water label layers (ocean, lakes, waterways)
|
|
218
|
+
*/
|
|
219
|
+
declare function createWaterLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
220
|
+
/**
|
|
221
|
+
* Creates road label layers
|
|
222
|
+
*/
|
|
223
|
+
declare function createRoadLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
224
|
+
/**
|
|
225
|
+
* Creates place label layers (countries, states, cities, subplaces)
|
|
226
|
+
*/
|
|
227
|
+
declare function createPlaceLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
228
|
+
/**
|
|
229
|
+
* Creates address and island labels
|
|
230
|
+
*/
|
|
231
|
+
declare function createMiscLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Creates landcover layers (natural features)
|
|
235
|
+
*/
|
|
236
|
+
declare function createLandcoverLayers(source: string, style: Style): LayerSpecification[];
|
|
237
|
+
/**
|
|
238
|
+
* Creates park layers
|
|
239
|
+
*/
|
|
240
|
+
declare function createParkLayers(source: string, style: Style): LayerSpecification[];
|
|
241
|
+
/**
|
|
242
|
+
* Creates landuse layers (human-made features)
|
|
243
|
+
*/
|
|
244
|
+
declare function createLanduseLayers(source: string, style: Style): LayerSpecification[];
|
|
245
|
+
/**
|
|
246
|
+
* Creates aeroway layers
|
|
247
|
+
*/
|
|
248
|
+
declare function createAerowayLayers(source: string, style: Style): LayerSpecification[];
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Creates POI (points of interest) layers
|
|
252
|
+
* Uses tiered zoom levels for progressive disclosure
|
|
253
|
+
*/
|
|
254
|
+
declare function createPoiLayers(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
255
|
+
|
|
256
|
+
type RoadCategory = "other" | "minor" | "link" | "major" | "highway";
|
|
257
|
+
type BrunnelType = "tunnel" | "bridge" | null;
|
|
258
|
+
interface RoadLayerConfig {
|
|
259
|
+
source: string;
|
|
260
|
+
style: Style;
|
|
261
|
+
brunnel: BrunnelType;
|
|
262
|
+
category: RoadCategory;
|
|
263
|
+
isCasing: boolean;
|
|
264
|
+
minzoom?: number;
|
|
265
|
+
maxzoom?: number;
|
|
266
|
+
}
|
|
267
|
+
declare function createRoadLayer(config: RoadLayerConfig): LineLayerSpecification;
|
|
268
|
+
/**
|
|
269
|
+
* Creates all tunnel road layers (casing + fill for each category)
|
|
270
|
+
*/
|
|
271
|
+
declare function createTunnelLayers(source: string, style: Style): LayerSpecification[];
|
|
272
|
+
/**
|
|
273
|
+
* Creates all regular (non-tunnel, non-bridge) road layers
|
|
274
|
+
*/
|
|
275
|
+
declare function createRoadLayers(source: string, style: Style): LayerSpecification[];
|
|
276
|
+
/**
|
|
277
|
+
* Creates all bridge road layers (casing + fill for each category)
|
|
278
|
+
*/
|
|
279
|
+
declare function createBridgeLayers(source: string, style: Style): LayerSpecification[];
|
|
280
|
+
/**
|
|
281
|
+
* Creates pier layer (special road type)
|
|
282
|
+
*/
|
|
283
|
+
declare function createPierLayer(source: string, style: Style): LayerSpecification;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Creates transit infrastructure layers (rail, bus, ferry)
|
|
287
|
+
* Progressive disclosure: main rail z10, freight z11, heritage/bus z13
|
|
288
|
+
*/
|
|
289
|
+
declare function createTransitLayers(source: string, style: Style): LayerSpecification[];
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Layer generation module
|
|
293
|
+
*
|
|
294
|
+
* This module coordinates the creation of all MapLibre GL layers
|
|
295
|
+
* from the component modules.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Creates all non-label layers (fills, lines, symbols without text)
|
|
300
|
+
*/
|
|
301
|
+
declare function nolabelsLayers(source: string, style: Style): LayerSpecification[];
|
|
302
|
+
/**
|
|
303
|
+
* Creates all label layers (text symbols)
|
|
304
|
+
*/
|
|
305
|
+
declare function labelsLayers(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Returns a named style by string identifier
|
|
309
|
+
* @throws Error if style name is not found
|
|
310
|
+
*/
|
|
311
|
+
declare function namedStyle(name: string): Style;
|
|
312
|
+
/**
|
|
313
|
+
* Generates all MapLibre GL layers for a given style
|
|
314
|
+
* @param source - The source ID to use for layers
|
|
315
|
+
* @param style - The style theme to apply
|
|
316
|
+
* @param options - Optional configuration
|
|
317
|
+
* @param options.labelsOnly - If true, only generate label layers
|
|
318
|
+
* @param options.lang - Language code for labels (required for label layers)
|
|
319
|
+
*/
|
|
320
|
+
declare function layers(source: string, style: Style, options?: {
|
|
321
|
+
labelsOnly?: boolean;
|
|
322
|
+
lang?: string;
|
|
323
|
+
}): LayerSpecification[];
|
|
324
|
+
|
|
325
|
+
export { DARK, GRAY, LANGUAGE_SCRIPT_PAIRS, LIGHT, type Landcover, type Pois, STYLE_NAMES, type Shields, type Style, type StyleName, WARM, createAerowayLayers, createBackgroundLayers, createBoundaryLayers, createBridgeLayers, createBuildingLayers, createLabelLayer, createLandcoverLayers, createLanduseLayers, createMiscLabels, createParkLayers, createPierLayer, createPlaceLabels, createPoiLayers, createRoadLabels, createRoadLayer, createRoadLayers, createTransitLayers, createTunnelLayers, createWaterLabels, createWaterLayers, getCountryName, getMultilineName, isValidStyleName, labelsLayers, layers, namedStyle, nolabelsLayers };
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { LayerSpecification, FilterSpecification, ExpressionSpecification, SymbolLayerSpecification, LineLayerSpecification } from '@maplibre/maplibre-gl-style-spec';
|
|
2
|
+
|
|
3
|
+
interface LanguageScriptPair {
|
|
4
|
+
lang: string;
|
|
5
|
+
full_name: string;
|
|
6
|
+
script: string;
|
|
7
|
+
}
|
|
8
|
+
declare const LANGUAGE_SCRIPT_PAIRS: LanguageScriptPair[];
|
|
9
|
+
declare function getCountryName(lang: string, script?: string): (string | (string | string[])[] | {
|
|
10
|
+
"text-font": (string | string[])[];
|
|
11
|
+
} | {
|
|
12
|
+
"text-font"?: undefined;
|
|
13
|
+
})[];
|
|
14
|
+
declare function getMultilineName(lang: string, script?: string, regular?: string): (string | (string | (string | (string | string[])[] | {
|
|
15
|
+
"text-font": (string | string[])[];
|
|
16
|
+
} | {
|
|
17
|
+
"text-font"?: undefined;
|
|
18
|
+
})[] | (string | (string | {
|
|
19
|
+
"text-font"?: undefined;
|
|
20
|
+
} | (string | (string | (string | string[])[])[])[] | {
|
|
21
|
+
"text-font": (string | (string | string[])[])[];
|
|
22
|
+
})[])[])[] | (string | (string | (string | string[])[] | {
|
|
23
|
+
"text-font": (string | (string | string[])[])[];
|
|
24
|
+
} | {
|
|
25
|
+
"text-font"?: undefined;
|
|
26
|
+
})[] | (string | (string | (string | (string | string[])[])[])[] | (string | (string | string[])[] | {
|
|
27
|
+
"text-font": (string | (string | string[])[])[];
|
|
28
|
+
} | {
|
|
29
|
+
"text-font"?: undefined;
|
|
30
|
+
})[])[])[])[];
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Valid style name strings
|
|
34
|
+
*/
|
|
35
|
+
declare const STYLE_NAMES: readonly ["light", "dark", "gray", "warm"];
|
|
36
|
+
/**
|
|
37
|
+
* Type for valid style names
|
|
38
|
+
*/
|
|
39
|
+
type StyleName = (typeof STYLE_NAMES)[number];
|
|
40
|
+
/**
|
|
41
|
+
* Type guard to check if a string is a valid style name
|
|
42
|
+
*/
|
|
43
|
+
declare function isValidStyleName(name: string): name is StyleName;
|
|
44
|
+
interface Style {
|
|
45
|
+
background: string;
|
|
46
|
+
earth: string;
|
|
47
|
+
park_a: string;
|
|
48
|
+
park_b: string;
|
|
49
|
+
hospital: string;
|
|
50
|
+
industrial: string;
|
|
51
|
+
school: string;
|
|
52
|
+
wood_a: string;
|
|
53
|
+
wood_b: string;
|
|
54
|
+
pedestrian: string;
|
|
55
|
+
scrub_a: string;
|
|
56
|
+
scrub_b: string;
|
|
57
|
+
glacier: string;
|
|
58
|
+
sand: string;
|
|
59
|
+
beach: string;
|
|
60
|
+
aerodrome: string;
|
|
61
|
+
runway: string;
|
|
62
|
+
water: string;
|
|
63
|
+
zoo: string;
|
|
64
|
+
military: string;
|
|
65
|
+
tunnel_other_casing: string;
|
|
66
|
+
tunnel_minor_casing: string;
|
|
67
|
+
tunnel_link_casing: string;
|
|
68
|
+
tunnel_major_casing: string;
|
|
69
|
+
tunnel_highway_casing: string;
|
|
70
|
+
tunnel_other: string;
|
|
71
|
+
tunnel_minor: string;
|
|
72
|
+
tunnel_link: string;
|
|
73
|
+
tunnel_major: string;
|
|
74
|
+
tunnel_highway: string;
|
|
75
|
+
pier: string;
|
|
76
|
+
buildings: string;
|
|
77
|
+
minor_service_casing: string;
|
|
78
|
+
minor_casing: string;
|
|
79
|
+
link_casing: string;
|
|
80
|
+
major_casing_late: string;
|
|
81
|
+
highway_casing_late: string;
|
|
82
|
+
other: string;
|
|
83
|
+
minor_service: string;
|
|
84
|
+
minor_a: string;
|
|
85
|
+
minor_b: string;
|
|
86
|
+
link: string;
|
|
87
|
+
major_casing_early: string;
|
|
88
|
+
major: string;
|
|
89
|
+
highway_casing_early: string;
|
|
90
|
+
highway: string;
|
|
91
|
+
railway: string;
|
|
92
|
+
boundaries: string;
|
|
93
|
+
bridges_other_casing: string;
|
|
94
|
+
bridges_minor_casing: string;
|
|
95
|
+
bridges_link_casing: string;
|
|
96
|
+
bridges_major_casing: string;
|
|
97
|
+
bridges_highway_casing: string;
|
|
98
|
+
bridges_other: string;
|
|
99
|
+
bridges_minor: string;
|
|
100
|
+
bridges_link: string;
|
|
101
|
+
bridges_major: string;
|
|
102
|
+
bridges_highway: string;
|
|
103
|
+
roads_label_minor: string;
|
|
104
|
+
roads_label_minor_halo: string;
|
|
105
|
+
roads_label_major: string;
|
|
106
|
+
roads_label_major_halo: string;
|
|
107
|
+
ocean_label: string;
|
|
108
|
+
subplace_label: string;
|
|
109
|
+
subplace_label_halo: string;
|
|
110
|
+
city_label: string;
|
|
111
|
+
city_label_halo: string;
|
|
112
|
+
state_label: string;
|
|
113
|
+
state_label_halo: string;
|
|
114
|
+
country_label: string;
|
|
115
|
+
address_label: string;
|
|
116
|
+
address_label_halo: string;
|
|
117
|
+
regular?: string;
|
|
118
|
+
bold?: string;
|
|
119
|
+
italic?: string;
|
|
120
|
+
medium?: string;
|
|
121
|
+
pois?: Pois;
|
|
122
|
+
landcover?: Landcover;
|
|
123
|
+
shields?: Shields;
|
|
124
|
+
transit_rail?: string;
|
|
125
|
+
transit_freight?: string;
|
|
126
|
+
transit_bus?: string;
|
|
127
|
+
transit_heritage?: string;
|
|
128
|
+
}
|
|
129
|
+
interface Pois {
|
|
130
|
+
blue: string;
|
|
131
|
+
green: string;
|
|
132
|
+
lapis: string;
|
|
133
|
+
pink: string;
|
|
134
|
+
red: string;
|
|
135
|
+
slategray: string;
|
|
136
|
+
tangerine: string;
|
|
137
|
+
turquoise: string;
|
|
138
|
+
}
|
|
139
|
+
interface Landcover {
|
|
140
|
+
barren: string;
|
|
141
|
+
farmland: string;
|
|
142
|
+
forest: string;
|
|
143
|
+
glacier: string;
|
|
144
|
+
grassland: string;
|
|
145
|
+
scrub: string;
|
|
146
|
+
urban_area: string;
|
|
147
|
+
rock: string;
|
|
148
|
+
wetland: string;
|
|
149
|
+
}
|
|
150
|
+
interface Shields {
|
|
151
|
+
interstate_fill: string;
|
|
152
|
+
interstate_stroke: string;
|
|
153
|
+
interstate_text: string;
|
|
154
|
+
us_highway_fill: string;
|
|
155
|
+
us_highway_stroke: string;
|
|
156
|
+
us_highway_text: string;
|
|
157
|
+
state_fill: string;
|
|
158
|
+
state_stroke: string;
|
|
159
|
+
state_text: string;
|
|
160
|
+
county_fill: string;
|
|
161
|
+
county_stroke: string;
|
|
162
|
+
county_text: string;
|
|
163
|
+
default_fill: string;
|
|
164
|
+
default_stroke: string;
|
|
165
|
+
default_text: string;
|
|
166
|
+
banner_text: string;
|
|
167
|
+
banner_text_halo: string;
|
|
168
|
+
}
|
|
169
|
+
declare const LIGHT: Style;
|
|
170
|
+
declare const DARK: Style;
|
|
171
|
+
declare const GRAY: Style;
|
|
172
|
+
declare const WARM: Style;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Creates background and base terrain layers
|
|
176
|
+
*/
|
|
177
|
+
declare function createBackgroundLayers(source: string, style: Style): LayerSpecification[];
|
|
178
|
+
/**
|
|
179
|
+
* Creates water layers (polygons and waterways)
|
|
180
|
+
*/
|
|
181
|
+
declare function createWaterLayers(source: string, style: Style): LayerSpecification[];
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Creates administrative boundary layers
|
|
185
|
+
*/
|
|
186
|
+
declare function createBoundaryLayers(source: string, style: Style): LayerSpecification[];
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Creates building layers
|
|
190
|
+
*/
|
|
191
|
+
declare function createBuildingLayers(source: string, style: Style): LayerSpecification[];
|
|
192
|
+
|
|
193
|
+
type FontStyle = "regular" | "italic" | "bold" | "medium";
|
|
194
|
+
interface LabelLayerConfig {
|
|
195
|
+
id: string;
|
|
196
|
+
source: string;
|
|
197
|
+
sourceLayer: string;
|
|
198
|
+
style: Style;
|
|
199
|
+
lang: string;
|
|
200
|
+
script?: string;
|
|
201
|
+
filter?: FilterSpecification;
|
|
202
|
+
minzoom?: number;
|
|
203
|
+
maxzoom?: number;
|
|
204
|
+
fontStyle?: FontStyle;
|
|
205
|
+
textSize?: number | ExpressionSpecification;
|
|
206
|
+
textColor: string;
|
|
207
|
+
haloColor: string;
|
|
208
|
+
haloWidth?: number;
|
|
209
|
+
letterSpacing?: number;
|
|
210
|
+
maxWidth?: number;
|
|
211
|
+
textTransform?: "uppercase" | "lowercase" | "none";
|
|
212
|
+
symbolPlacement?: "point" | "line" | "line-center";
|
|
213
|
+
useCountryName?: boolean;
|
|
214
|
+
}
|
|
215
|
+
declare function createLabelLayer(config: LabelLayerConfig): SymbolLayerSpecification;
|
|
216
|
+
/**
|
|
217
|
+
* Creates water label layers (ocean, lakes, waterways)
|
|
218
|
+
*/
|
|
219
|
+
declare function createWaterLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
220
|
+
/**
|
|
221
|
+
* Creates road label layers
|
|
222
|
+
*/
|
|
223
|
+
declare function createRoadLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
224
|
+
/**
|
|
225
|
+
* Creates place label layers (countries, states, cities, subplaces)
|
|
226
|
+
*/
|
|
227
|
+
declare function createPlaceLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
228
|
+
/**
|
|
229
|
+
* Creates address and island labels
|
|
230
|
+
*/
|
|
231
|
+
declare function createMiscLabels(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* Creates landcover layers (natural features)
|
|
235
|
+
*/
|
|
236
|
+
declare function createLandcoverLayers(source: string, style: Style): LayerSpecification[];
|
|
237
|
+
/**
|
|
238
|
+
* Creates park layers
|
|
239
|
+
*/
|
|
240
|
+
declare function createParkLayers(source: string, style: Style): LayerSpecification[];
|
|
241
|
+
/**
|
|
242
|
+
* Creates landuse layers (human-made features)
|
|
243
|
+
*/
|
|
244
|
+
declare function createLanduseLayers(source: string, style: Style): LayerSpecification[];
|
|
245
|
+
/**
|
|
246
|
+
* Creates aeroway layers
|
|
247
|
+
*/
|
|
248
|
+
declare function createAerowayLayers(source: string, style: Style): LayerSpecification[];
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Creates POI (points of interest) layers
|
|
252
|
+
* Uses tiered zoom levels for progressive disclosure
|
|
253
|
+
*/
|
|
254
|
+
declare function createPoiLayers(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
255
|
+
|
|
256
|
+
type RoadCategory = "other" | "minor" | "link" | "major" | "highway";
|
|
257
|
+
type BrunnelType = "tunnel" | "bridge" | null;
|
|
258
|
+
interface RoadLayerConfig {
|
|
259
|
+
source: string;
|
|
260
|
+
style: Style;
|
|
261
|
+
brunnel: BrunnelType;
|
|
262
|
+
category: RoadCategory;
|
|
263
|
+
isCasing: boolean;
|
|
264
|
+
minzoom?: number;
|
|
265
|
+
maxzoom?: number;
|
|
266
|
+
}
|
|
267
|
+
declare function createRoadLayer(config: RoadLayerConfig): LineLayerSpecification;
|
|
268
|
+
/**
|
|
269
|
+
* Creates all tunnel road layers (casing + fill for each category)
|
|
270
|
+
*/
|
|
271
|
+
declare function createTunnelLayers(source: string, style: Style): LayerSpecification[];
|
|
272
|
+
/**
|
|
273
|
+
* Creates all regular (non-tunnel, non-bridge) road layers
|
|
274
|
+
*/
|
|
275
|
+
declare function createRoadLayers(source: string, style: Style): LayerSpecification[];
|
|
276
|
+
/**
|
|
277
|
+
* Creates all bridge road layers (casing + fill for each category)
|
|
278
|
+
*/
|
|
279
|
+
declare function createBridgeLayers(source: string, style: Style): LayerSpecification[];
|
|
280
|
+
/**
|
|
281
|
+
* Creates pier layer (special road type)
|
|
282
|
+
*/
|
|
283
|
+
declare function createPierLayer(source: string, style: Style): LayerSpecification;
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* Creates transit infrastructure layers (rail, bus, ferry)
|
|
287
|
+
* Progressive disclosure: main rail z10, freight z11, heritage/bus z13
|
|
288
|
+
*/
|
|
289
|
+
declare function createTransitLayers(source: string, style: Style): LayerSpecification[];
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Layer generation module
|
|
293
|
+
*
|
|
294
|
+
* This module coordinates the creation of all MapLibre GL layers
|
|
295
|
+
* from the component modules.
|
|
296
|
+
*/
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Creates all non-label layers (fills, lines, symbols without text)
|
|
300
|
+
*/
|
|
301
|
+
declare function nolabelsLayers(source: string, style: Style): LayerSpecification[];
|
|
302
|
+
/**
|
|
303
|
+
* Creates all label layers (text symbols)
|
|
304
|
+
*/
|
|
305
|
+
declare function labelsLayers(source: string, style: Style, lang: string, script?: string): LayerSpecification[];
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Returns a named style by string identifier
|
|
309
|
+
* @throws Error if style name is not found
|
|
310
|
+
*/
|
|
311
|
+
declare function namedStyle(name: string): Style;
|
|
312
|
+
/**
|
|
313
|
+
* Generates all MapLibre GL layers for a given style
|
|
314
|
+
* @param source - The source ID to use for layers
|
|
315
|
+
* @param style - The style theme to apply
|
|
316
|
+
* @param options - Optional configuration
|
|
317
|
+
* @param options.labelsOnly - If true, only generate label layers
|
|
318
|
+
* @param options.lang - Language code for labels (required for label layers)
|
|
319
|
+
*/
|
|
320
|
+
declare function layers(source: string, style: Style, options?: {
|
|
321
|
+
labelsOnly?: boolean;
|
|
322
|
+
lang?: string;
|
|
323
|
+
}): LayerSpecification[];
|
|
324
|
+
|
|
325
|
+
export { DARK, GRAY, LANGUAGE_SCRIPT_PAIRS, LIGHT, type Landcover, type Pois, STYLE_NAMES, type Shields, type Style, type StyleName, WARM, createAerowayLayers, createBackgroundLayers, createBoundaryLayers, createBridgeLayers, createBuildingLayers, createLabelLayer, createLandcoverLayers, createLanduseLayers, createMiscLabels, createParkLayers, createPierLayer, createPlaceLabels, createPoiLayers, createRoadLabels, createRoadLayer, createRoadLayers, createTransitLayers, createTunnelLayers, createWaterLabels, createWaterLayers, getCountryName, getMultilineName, isValidStyleName, labelsLayers, layers, namedStyle, nolabelsLayers };
|