@tileflow/core 0.1.0-alpha.37 → 0.1.0-alpha.39
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 +10 -10
- package/dist/3d-BkaJjwfk.d.ts +1083 -0
- package/dist/3d.d.ts +1 -0
- package/dist/3d.js +12331 -0
- package/dist/browser.d.ts +788 -1409
- package/dist/browser.js +11457 -9407
- package/dist/build.d.ts +4 -3
- package/dist/build.js +1135 -203
- package/dist/capture.js +4 -1
- package/dist/config-reference.json +927 -548
- package/dist/{icon-composition-C5X3Q9Ya.d.ts → icon-composition-Ivgoxz8d.d.ts} +172 -5
- package/dist/index.d.ts +174 -5
- package/dist/index.js +1797 -330
- package/dist/{manifest-types-jrBdBrES.d.ts → manifest-types-DRy2980g.d.ts} +5 -2
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.js +4 -1
- package/dist/native-profile.d.ts +4 -0
- package/dist/native-profile.js +2 -0
- package/dist/native.js +11 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +11 -1
- package/dist/worker/camera-tile-worker.global.js +20 -0
- package/docs/application-tile-reading.md +5 -2
- package/docs/authoring-model.md +8 -0
- package/docs/buildings-3d.md +80 -12
- package/docs/compiled-style-performance.md +11 -2
- package/docs/data-is-separate-from-design.md +6 -3
- package/docs/globe-atmosphere.md +3 -0
- package/docs/native-artifact-profile.md +2 -2
- package/docs/nautical-marks.md +147 -39
- package/docs/public-api-and-browser-subpath.md +7 -2
- package/docs/street-lights.md +5 -1
- package/docs/street-sky.md +153 -0
- package/docs/sun-and-light.md +4 -2
- package/docs/trees-3d.md +11 -6
- package/package.json +6 -1
- package/dist/worker/buildings-3d-worker.global.js +0 -1
|
@@ -0,0 +1,1083 @@
|
|
|
1
|
+
/** Bounded, read-only mesh snapshot for developer tooling. Positions are x east, y north, z up. */
|
|
2
|
+
type TileflowModelInspection = Readonly<{
|
|
3
|
+
id: string;
|
|
4
|
+
module: string;
|
|
5
|
+
format: string;
|
|
6
|
+
vertices: number;
|
|
7
|
+
triangles: number;
|
|
8
|
+
bytes: number;
|
|
9
|
+
lods: number;
|
|
10
|
+
instances?: number;
|
|
11
|
+
positions: number[];
|
|
12
|
+
indices: number[];
|
|
13
|
+
colors?: string[];
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
declare const expressionBrand: unique symbol;
|
|
17
|
+
declare const themeValueBrand: unique symbol;
|
|
18
|
+
declare const zoomBrand: unique symbol;
|
|
19
|
+
declare const tileflowThemeTokenCategories: readonly ["color", "font", "image", "number"];
|
|
20
|
+
type TileflowThemeTokenCategory = (typeof tileflowThemeTokenCategories)[number];
|
|
21
|
+
type TileflowThemeTokenPrimitive = {
|
|
22
|
+
color: string;
|
|
23
|
+
font: string;
|
|
24
|
+
image: string;
|
|
25
|
+
number: number;
|
|
26
|
+
};
|
|
27
|
+
/** A JSON-safe semantic reference. The category is carried at runtime as well as in its type. */
|
|
28
|
+
type TileflowThemeTokenReference<TCategory extends TileflowThemeTokenCategory = TileflowThemeTokenCategory> = {
|
|
29
|
+
readonly category: TCategory;
|
|
30
|
+
readonly kind: 'theme-token';
|
|
31
|
+
readonly token: string;
|
|
32
|
+
readonly [themeValueBrand]: TileflowThemeTokenPrimitive[TCategory];
|
|
33
|
+
};
|
|
34
|
+
/** An explicit opt-out from theme substitution. A reason is mandatory for auditability. */
|
|
35
|
+
type TileflowFixedValue<T> = {
|
|
36
|
+
readonly kind: 'theme-fixed';
|
|
37
|
+
readonly reason: string;
|
|
38
|
+
readonly value: T;
|
|
39
|
+
readonly [themeValueBrand]: T;
|
|
40
|
+
};
|
|
41
|
+
type TileflowThemeColorMix = {
|
|
42
|
+
readonly amount: TileflowThemeNumberValue;
|
|
43
|
+
readonly from: TileflowThemeColorValue;
|
|
44
|
+
readonly kind: 'theme-color';
|
|
45
|
+
readonly operation: 'mix';
|
|
46
|
+
readonly space: 'oklch';
|
|
47
|
+
readonly to: TileflowThemeColorValue;
|
|
48
|
+
readonly [themeValueBrand]: string;
|
|
49
|
+
};
|
|
50
|
+
type TileflowThemeColorAlpha = {
|
|
51
|
+
readonly color: TileflowThemeColorValue;
|
|
52
|
+
readonly kind: 'theme-color';
|
|
53
|
+
readonly opacity: TileflowThemeNumberValue;
|
|
54
|
+
readonly operation: 'alpha';
|
|
55
|
+
readonly [themeValueBrand]: string;
|
|
56
|
+
};
|
|
57
|
+
type TileflowThemeColorOperation = TileflowThemeColorAlpha | TileflowThemeColorMix;
|
|
58
|
+
type TileflowThemeNumberValue = number | TileflowFixedValue<number> | TileflowThemeTokenReference<'number'>;
|
|
59
|
+
type TileflowThemeColorValue = string | TileflowFixedValue<string> | TileflowThemeColorOperation | TileflowThemeTokenReference<'color'>;
|
|
60
|
+
type TileflowThemeFontValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'font'>;
|
|
61
|
+
type TileflowThemeImageValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'image'>;
|
|
62
|
+
type TileflowExpression<T> = {
|
|
63
|
+
readonly kind: 'expression';
|
|
64
|
+
readonly value: readonly unknown[];
|
|
65
|
+
/** Opaque result type. Only Tileflow's closed `expr.*` builders expose this brand publicly. */
|
|
66
|
+
readonly [expressionBrand]: T;
|
|
67
|
+
};
|
|
68
|
+
type TileflowZoomValueCommon<T> = {
|
|
69
|
+
readonly kind: 'zoom';
|
|
70
|
+
readonly stops: readonly (readonly [number, T])[];
|
|
71
|
+
readonly [zoomBrand]?: T;
|
|
72
|
+
};
|
|
73
|
+
type TileflowZoomValue<T> = TileflowZoomValueCommon<T> & ({
|
|
74
|
+
readonly base: number;
|
|
75
|
+
readonly interpolation: 'exponential';
|
|
76
|
+
} | {
|
|
77
|
+
readonly base?: never;
|
|
78
|
+
readonly interpolation: 'linear' | 'step';
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/** A color literal, semantic color token, color operation, expression, or zoom ramp. */
|
|
82
|
+
type TileflowColorStyleValue = TileflowExpression<string> | TileflowThemeColorValue | TileflowZoomValue<TileflowThemeColorValue>;
|
|
83
|
+
/** An image name, semantic image token, expression, or zoom ramp. */
|
|
84
|
+
type TileflowImageStyleValue = TileflowExpression<string> | TileflowThemeImageValue | TileflowZoomValue<TileflowThemeImageValue>;
|
|
85
|
+
/** A number, semantic number token, expression, or zoom ramp. */
|
|
86
|
+
type TileflowNumberStyleValue = TileflowExpression<number> | TileflowThemeNumberValue | TileflowZoomValue<TileflowThemeNumberValue>;
|
|
87
|
+
/** A visual numeric array whose components may be themed, or whose full shape is fixed. */
|
|
88
|
+
type TileflowThemeNumberArrayValue = readonly TileflowThemeNumberValue[] | TileflowFixedValue<readonly number[]>;
|
|
89
|
+
/** A visual numeric array, expression, or zoom ramp with explicit theme intent. */
|
|
90
|
+
type TileflowNumberArrayStyleValue = TileflowExpression<readonly number[]> | TileflowThemeNumberArrayValue | TileflowZoomValue<TileflowThemeNumberArrayValue>;
|
|
91
|
+
/** A two-dimensional visual offset with category-safe numeric components. */
|
|
92
|
+
type TileflowNumberOffsetStyleValue = readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]>>;
|
|
93
|
+
/** Top, right, bottom, and left visual insets with category-safe numeric components. */
|
|
94
|
+
type TileflowNumberInsetsStyleValue = readonly [
|
|
95
|
+
TileflowThemeNumberValue,
|
|
96
|
+
TileflowThemeNumberValue,
|
|
97
|
+
TileflowThemeNumberValue,
|
|
98
|
+
TileflowThemeNumberValue
|
|
99
|
+
] | TileflowFixedValue<readonly [number, number, number, number]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [
|
|
100
|
+
TileflowThemeNumberValue,
|
|
101
|
+
TileflowThemeNumberValue,
|
|
102
|
+
TileflowThemeNumberValue,
|
|
103
|
+
TileflowThemeNumberValue
|
|
104
|
+
] | TileflowFixedValue<readonly [number, number, number, number]>>;
|
|
105
|
+
/** A structural value that does not participate in semantic theme-token substitution. */
|
|
106
|
+
type TileflowStructuralStyleValue<T> = T | TileflowExpression<T> | TileflowZoomValue<T>;
|
|
107
|
+
/** Structural text, including expressions and zoom-dependent literal strings. */
|
|
108
|
+
type TileflowStringStyleValue = TileflowStructuralStyleValue<string>;
|
|
109
|
+
type TileflowLineCap = 'butt' | 'round' | 'square';
|
|
110
|
+
type TileflowLineJoin = 'bevel' | 'miter' | 'round';
|
|
111
|
+
type TileflowSymbolPlacement = 'line' | 'line-center' | 'point';
|
|
112
|
+
type TileflowSymbolZOrder = 'auto' | 'source' | 'viewport-y';
|
|
113
|
+
type TileflowPriorityOrder = 'higher-first' | 'lower-first';
|
|
114
|
+
type TileflowTextAnchor = 'bottom' | 'bottom-left' | 'bottom-right' | 'center' | 'left' | 'right' | 'top' | 'top-left' | 'top-right';
|
|
115
|
+
type TileflowTextJustify = 'auto' | 'center' | 'left' | 'right';
|
|
116
|
+
type TileflowIconAnchor = TileflowTextAnchor;
|
|
117
|
+
type TileflowAlignment = 'auto' | 'map' | 'viewport';
|
|
118
|
+
type TileflowIconTextFit = 'both' | 'height' | 'none' | 'width';
|
|
119
|
+
/**
|
|
120
|
+
* How a symbol part treats collisions with symbols placed before it. `never` hides it, `always`
|
|
121
|
+
* shows it, and `cooperative` shows it unless the earlier symbol was placed with `never`.
|
|
122
|
+
*/
|
|
123
|
+
type TileflowSymbolOverlap = 'always' | 'cooperative' | 'never';
|
|
124
|
+
/** Visibility and zoom bounds shared by every visual primitive. */
|
|
125
|
+
type TileflowLayerRange = {
|
|
126
|
+
maxZoom?: number;
|
|
127
|
+
minZoom?: number;
|
|
128
|
+
visible?: boolean;
|
|
129
|
+
};
|
|
130
|
+
type TileflowBackgroundPaint = {
|
|
131
|
+
color?: TileflowColorStyleValue;
|
|
132
|
+
opacity?: TileflowNumberStyleValue;
|
|
133
|
+
pattern?: TileflowImageStyleValue;
|
|
134
|
+
};
|
|
135
|
+
type TileflowBackgroundStyle = TileflowLayerRange & TileflowBackgroundPaint;
|
|
136
|
+
type TileflowFillPaint = {
|
|
137
|
+
antialias?: boolean;
|
|
138
|
+
color?: TileflowColorStyleValue;
|
|
139
|
+
opacity?: TileflowNumberStyleValue;
|
|
140
|
+
pattern?: TileflowImageStyleValue;
|
|
141
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
142
|
+
translateAnchor?: 'map' | 'viewport';
|
|
143
|
+
};
|
|
144
|
+
type TileflowFillStyle = TileflowLayerRange & TileflowFillPaint;
|
|
145
|
+
type TileflowLinePaint = {
|
|
146
|
+
blur?: TileflowNumberStyleValue;
|
|
147
|
+
color?: TileflowColorStyleValue;
|
|
148
|
+
dash?: TileflowNumberArrayStyleValue;
|
|
149
|
+
gapWidth?: TileflowNumberStyleValue;
|
|
150
|
+
offset?: TileflowNumberStyleValue;
|
|
151
|
+
opacity?: TileflowNumberStyleValue;
|
|
152
|
+
pattern?: TileflowImageStyleValue;
|
|
153
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
154
|
+
translateAnchor?: 'map' | 'viewport';
|
|
155
|
+
width?: TileflowNumberStyleValue;
|
|
156
|
+
};
|
|
157
|
+
type TileflowLineLayout = {
|
|
158
|
+
cap?: TileflowStructuralStyleValue<TileflowLineCap>;
|
|
159
|
+
join?: TileflowStructuralStyleValue<TileflowLineJoin>;
|
|
160
|
+
miterLimit?: TileflowNumberStyleValue;
|
|
161
|
+
roundLimit?: TileflowNumberStyleValue;
|
|
162
|
+
};
|
|
163
|
+
type TileflowLineStyle = TileflowLayerRange & TileflowLinePaint & TileflowLineLayout;
|
|
164
|
+
/** Repeated diagonal marks placed along a stroked geographic feature. */
|
|
165
|
+
type TileflowLineHatchStyle = TileflowLayerRange & {
|
|
166
|
+
angle?: TileflowNumberStyleValue;
|
|
167
|
+
color?: TileflowColorStyleValue;
|
|
168
|
+
opacity?: TileflowNumberStyleValue;
|
|
169
|
+
/** Sprite pattern clipped to the line deck; when set, it replaces glyph hatching. */
|
|
170
|
+
pattern?: TileflowImageStyleValue;
|
|
171
|
+
/**
|
|
172
|
+
* Intrinsic pixel heights available as `${pattern}-${width}` sprites. Tileflow
|
|
173
|
+
* selects the closest height to the rendered line width so marks retain a
|
|
174
|
+
* nearly fixed screen-pixel thickness instead of stretching with the road.
|
|
175
|
+
* Requires `pattern` to be a literal sprite-name prefix.
|
|
176
|
+
*/
|
|
177
|
+
patternWidths?: TileflowThemeNumberArrayValue;
|
|
178
|
+
size?: TileflowNumberStyleValue;
|
|
179
|
+
spacing?: TileflowNumberStyleValue;
|
|
180
|
+
};
|
|
181
|
+
type TileflowTextPaint = {
|
|
182
|
+
color?: TileflowColorStyleValue;
|
|
183
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
184
|
+
haloColor?: TileflowColorStyleValue;
|
|
185
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
186
|
+
opacity?: TileflowNumberStyleValue;
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* One opaque strip behind each shaped line of a label. Tileflow lowers it to a derived glyph stack
|
|
190
|
+
* whose cells MapLibre's text halo paints, so placement, wrapping and collision stay native.
|
|
191
|
+
*/
|
|
192
|
+
type TileflowTextBackground = {
|
|
193
|
+
/** Strip colour. Cells overlap at their joins, so the colour must be opaque. */
|
|
194
|
+
color: TileflowColorStyleValue;
|
|
195
|
+
/** `lines` fits one strip to each shaped line. */
|
|
196
|
+
fit: 'lines';
|
|
197
|
+
/** Strip extension beyond the first and last glyph of each line, in ems. Defaults to 0.33. */
|
|
198
|
+
padding?: TileflowThemeNumberValue;
|
|
199
|
+
};
|
|
200
|
+
type TileflowTextLayout = {
|
|
201
|
+
allowOverlap?: boolean;
|
|
202
|
+
anchor?: TileflowTextAnchor;
|
|
203
|
+
/**
|
|
204
|
+
* Replaces the text halo with line-fitted strips. Requires a map `glyphs` provider that serves
|
|
205
|
+
* derived stacks, one font without fallbacks, and constant `letterSpacing` and `lineHeight`.
|
|
206
|
+
*/
|
|
207
|
+
background?: TileflowTextBackground;
|
|
208
|
+
field?: TileflowStringStyleValue;
|
|
209
|
+
font?: TileflowThemeFontValue;
|
|
210
|
+
fallbacks?: readonly TileflowThemeFontValue[];
|
|
211
|
+
ignorePlacement?: boolean;
|
|
212
|
+
justify?: TileflowTextJustify;
|
|
213
|
+
keepUpright?: boolean;
|
|
214
|
+
letterSpacing?: TileflowNumberStyleValue;
|
|
215
|
+
lineHeight?: TileflowNumberStyleValue;
|
|
216
|
+
maxAngle?: TileflowNumberStyleValue;
|
|
217
|
+
maxWidth?: TileflowNumberStyleValue;
|
|
218
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
219
|
+
optional?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Overlap mode. Takes precedence over `allowOverlap`, so the compiled layer carries only the mode.
|
|
222
|
+
* Native artifacts, whose renderer has no overlap modes, use `allowOverlap: false` for `never`
|
|
223
|
+
* and `true` otherwise.
|
|
224
|
+
*/
|
|
225
|
+
overlap?: TileflowSymbolOverlap;
|
|
226
|
+
padding?: TileflowNumberStyleValue;
|
|
227
|
+
pitchAlignment?: TileflowAlignment;
|
|
228
|
+
radialOffset?: TileflowNumberStyleValue;
|
|
229
|
+
rotate?: TileflowNumberStyleValue;
|
|
230
|
+
rotationAlignment?: TileflowAlignment;
|
|
231
|
+
size?: TileflowNumberStyleValue;
|
|
232
|
+
transform?: 'lowercase' | 'none' | 'uppercase';
|
|
233
|
+
variableAnchors?: readonly TileflowTextAnchor[];
|
|
234
|
+
};
|
|
235
|
+
type TileflowTextStyle = TileflowLayerRange & TileflowTextPaint & TileflowTextLayout;
|
|
236
|
+
type TileflowIconPaint = {
|
|
237
|
+
color?: TileflowColorStyleValue;
|
|
238
|
+
haloBlur?: TileflowNumberStyleValue;
|
|
239
|
+
haloColor?: TileflowColorStyleValue;
|
|
240
|
+
haloWidth?: TileflowNumberStyleValue;
|
|
241
|
+
opacity?: TileflowNumberStyleValue;
|
|
242
|
+
};
|
|
243
|
+
type TileflowIconLayout = {
|
|
244
|
+
allowOverlap?: boolean;
|
|
245
|
+
anchor?: TileflowIconAnchor;
|
|
246
|
+
image?: TileflowImageStyleValue;
|
|
247
|
+
ignorePlacement?: boolean;
|
|
248
|
+
keepUpright?: boolean;
|
|
249
|
+
offset?: TileflowNumberOffsetStyleValue;
|
|
250
|
+
optional?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Overlap mode. Takes precedence over `allowOverlap`, so the compiled layer carries only the mode.
|
|
253
|
+
* Native artifacts, whose renderer has no overlap modes, use `allowOverlap: false` for `never`
|
|
254
|
+
* and `true` otherwise.
|
|
255
|
+
*/
|
|
256
|
+
overlap?: TileflowSymbolOverlap;
|
|
257
|
+
padding?: TileflowNumberStyleValue;
|
|
258
|
+
pitchAlignment?: TileflowAlignment;
|
|
259
|
+
rotate?: TileflowNumberStyleValue;
|
|
260
|
+
rotationAlignment?: TileflowAlignment;
|
|
261
|
+
size?: TileflowNumberStyleValue;
|
|
262
|
+
textFit?: TileflowIconTextFit;
|
|
263
|
+
textFitPadding?: TileflowNumberInsetsStyleValue;
|
|
264
|
+
};
|
|
265
|
+
type TileflowIconStyle = TileflowLayerRange & TileflowIconPaint & TileflowIconLayout;
|
|
266
|
+
type TileflowSymbolPlacementStyle = TileflowLayerRange & {
|
|
267
|
+
placement?: TileflowSymbolPlacement;
|
|
268
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
269
|
+
/** Collision order for the semantic priority value. Defaults to `higher-first`. */
|
|
270
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
271
|
+
spacing?: TileflowNumberStyleValue;
|
|
272
|
+
zOrder?: TileflowSymbolZOrder;
|
|
273
|
+
};
|
|
274
|
+
type TileflowCirclePaint = {
|
|
275
|
+
blur?: TileflowNumberStyleValue;
|
|
276
|
+
color?: TileflowColorStyleValue;
|
|
277
|
+
opacity?: TileflowNumberStyleValue;
|
|
278
|
+
pitchAlignment?: 'map' | 'viewport';
|
|
279
|
+
pitchScale?: 'map' | 'viewport';
|
|
280
|
+
priority?: TileflowStructuralStyleValue<number>;
|
|
281
|
+
/** Drawing order for the semantic priority value. Defaults to `higher-first`. */
|
|
282
|
+
priorityOrder?: TileflowPriorityOrder;
|
|
283
|
+
radius?: TileflowNumberStyleValue;
|
|
284
|
+
strokeColor?: TileflowColorStyleValue;
|
|
285
|
+
strokeOpacity?: TileflowNumberStyleValue;
|
|
286
|
+
strokeWidth?: TileflowNumberStyleValue;
|
|
287
|
+
translate?: TileflowNumberOffsetStyleValue;
|
|
288
|
+
translateAnchor?: 'map' | 'viewport';
|
|
289
|
+
};
|
|
290
|
+
type TileflowCircleStyle = TileflowLayerRange & TileflowCirclePaint;
|
|
291
|
+
type TileflowExtrusionPaint = {
|
|
292
|
+
base?: TileflowNumberStyleValue;
|
|
293
|
+
color?: TileflowColorStyleValue;
|
|
294
|
+
height?: TileflowNumberStyleValue;
|
|
295
|
+
opacity?: TileflowNumberStyleValue;
|
|
296
|
+
pattern?: TileflowImageStyleValue;
|
|
297
|
+
verticalGradient?: boolean;
|
|
298
|
+
};
|
|
299
|
+
type TileflowExtrusionStyle = TileflowLayerRange & TileflowExtrusionPaint;
|
|
300
|
+
/** A polygon rendered as a fill and, when requested, a separate line layer. */
|
|
301
|
+
type TileflowAreaStyle = {
|
|
302
|
+
fill?: TileflowFillStyle;
|
|
303
|
+
outline?: TileflowLineStyle;
|
|
304
|
+
};
|
|
305
|
+
/** The canonical ordered phases used for roads, aeroways, and other stroked paths. */
|
|
306
|
+
type TileflowLineStackStyle = {
|
|
307
|
+
casing?: TileflowLineStyle;
|
|
308
|
+
fill?: TileflowLineStyle;
|
|
309
|
+
shadow?: TileflowLineStyle;
|
|
310
|
+
};
|
|
311
|
+
/** A symbol layer composed from one placement policy and optional text/icon parts. */
|
|
312
|
+
type TileflowSymbolStyle = TileflowSymbolPlacementStyle & {
|
|
313
|
+
icon?: TileflowIconStyle;
|
|
314
|
+
text?: TileflowTextStyle;
|
|
315
|
+
};
|
|
316
|
+
/** A symbol style that may also materialize a separate circle marker layer. */
|
|
317
|
+
type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
|
|
318
|
+
marker?: TileflowCircleStyle;
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
declare const tileflowSunMetadataKey = "tileflow:sun";
|
|
322
|
+
/** A theme's sun and sky light with every value resolved; see `TileflowThemeSun`. */
|
|
323
|
+
type TileflowSunPreset = Readonly<{
|
|
324
|
+
/** Degrees clockwise from north, from 0 to 360. */
|
|
325
|
+
azimuth: number;
|
|
326
|
+
/** Degrees above the horizon, from -90 to 90. */
|
|
327
|
+
altitude: number;
|
|
328
|
+
/** The direct light's colour. */
|
|
329
|
+
color: string;
|
|
330
|
+
/** The direct light's strength, from 0 to 1. */
|
|
331
|
+
intensity: number;
|
|
332
|
+
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
333
|
+
shadowIntensity: number;
|
|
334
|
+
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
335
|
+
ambient: Readonly<{
|
|
336
|
+
color: string;
|
|
337
|
+
intensity: number;
|
|
338
|
+
}>;
|
|
339
|
+
}>;
|
|
340
|
+
/** The sun as the map shows it, ready for an application's own layers. */
|
|
341
|
+
type TileflowSun = Readonly<{
|
|
342
|
+
/** Degrees clockwise from north, from 0 to 360. */
|
|
343
|
+
azimuth: number;
|
|
344
|
+
/** Degrees above the horizon, from -90 to 90. */
|
|
345
|
+
altitude: number;
|
|
346
|
+
/** A unit vector towards the sun: x east, y north, z up. */
|
|
347
|
+
direction: readonly [number, number, number];
|
|
348
|
+
/** The direct light's colour, as a CSS colour. */
|
|
349
|
+
color: string;
|
|
350
|
+
/** The direct light's colour as sRGB channels from 0 to 1. */
|
|
351
|
+
rgb: readonly [number, number, number];
|
|
352
|
+
/**
|
|
353
|
+
* The direct light's strength, from 0 to 1. It fades to 0 as the sun sets: a sun below the
|
|
354
|
+
* horizon lights nothing and casts no shadow.
|
|
355
|
+
*/
|
|
356
|
+
intensity: number;
|
|
357
|
+
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
358
|
+
shadowIntensity: number;
|
|
359
|
+
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
360
|
+
ambient: Readonly<{
|
|
361
|
+
color: string;
|
|
362
|
+
rgb: readonly [number, number, number];
|
|
363
|
+
intensity: number;
|
|
364
|
+
}>;
|
|
365
|
+
/**
|
|
366
|
+
* How bright flat, open ground is under this light, from 0 (dark) to 1: the sky's light plus the
|
|
367
|
+
* sun's at its height, each weighted by its colour's luminance. Use it to switch lamps or windows
|
|
368
|
+
* on as a scene darkens, whatever theme or sun lights it.
|
|
369
|
+
*/
|
|
370
|
+
brightness: number;
|
|
371
|
+
/** Where the direction comes from: the themes, angles, or a date and place. */
|
|
372
|
+
source: 'theme' | 'direction' | 'date';
|
|
373
|
+
}>;
|
|
374
|
+
/** Unset sun values: high in the south-south-west, with soft white daylight and ambient fill. */
|
|
375
|
+
declare const tileflowDefaultSunPreset: TileflowSunPreset;
|
|
376
|
+
/**
|
|
377
|
+
* Where the sun stands for an instant and a place ([longitude, latitude] in degrees): its azimuth
|
|
378
|
+
* in degrees clockwise from north and its apparent altitude above the horizon, with atmospheric
|
|
379
|
+
* refraction. It follows NOAA's solar equations, accurate to about a hundredth of a degree for
|
|
380
|
+
* years 1800 to 2200.
|
|
381
|
+
*/
|
|
382
|
+
declare function tileflowSunPosition(date: Date | number, location: readonly [number, number]): Readonly<{
|
|
383
|
+
azimuth: number;
|
|
384
|
+
altitude: number;
|
|
385
|
+
}>;
|
|
386
|
+
/** A unit vector towards a direction in the sky: x east, y north, z up. */
|
|
387
|
+
declare function tileflowSunDirection(azimuth: number, altitude: number): readonly [number, number, number];
|
|
388
|
+
/**
|
|
389
|
+
* The sun as the map shows it: a preset's light from a direction. Direct light fades out over the
|
|
390
|
+
* sun's last degrees above the horizon and is gone below it.
|
|
391
|
+
*/
|
|
392
|
+
declare function resolveTileflowSun(preset: TileflowSunPreset, direction?: Readonly<{
|
|
393
|
+
azimuth: number;
|
|
394
|
+
altitude: number;
|
|
395
|
+
}>, source?: TileflowSun['source']): TileflowSun;
|
|
396
|
+
/**
|
|
397
|
+
* A preset `t` of the way from `from` to `to`: the azimuth turns the short way round, colours mix
|
|
398
|
+
* in OKLab, as theme blends mix paint colours, and numbers linearly.
|
|
399
|
+
*/
|
|
400
|
+
declare function mixTileflowSunPresets(from: TileflowSunPreset, to: TileflowSunPreset, t: number): TileflowSunPreset;
|
|
401
|
+
/** Reads the sun a compiled style publishes, or undefined when its metadata has none. */
|
|
402
|
+
declare function readTileflowSunPreset(metadata: unknown): TileflowSunPreset | undefined;
|
|
403
|
+
/**
|
|
404
|
+
* The sun of a compiled style: the one it publishes, else one read from its light (a style whose
|
|
405
|
+
* theme describes no sun lights its extrusions from `light.position`), else the default.
|
|
406
|
+
*/
|
|
407
|
+
declare function tileflowStyleSunPreset(style: {
|
|
408
|
+
light?: unknown;
|
|
409
|
+
metadata?: unknown;
|
|
410
|
+
} | undefined): TileflowSunPreset;
|
|
411
|
+
|
|
412
|
+
type TileflowTileGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
413
|
+
type TileflowTileFeature = Readonly<{
|
|
414
|
+
/** The feature's id in the tile, when it has one. */
|
|
415
|
+
id?: number;
|
|
416
|
+
type: TileflowTileGeometryType;
|
|
417
|
+
properties: Readonly<Record<string, string | number | boolean>>;
|
|
418
|
+
/**
|
|
419
|
+
* One flat `[x0, y0, x1, y1, …]` array per point set, line or ring, in tile units from 0 to the
|
|
420
|
+
* layer's extent (coordinates in a tile's buffer fall outside that range). Polygon rings follow
|
|
421
|
+
* the MVT winding: an exterior ring is clockwise in tile units, a hole anticlockwise.
|
|
422
|
+
*/
|
|
423
|
+
geometry: readonly (readonly number[])[];
|
|
424
|
+
}>;
|
|
425
|
+
type TileflowTileLayer = Readonly<{
|
|
426
|
+
/** Tile units across the tile, usually 4096. */
|
|
427
|
+
extent: number;
|
|
428
|
+
features: readonly TileflowTileFeature[];
|
|
429
|
+
}>;
|
|
430
|
+
type TileflowVectorTileDecodeOptions = Readonly<{
|
|
431
|
+
/** The layers to decode; others are skipped without decoding. Defaults to every layer. */
|
|
432
|
+
layers?: readonly string[];
|
|
433
|
+
}>;
|
|
434
|
+
/** Decodes a Mapbox Vector Tile's layers. Throws on bytes that are not a vector tile. */
|
|
435
|
+
declare function decodeTileflowVectorTile(bytes: Uint8Array, options?: TileflowVectorTileDecodeOptions): Readonly<Record<string, TileflowTileLayer>>;
|
|
436
|
+
|
|
437
|
+
type TileflowTileAddress = Readonly<{
|
|
438
|
+
z: number;
|
|
439
|
+
x: number;
|
|
440
|
+
y: number;
|
|
441
|
+
}>;
|
|
442
|
+
/** A decoded tile: its address and the chosen layers it holds. */
|
|
443
|
+
type TileflowTile = TileflowTileAddress & Readonly<{
|
|
444
|
+
layers: Readonly<Record<string, TileflowTileLayer>>;
|
|
445
|
+
}>;
|
|
446
|
+
/** Rewrites a tile request as a MapLibre map's `transformRequest` does. */
|
|
447
|
+
type TileflowTileRequestTransform = (url: string, resourceType: 'Tile') => Promise<Readonly<{
|
|
448
|
+
url: string;
|
|
449
|
+
headers?: Readonly<Record<string, string>>;
|
|
450
|
+
credentials?: RequestCredentials;
|
|
451
|
+
}> | undefined> | Readonly<{
|
|
452
|
+
url: string;
|
|
453
|
+
headers?: Readonly<Record<string, string>>;
|
|
454
|
+
credentials?: RequestCredentials;
|
|
455
|
+
}> | undefined;
|
|
456
|
+
type TileflowTileReaderOptions = Readonly<{
|
|
457
|
+
/** The tile address with `{z}`, `{x}` and `{y}`, such as a MapLibre vector source's `tiles[0]`. */
|
|
458
|
+
tiles: string;
|
|
459
|
+
/** The lowest zoom the source has tiles for; defaults to 0. */
|
|
460
|
+
minzoom?: number;
|
|
461
|
+
/** The highest zoom the source has tiles for; deeper reads use its tiles. Defaults to 14. */
|
|
462
|
+
maxzoom?: number;
|
|
463
|
+
/** The layers to decode; defaults to every layer. */
|
|
464
|
+
layers?: readonly string[];
|
|
465
|
+
/** Decoded tiles kept for later reads, from 0 to 4096; defaults to 128. */
|
|
466
|
+
cacheSize?: number;
|
|
467
|
+
/** Requests in flight at once, from 1 to 32; defaults to 6. */
|
|
468
|
+
concurrency?: number;
|
|
469
|
+
/** The map's request rules, applied to every tile request. */
|
|
470
|
+
transformRequest?: TileflowTileRequestTransform;
|
|
471
|
+
/**
|
|
472
|
+
* Defaults to the global `fetch`, and to Core's PMTiles protocol for a source served from a
|
|
473
|
+
* Tileflow PMTiles archive (`tileflow-pmtiles://`).
|
|
474
|
+
*/
|
|
475
|
+
fetch?: (url: string, init: RequestInit) => Promise<Response>;
|
|
476
|
+
}>;
|
|
477
|
+
type TileflowTileAreaRequest = Readonly<{
|
|
478
|
+
/** `[west, south, east, north]` in degrees. */
|
|
479
|
+
bounds: readonly [number, number, number, number];
|
|
480
|
+
/** The zoom to read at, clamped to the source's zooms. */
|
|
481
|
+
zoom: number;
|
|
482
|
+
/** The most tiles the area may take; a larger area is refused. Defaults to 64. */
|
|
483
|
+
maxTiles?: number;
|
|
484
|
+
signal?: AbortSignal;
|
|
485
|
+
}>;
|
|
486
|
+
type TileflowTileReader = {
|
|
487
|
+
/** A tile's chosen layers, or undefined when the source has no tile there (404 or 204). */
|
|
488
|
+
readTile(address: TileflowTileAddress, options?: {
|
|
489
|
+
signal?: AbortSignal;
|
|
490
|
+
/** Beyond the concurrency limit, lower priorities are requested first. Defaults to 0. */
|
|
491
|
+
priority?: number;
|
|
492
|
+
}): Promise<TileflowTile | undefined>;
|
|
493
|
+
/** The tiles covering an area at a zoom, without the absent ones, nearest the centre first. */
|
|
494
|
+
readArea(request: TileflowTileAreaRequest): Promise<TileflowTile[]>;
|
|
495
|
+
/** Forgets every cached tile. */
|
|
496
|
+
clear(): void;
|
|
497
|
+
};
|
|
498
|
+
/** The tiles at `zoom` covering `[west, south, east, north]`, nearest the centre first. */
|
|
499
|
+
declare function tileflowTilesForBounds(bounds: readonly [number, number, number, number], zoom: number): TileflowTileAddress[];
|
|
500
|
+
/** The longitude and latitude of a point in a tile, given in tile units of an `extent`. */
|
|
501
|
+
declare function tileflowTilePointToLngLat(tile: TileflowTileAddress, x: number, y: number, extent?: number): [number, number];
|
|
502
|
+
/**
|
|
503
|
+
* Reads a vector source's tiles in an application: for example a MapLibre map's World source, with
|
|
504
|
+
* `tiles`, `minzoom` and `maxzoom` taken from `map.getSource(id)`, and the map's `transformRequest`.
|
|
505
|
+
*/
|
|
506
|
+
declare function createTileflowTileReader(options: TileflowTileReaderOptions): TileflowTileReader;
|
|
507
|
+
/** Structural MapLibre capability; importing this module never loads a renderer. */
|
|
508
|
+
type TileflowTileSourceMap = {
|
|
509
|
+
getSource(id: string): unknown;
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* The tile address and zooms of a map's vector source once the map has loaded it, ready for
|
|
513
|
+
* `createTileflowTileReader`; undefined while the source is not loaded or has no tile address.
|
|
514
|
+
*/
|
|
515
|
+
declare function readTileflowMapTileSource(map: TileflowTileSourceMap, sourceId: string): {
|
|
516
|
+
tiles: string;
|
|
517
|
+
minzoom: number;
|
|
518
|
+
maxzoom: number;
|
|
519
|
+
} | undefined;
|
|
520
|
+
|
|
521
|
+
/** The MapLibre GL JS map capabilities the renderer uses. */
|
|
522
|
+
type TileflowBuildings3DMap = {
|
|
523
|
+
addLayer(layer: object, beforeId?: string): unknown;
|
|
524
|
+
getCenter(): {
|
|
525
|
+
lat: number;
|
|
526
|
+
lng: number;
|
|
527
|
+
};
|
|
528
|
+
getBearing(): number;
|
|
529
|
+
getCanvas?(): {
|
|
530
|
+
clientHeight: number;
|
|
531
|
+
};
|
|
532
|
+
getVerticalFieldOfView?(): number;
|
|
533
|
+
getLight?(): unknown;
|
|
534
|
+
getLayer(id: string): unknown;
|
|
535
|
+
getPaintProperty(layer: string, name: string): unknown;
|
|
536
|
+
getPitch(): number;
|
|
537
|
+
getSky?(): unknown;
|
|
538
|
+
getSource(id: string): unknown;
|
|
539
|
+
getStyle(): unknown;
|
|
540
|
+
getZoom(): number;
|
|
541
|
+
isStyleLoaded(): boolean | void;
|
|
542
|
+
off(event: string, listener: () => void): unknown;
|
|
543
|
+
on(event: string, listener: () => void): unknown;
|
|
544
|
+
removeLayer(id: string): unknown;
|
|
545
|
+
triggerRepaint(): unknown;
|
|
546
|
+
};
|
|
547
|
+
/** Where the renderer reads the sun and the map's design: a Tileflow theme controller. */
|
|
548
|
+
type TileflowBuildings3DThemes = {
|
|
549
|
+
getSun?(): TileflowSun;
|
|
550
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
551
|
+
values: readonly unknown[];
|
|
552
|
+
position: number;
|
|
553
|
+
}>;
|
|
554
|
+
};
|
|
555
|
+
type TileflowBuildings3DOptions = Readonly<{
|
|
556
|
+
map: TileflowBuildings3DMap;
|
|
557
|
+
/** The theme controller, for the sun and the buildings' design in every theme. */
|
|
558
|
+
controller?: TileflowBuildings3DThemes;
|
|
559
|
+
/** The zoom where buildings start fading in, reaching full opacity 0.25 zoom later. Defaults to 15. */
|
|
560
|
+
minzoom?: number;
|
|
561
|
+
/** The most tiles raised round the camera, from 1 to 64; defaults to 25. */
|
|
562
|
+
maxTiles?: number;
|
|
563
|
+
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
564
|
+
beforeId?: string;
|
|
565
|
+
/** The map's request rules, for the tiles the renderer reads. */
|
|
566
|
+
transformRequest?: TileflowTileRequestTransform;
|
|
567
|
+
}>;
|
|
568
|
+
type TileflowBuildings3DChange = Readonly<{
|
|
569
|
+
transition?: Readonly<{
|
|
570
|
+
duration?: number;
|
|
571
|
+
mode?: 'grow' | 'fade';
|
|
572
|
+
}>;
|
|
573
|
+
}>;
|
|
574
|
+
type TileflowBuildings3D = {
|
|
575
|
+
/** Read-only, bounded snapshots of resident prepared model meshes. */
|
|
576
|
+
inspectModels(): TileflowModelInspection[];
|
|
577
|
+
/** Shows buildings immediately; pass a transition duration to animate their rise. */
|
|
578
|
+
show(options?: TileflowBuildings3DChange): Promise<void>;
|
|
579
|
+
/** Hides buildings immediately; pass a transition duration to animate their descent. */
|
|
580
|
+
hide(options?: TileflowBuildings3DChange): Promise<void>;
|
|
581
|
+
/** Sets the height scale, from 0 (flat) to 1; animation requires a transition duration. */
|
|
582
|
+
grow(scale: number, options?: TileflowBuildings3DChange): Promise<void>;
|
|
583
|
+
/** The height scale shown now. */
|
|
584
|
+
readonly scale: number;
|
|
585
|
+
/**
|
|
586
|
+
* Whether the map's style describes its 3D buildings (the buildings module's
|
|
587
|
+
* `threeDimensional`), tiles raised, buildings and vertices, and the placed models standing, for
|
|
588
|
+
* diagnostics.
|
|
589
|
+
*/
|
|
590
|
+
readonly stats: Readonly<{
|
|
591
|
+
declared: boolean;
|
|
592
|
+
tiles: number;
|
|
593
|
+
buildings: number;
|
|
594
|
+
vertices: number;
|
|
595
|
+
models: number;
|
|
596
|
+
}>;
|
|
597
|
+
/** Takes the layer off the map and lets go of its buffers. */
|
|
598
|
+
dispose(): void;
|
|
599
|
+
};
|
|
600
|
+
declare const tileflowBuildings3DLayerId = "tileflow-buildings-3d";
|
|
601
|
+
/**
|
|
602
|
+
* Creates the renderer, showing buildings automatically above zoom 15 unless hidden. It reads the source's
|
|
603
|
+
* z15 tiles round the camera, the zoom at which World's buildings carry their heights.
|
|
604
|
+
*/
|
|
605
|
+
declare function createTileflowBuildings3D(options: TileflowBuildings3DOptions): TileflowBuildings3D;
|
|
606
|
+
|
|
607
|
+
/** The MapLibre GL JS map capabilities the street lights use. */
|
|
608
|
+
type TileflowStreetLightsMap = {
|
|
609
|
+
addLayer(layer: object, beforeId?: string): unknown;
|
|
610
|
+
getBearing(): number;
|
|
611
|
+
getCenter(): {
|
|
612
|
+
lat: number;
|
|
613
|
+
lng: number;
|
|
614
|
+
};
|
|
615
|
+
getLayer(id: string): unknown;
|
|
616
|
+
getPitch(): number;
|
|
617
|
+
getSource(id: string): unknown;
|
|
618
|
+
getStyle(): unknown;
|
|
619
|
+
getZoom(): number;
|
|
620
|
+
isStyleLoaded(): boolean | void;
|
|
621
|
+
off(event: string, listener: () => void): unknown;
|
|
622
|
+
on(event: string, listener: () => void): unknown;
|
|
623
|
+
removeLayer(id: string): unknown;
|
|
624
|
+
triggerRepaint(): unknown;
|
|
625
|
+
};
|
|
626
|
+
type TileflowStreetLightsOptions = Readonly<{
|
|
627
|
+
map: TileflowStreetLightsMap;
|
|
628
|
+
/**
|
|
629
|
+
* By default, only a map that enables roads.streetLights supplies lights. Set true to opt in
|
|
630
|
+
* with the fallback design when metadata is absent, or false to keep every theme's lights off.
|
|
631
|
+
*/
|
|
632
|
+
enabled?: boolean;
|
|
633
|
+
/**
|
|
634
|
+
* The theme controller, whose sun switches the lights on and off and whose themes hold the map's
|
|
635
|
+
* street lights (the roads module's `streetLights`).
|
|
636
|
+
*/
|
|
637
|
+
controller?: {
|
|
638
|
+
getSun?(): TileflowSun;
|
|
639
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
640
|
+
values: readonly unknown[];
|
|
641
|
+
position: number;
|
|
642
|
+
}>;
|
|
643
|
+
};
|
|
644
|
+
/** The zoom from which the lights shine. Defaults to 14. */
|
|
645
|
+
minzoom?: number;
|
|
646
|
+
/** The most tiles lit round the camera, from 1 to 64; defaults to 25. */
|
|
647
|
+
maxTiles?: number;
|
|
648
|
+
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
649
|
+
beforeId?: string;
|
|
650
|
+
/** The map's request rules, for the tiles the layer reads. */
|
|
651
|
+
transformRequest?: TileflowTileRequestTransform;
|
|
652
|
+
}>;
|
|
653
|
+
type TileflowStreetLights = {
|
|
654
|
+
/** How far the lights have switched on, from 0 by day to 1 at night. */
|
|
655
|
+
readonly on: number;
|
|
656
|
+
/**
|
|
657
|
+
* Whether the map's style describes its street lights, tiles lit, lamps, and how many of them the
|
|
658
|
+
* data maps or the layer estimates.
|
|
659
|
+
*/
|
|
660
|
+
readonly stats: Readonly<{
|
|
661
|
+
declared: boolean;
|
|
662
|
+
tiles: number;
|
|
663
|
+
lamps: number;
|
|
664
|
+
mapped: number;
|
|
665
|
+
estimated: number;
|
|
666
|
+
}>;
|
|
667
|
+
/** Takes the layer off the map and lets go of its buffers. */
|
|
668
|
+
dispose(): void;
|
|
669
|
+
};
|
|
670
|
+
declare const tileflowStreetLightsLayerId = "tileflow-street-lights";
|
|
671
|
+
/**
|
|
672
|
+
* Creates the street lights and puts their layer on the map. They read the source's z15 tiles round
|
|
673
|
+
* the camera once the controller's sun darkens the map, and shine from `minzoom`.
|
|
674
|
+
*/
|
|
675
|
+
declare function createTileflowStreetLights(options: TileflowStreetLightsOptions): TileflowStreetLights;
|
|
676
|
+
|
|
677
|
+
/** The MapLibre GL JS map capabilities the trees use. */
|
|
678
|
+
type TileflowTrees3DMap = {
|
|
679
|
+
addLayer(layer: object, beforeId?: string): unknown;
|
|
680
|
+
getBearing(): number;
|
|
681
|
+
getCenter(): {
|
|
682
|
+
lat: number;
|
|
683
|
+
lng: number;
|
|
684
|
+
};
|
|
685
|
+
getLayer(id: string): unknown;
|
|
686
|
+
getLayoutProperty?(layer: string, name: string): unknown;
|
|
687
|
+
/** The style's layer ids in order, read without serializing the style. */
|
|
688
|
+
getLayersOrder?(): string[];
|
|
689
|
+
getPitch(): number;
|
|
690
|
+
getSky?(): unknown;
|
|
691
|
+
getVerticalFieldOfView?(): number;
|
|
692
|
+
getSource(id: string): unknown;
|
|
693
|
+
getStyle(): unknown;
|
|
694
|
+
getZoom(): number;
|
|
695
|
+
isStyleLoaded(): boolean | void;
|
|
696
|
+
/** Whether the camera is moving; trees then redraw their shadows less often. */
|
|
697
|
+
isMoving?(): boolean;
|
|
698
|
+
off(event: string, listener: () => void): unknown;
|
|
699
|
+
on(event: string, listener: () => void): unknown;
|
|
700
|
+
removeLayer(id: string): unknown;
|
|
701
|
+
setLayoutProperty?(layer: string, name: string, value: unknown): unknown;
|
|
702
|
+
triggerRepaint(): unknown;
|
|
703
|
+
};
|
|
704
|
+
/** Where the trees read the sun and the map's design: a Tileflow theme controller. */
|
|
705
|
+
type TileflowTrees3DThemes = {
|
|
706
|
+
getSun?(): TileflowSun;
|
|
707
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
708
|
+
values: readonly unknown[];
|
|
709
|
+
position: number;
|
|
710
|
+
}>;
|
|
711
|
+
};
|
|
712
|
+
type TileflowTrees3DOptions = Readonly<{
|
|
713
|
+
map: TileflowTrees3DMap;
|
|
714
|
+
/** The theme controller, for the sun and the trees' colours in every theme. */
|
|
715
|
+
controller?: TileflowTrees3DThemes;
|
|
716
|
+
/** The vector source with the canopy points, when not the map's World source. */
|
|
717
|
+
canopySource?: string;
|
|
718
|
+
/** The zoom from which trees stand; they reach full opacity 0.25 zoom later. Defaults to 15. */
|
|
719
|
+
minzoom?: number;
|
|
720
|
+
/** The most tiles of trees round the camera, from 1 to 64; defaults to 25. */
|
|
721
|
+
maxTiles?: number;
|
|
722
|
+
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
723
|
+
beforeId?: string;
|
|
724
|
+
/** The map's request rules, for the tiles the layer reads. */
|
|
725
|
+
transformRequest?: TileflowTileRequestTransform;
|
|
726
|
+
/** Let a vegetation controller own flat-layer visibility. Defaults to true. */
|
|
727
|
+
manageFlatLayers?: boolean;
|
|
728
|
+
}>;
|
|
729
|
+
type TileflowTrees3DChange = Readonly<{
|
|
730
|
+
transition?: Readonly<{
|
|
731
|
+
duration?: number;
|
|
732
|
+
}>;
|
|
733
|
+
}>;
|
|
734
|
+
type TileflowTrees3D = {
|
|
735
|
+
/** Read-only snapshots of the meshes used by the active vegetation palette. */
|
|
736
|
+
inspectModels(): TileflowModelInspection[];
|
|
737
|
+
/** Grows the trees out of the ground; resolves once they stand. */
|
|
738
|
+
show(options?: TileflowTrees3DChange): Promise<void>;
|
|
739
|
+
/** Sinks the trees back into the ground; resolves once they are gone. */
|
|
740
|
+
hide(options?: TileflowTrees3DChange): Promise<void>;
|
|
741
|
+
/** Eases the trees to `scale` of their size, from 0 (none) to 1. */
|
|
742
|
+
grow(scale: number, options?: TileflowTrees3DChange): Promise<void>;
|
|
743
|
+
/** The size scale shown now. */
|
|
744
|
+
readonly scale: number;
|
|
745
|
+
/**
|
|
746
|
+
* Whether the map's style describes 3D trees (`vegetation({mode: '3d'})`), tiles of trees,
|
|
747
|
+
* trees placed (mapped and from canopy points), pieces of hedge placed and trees drawn in the
|
|
748
|
+
* last frame.
|
|
749
|
+
*/
|
|
750
|
+
readonly stats: Readonly<{
|
|
751
|
+
declared: boolean;
|
|
752
|
+
tiles: number;
|
|
753
|
+
trees: number;
|
|
754
|
+
mapped: number;
|
|
755
|
+
canopy: number;
|
|
756
|
+
hedges: number;
|
|
757
|
+
drawn: number;
|
|
758
|
+
}>;
|
|
759
|
+
/** Takes the layer off the map and lets go of its buffers. */
|
|
760
|
+
dispose(): void;
|
|
761
|
+
};
|
|
762
|
+
declare const tileflowTrees3DLayerId = "tileflow-trees-3d";
|
|
763
|
+
/**
|
|
764
|
+
* Creates the trees and puts their layer on the map, sunk in the ground until `show()`. They read
|
|
765
|
+
* the source's z15 tiles round the camera, where World carries its trees and canopy points.
|
|
766
|
+
*/
|
|
767
|
+
declare function createTileflowTrees3D(options: TileflowTrees3DOptions): TileflowTrees3D;
|
|
768
|
+
|
|
769
|
+
/** A prepared model, near and optionally far, as the style's tree description carries it. */
|
|
770
|
+
type TileflowTreeModel = Readonly<{
|
|
771
|
+
near: string;
|
|
772
|
+
far?: string;
|
|
773
|
+
}>;
|
|
774
|
+
|
|
775
|
+
/** The forms a 3D tree takes. */
|
|
776
|
+
declare const tileflowTreeForms: readonly ["round", "open", "tall", "conifer", "columnar", "palm"];
|
|
777
|
+
type TileflowTreeForm = (typeof tileflowTreeForms)[number];
|
|
778
|
+
/** How a tree's surfaces take the light: facets, a smooth round shape, or bands as drawn. */
|
|
779
|
+
declare const tileflowTreeFinishes: readonly ["faceted", "smooth", "toon"];
|
|
780
|
+
type TileflowTreeFinish = (typeof tileflowTreeFinishes)[number];
|
|
781
|
+
/** A form's own scales, on top of the map's, and the map's own models it draws. */
|
|
782
|
+
type TileflowTreeFormStyle = Readonly<{
|
|
783
|
+
heightScale?: number;
|
|
784
|
+
crownScale?: number;
|
|
785
|
+
/** Ids of the map's own models, one to four; each tree draws one by its stable seed. */
|
|
786
|
+
models?: readonly string[];
|
|
787
|
+
}>;
|
|
788
|
+
/** Relative weights of the forms given to trees whose data gives none. */
|
|
789
|
+
type TileflowTreeFormMix = Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
790
|
+
/** A region whose trees without a form in the data take their own mix. */
|
|
791
|
+
type TileflowTreeRegion = Readonly<{
|
|
792
|
+
/** `[west, south, east, north]` in degrees. */
|
|
793
|
+
bounds: readonly [number, number, number, number];
|
|
794
|
+
unknownForms: TileflowTreeFormMix;
|
|
795
|
+
}>;
|
|
796
|
+
/** The fields of the tree and canopy layers, as World names them. */
|
|
797
|
+
type TileflowTreeFields = Readonly<{
|
|
798
|
+
height: string;
|
|
799
|
+
diameterCrown: string;
|
|
800
|
+
circumference: string;
|
|
801
|
+
genus: string;
|
|
802
|
+
species: string;
|
|
803
|
+
leafType: string;
|
|
804
|
+
/** The tree's taxon at any rank, such as `Arecaceae` for palms or a genus or species. */
|
|
805
|
+
taxon: string;
|
|
806
|
+
canopyRank: string;
|
|
807
|
+
canopyClearance: string;
|
|
808
|
+
canopyCover: string;
|
|
809
|
+
/** A canopy point's measured canopy height, in metres. */
|
|
810
|
+
canopyHeight: string;
|
|
811
|
+
/** The kind of barrier in the hedge layer: hedges are `hedge`. */
|
|
812
|
+
subclass: string;
|
|
813
|
+
/** A hedge's kind: `hedge_bank` when it stands on an earth bank. */
|
|
814
|
+
hedge: string;
|
|
815
|
+
}>;
|
|
816
|
+
type TileflowTreePlacementOptions = Readonly<{
|
|
817
|
+
/** The tile's address, for regions and for a stable look per tree. */
|
|
818
|
+
tile: Readonly<{
|
|
819
|
+
x: number;
|
|
820
|
+
y: number;
|
|
821
|
+
z: number;
|
|
822
|
+
}>;
|
|
823
|
+
/** The tile's width in metres. */
|
|
824
|
+
tileMetres: number;
|
|
825
|
+
fields?: Partial<TileflowTreeFields>;
|
|
826
|
+
unknownForms?: TileflowTreeFormMix;
|
|
827
|
+
regions?: readonly TileflowTreeRegion[];
|
|
828
|
+
/** Metres between the trees of a row; defaults to 8. */
|
|
829
|
+
rowSpacing?: number;
|
|
830
|
+
/** How many models each form draws from, 1 to 4; each tree draws one by its seed. */
|
|
831
|
+
variants?: Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
832
|
+
}>;
|
|
833
|
+
/** A tile's layers trees come from, as World names them. */
|
|
834
|
+
type TileflowTreeLayers = Readonly<{
|
|
835
|
+
/**
|
|
836
|
+
* World's `tree`: trees mapped one by one as points, and rows of trees as lines, planted every
|
|
837
|
+
* `rowSpacing` metres.
|
|
838
|
+
*/
|
|
839
|
+
trees?: TileflowTileLayer;
|
|
840
|
+
/** Decorative canopy points in parks and gardens (World's `canopy`). */
|
|
841
|
+
canopy?: TileflowTileLayer;
|
|
842
|
+
/**
|
|
843
|
+
* World's `traffic_control`: its hedges, lines and areas of `subclass=hedge`, stand as clipped
|
|
844
|
+
* pieces along each line and round each area. Other barriers are left out.
|
|
845
|
+
*/
|
|
846
|
+
hedges?: TileflowTileLayer;
|
|
847
|
+
}>;
|
|
848
|
+
/** Where some trees are in a placement, and how many of them have each rank or a lower one. */
|
|
849
|
+
type TileflowTreeRange = Readonly<{
|
|
850
|
+
start: number;
|
|
851
|
+
count: number;
|
|
852
|
+
/** `upTo[r]`: trees of the range with a rank of `r` or lower, from 0 to 15. */
|
|
853
|
+
upTo: readonly number[];
|
|
854
|
+
}>;
|
|
855
|
+
/** Where a form's trees are in a placement, and those of each of its models in turn. */
|
|
856
|
+
type TileflowTreeFormRange = TileflowTreeRange & Readonly<{
|
|
857
|
+
/** One range per model the form draws from, in order; one when it draws Core's own tree. */
|
|
858
|
+
variants: readonly TileflowTreeRange[];
|
|
859
|
+
}>;
|
|
860
|
+
/** One tile's trees, ready to upload. */
|
|
861
|
+
type TileflowTreePlacement = Readonly<{
|
|
862
|
+
/** `tileflowTreeBytes` bytes per tree, ordered by form, model, then rank; see the layout below. */
|
|
863
|
+
trees: Uint8Array;
|
|
864
|
+
forms: Readonly<Record<TileflowTreeForm, TileflowTreeFormRange>>;
|
|
865
|
+
/**
|
|
866
|
+
* `tileflowTreeBytes` bytes per piece of hedge, as a tree's: its middle, its height, its length
|
|
867
|
+
* as the crown, and its turn along the hedge.
|
|
868
|
+
*/
|
|
869
|
+
hedges: Uint8Array;
|
|
870
|
+
/** The tallest tree or hedge, in metres. */
|
|
871
|
+
tallest: number;
|
|
872
|
+
/** Trees from the data's trees and rows, and trees from canopy points. */
|
|
873
|
+
mapped: number;
|
|
874
|
+
canopy: number;
|
|
875
|
+
}>;
|
|
876
|
+
/**
|
|
877
|
+
* Bytes per tree: x and y in tile units of 8192 (uint16 each), height and crown diameter in
|
|
878
|
+
* decimetres (uint16 each), then one byte each for its turn (of a full turn), its shade among the
|
|
879
|
+
* theme's colours, its form, its rank (0–15, lower shows first), a seed, whether it stands for a
|
|
880
|
+
* canopy point (1) or a mapped tree (0), the model of its form it draws, and a byte of padding.
|
|
881
|
+
*/
|
|
882
|
+
declare const tileflowTreeBytes = 16;
|
|
883
|
+
/**
|
|
884
|
+
* The form a tree's data gives it, or undefined when its data says nothing about its form: a palm
|
|
885
|
+
* by `leaf_type` or genus, a column, a conifer by `leaf_type` or genus, or one of the broadleaf
|
|
886
|
+
* forms by genus. `broadleaf` means the data says broadleaved without a known genus.
|
|
887
|
+
*/
|
|
888
|
+
declare function tileflowTreeFormOf(properties: Readonly<Record<string, unknown>>, fields?: Partial<TileflowTreeFields>): TileflowTreeForm | 'broadleaf' | undefined;
|
|
889
|
+
/** Places a tile's trees. Points in the tile's buffer belong to the neighbouring tile. */
|
|
890
|
+
declare function placeTileflowTrees(layers: TileflowTreeLayers, options: TileflowTreePlacementOptions): TileflowTreePlacement;
|
|
891
|
+
/** The style metadata key under which a compiled map describes its 3D trees. */
|
|
892
|
+
declare const tileflowVegetationMetadataKey = "tileflow:vegetation";
|
|
893
|
+
/** How a compiled map's 3D trees look and where their data is, resolved for one theme. */
|
|
894
|
+
type TileflowVegetation3D = Readonly<{
|
|
895
|
+
/** The vector source and its layers with the trees, the canopy points and the hedges. */
|
|
896
|
+
source: string;
|
|
897
|
+
layers: Readonly<{
|
|
898
|
+
tree: string;
|
|
899
|
+
canopy?: string;
|
|
900
|
+
hedge?: string;
|
|
901
|
+
}>;
|
|
902
|
+
fields: TileflowTreeFields;
|
|
903
|
+
/**
|
|
904
|
+
* Sunlit colours: bark, the leaves of each kind of tree from darkest to lightest, and those of
|
|
905
|
+
* hedges.
|
|
906
|
+
*/
|
|
907
|
+
colors: Readonly<{
|
|
908
|
+
bark: string;
|
|
909
|
+
broadleaf: readonly string[];
|
|
910
|
+
conifer: readonly string[];
|
|
911
|
+
palm: readonly string[];
|
|
912
|
+
hedge: readonly string[];
|
|
913
|
+
}>;
|
|
914
|
+
heightScale: number;
|
|
915
|
+
crownScale: number;
|
|
916
|
+
/** Each form's own scales and models. */
|
|
917
|
+
forms: Readonly<Partial<Record<TileflowTreeForm, TileflowTreeFormStyle>>>;
|
|
918
|
+
/** The map's own models its forms draw, by id, prepared from its `models` directories. */
|
|
919
|
+
models: Readonly<Record<string, TileflowTreeModel>>;
|
|
920
|
+
finish: TileflowTreeFinish;
|
|
921
|
+
/** How strongly an outline rings each tree, from 0 (none) to 1, and its colour. */
|
|
922
|
+
edges: number;
|
|
923
|
+
edgeColor?: string;
|
|
924
|
+
unknownForms: TileflowTreeFormMix;
|
|
925
|
+
regions: readonly TileflowTreeRegion[];
|
|
926
|
+
/** The style's layers that draw the trees flat, which the 3D trees stand in for while shown. */
|
|
927
|
+
flatLayers: readonly string[];
|
|
928
|
+
}>;
|
|
929
|
+
/**
|
|
930
|
+
* Reads the 3D trees a compiled style describes, or undefined when its metadata has none or holds
|
|
931
|
+
* a version or shape this Core does not know.
|
|
932
|
+
*/
|
|
933
|
+
declare function readTileflowVegetation3D(metadata: unknown): TileflowVegetation3D | undefined;
|
|
934
|
+
|
|
935
|
+
type TileflowVegetationMode = '3d' | 'flat' | 'auto';
|
|
936
|
+
type TileflowVegetationThreeDimensionalStyle = {
|
|
937
|
+
barkColor?: TileflowThemeColorValue;
|
|
938
|
+
/** Sunlit leaf colours of broadleaf trees, from darkest to lightest; up to four are used. */
|
|
939
|
+
broadleafColors?: readonly TileflowThemeColorValue[];
|
|
940
|
+
/** Sunlit needle colours of conifers and columns, from darkest to lightest. */
|
|
941
|
+
coniferColors?: readonly TileflowThemeColorValue[];
|
|
942
|
+
/** Sunlit frond colours of palms, from darkest to lightest; the broadleaf colours by default. */
|
|
943
|
+
palmColors?: readonly TileflowThemeColorValue[];
|
|
944
|
+
/**
|
|
945
|
+
* Whether the data's hedges stand as clipped green walls beside the trees, at their height or
|
|
946
|
+
* 1.3 m, a metre higher on an earth bank. Defaults to true where the data has hedges.
|
|
947
|
+
*/
|
|
948
|
+
hedges?: boolean;
|
|
949
|
+
/** Sunlit colours of hedges, from darkest to lightest; the two darkest broadleaf colours by default. */
|
|
950
|
+
hedgeColors?: readonly TileflowThemeColorValue[];
|
|
951
|
+
crownScale?: TileflowThemeNumberValue;
|
|
952
|
+
heightScale?: TileflowThemeNumberValue;
|
|
953
|
+
/**
|
|
954
|
+
* How trees take the light: `faceted` (the default), low-poly facets softened towards a round
|
|
955
|
+
* crown; `smooth`, round crowns; or `toon`, three bands of light and a crisp shadow, as a drawn
|
|
956
|
+
* tree has them.
|
|
957
|
+
*/
|
|
958
|
+
finish?: TileflowTreeFinish;
|
|
959
|
+
/** How strongly an outline rings each tree, from 0 (none, the default) to 1. */
|
|
960
|
+
edges?: TileflowThemeNumberValue;
|
|
961
|
+
/** The outline's colour; the crown's darkest colour, deepened, by default. */
|
|
962
|
+
edgeColor?: TileflowThemeColorValue;
|
|
963
|
+
/**
|
|
964
|
+
* Each form's own scales, on top of `heightScale` and `crownScale`, such as taller palms, and the
|
|
965
|
+
* map's own models it draws: ids of `.glb` files in the map's `models` directories, one to four,
|
|
966
|
+
* each tree drawing one. A model's materials named `bark`, `leaves`, `fronds` or `stem` take
|
|
967
|
+
* those parts' colours.
|
|
968
|
+
*/
|
|
969
|
+
forms?: Partial<Record<TileflowTreeForm, {
|
|
970
|
+
heightScale?: TileflowThemeNumberValue;
|
|
971
|
+
crownScale?: TileflowThemeNumberValue;
|
|
972
|
+
models?: readonly string[];
|
|
973
|
+
}>>;
|
|
974
|
+
/**
|
|
975
|
+
* The forms of trees whose data gives none, as relative weights: `round`, `open` and `tall`
|
|
976
|
+
* (broadleaf), `conifer`, `columnar` and `palm`. Each tree draws one from a stable hash, so it
|
|
977
|
+
* keeps its form everywhere. Defaults to the three broadleaf forms, evenly. A tree the data calls
|
|
978
|
+
* broadleaved keeps to the broadleaf forms of the mix.
|
|
979
|
+
*/
|
|
980
|
+
unknownForms?: TileflowTreeFormMix;
|
|
981
|
+
/**
|
|
982
|
+
* Regions whose trees without a form in the data take their own mix, such as palms along a
|
|
983
|
+
* subtropical coast. Bounds are `[west, south, east, north]` in degrees; the first region holding
|
|
984
|
+
* a tree applies. At most 16.
|
|
985
|
+
*/
|
|
986
|
+
regions?: readonly TileflowTreeRegion[];
|
|
987
|
+
};
|
|
988
|
+
type TileflowVegetationModuleOptions = {
|
|
989
|
+
flat?: TileflowCircleStyle;
|
|
990
|
+
/** `3d` uses models at every pitch; `auto` follows the runtime's explicit 2D/3D view mode. */
|
|
991
|
+
mode?: TileflowVegetationMode;
|
|
992
|
+
/** Representation when a renderer cannot draw models. Defaults to `flat`. */
|
|
993
|
+
fallback?: 'flat' | 'none';
|
|
994
|
+
/** Initial visibility; a runtime control may override it. Defaults to true. */
|
|
995
|
+
visible?: boolean;
|
|
996
|
+
threeDimensional?: TileflowVegetationThreeDimensionalStyle;
|
|
997
|
+
};
|
|
998
|
+
type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
999
|
+
type: 'vegetation';
|
|
1000
|
+
};
|
|
1001
|
+
|
|
1002
|
+
type TileflowViewMode = '2d' | '3d';
|
|
1003
|
+
type TileflowVegetationRepresentation = 'none' | 'flat' | '3d';
|
|
1004
|
+
declare const tileflowVegetationDisplayMetadataKey = "tileflow:vegetation-display";
|
|
1005
|
+
/** Display policy, separate from the models' design and the camera's pitch. */
|
|
1006
|
+
type TileflowVegetationDisplay = Readonly<{
|
|
1007
|
+
version: 1;
|
|
1008
|
+
mode: TileflowVegetationMode;
|
|
1009
|
+
fallback: 'flat' | 'none';
|
|
1010
|
+
visible: boolean;
|
|
1011
|
+
/** Authored visibility before the compiler applies the static fallback. */
|
|
1012
|
+
flatLayers: readonly Readonly<{
|
|
1013
|
+
id: string;
|
|
1014
|
+
visible: boolean;
|
|
1015
|
+
}>[];
|
|
1016
|
+
}>;
|
|
1017
|
+
declare function readTileflowVegetationDisplay(metadata: unknown): TileflowVegetationDisplay | undefined;
|
|
1018
|
+
declare function resolveTileflowVegetationRepresentation(policy: TileflowVegetationDisplay | undefined, options: {
|
|
1019
|
+
visible?: boolean | undefined;
|
|
1020
|
+
viewMode?: TileflowViewMode;
|
|
1021
|
+
supports3D: boolean;
|
|
1022
|
+
}): TileflowVegetationRepresentation;
|
|
1023
|
+
|
|
1024
|
+
type TileflowVegetationOptions = Omit<TileflowTrees3DOptions, 'manageFlatLayers' | 'map'> & {
|
|
1025
|
+
map: TileflowTrees3DOptions['map'] & {
|
|
1026
|
+
getCanvas?(): HTMLCanvasElement;
|
|
1027
|
+
};
|
|
1028
|
+
/** Overrides the map's visibility. Undefined restores the authored default. */
|
|
1029
|
+
visible?: boolean | undefined;
|
|
1030
|
+
/** Explicit application view mode, independent of pitch and building visibility. Defaults to 2d. */
|
|
1031
|
+
viewMode?: TileflowViewMode;
|
|
1032
|
+
};
|
|
1033
|
+
type TileflowVegetationController = {
|
|
1034
|
+
inspectModels: TileflowTrees3D['inspectModels'];
|
|
1035
|
+
setVisible(visible: boolean | undefined): void;
|
|
1036
|
+
setViewMode(mode: TileflowViewMode): void;
|
|
1037
|
+
/** Reapplies the policy after application layer controls change. */
|
|
1038
|
+
refresh(): void;
|
|
1039
|
+
readonly representation: TileflowVegetationRepresentation;
|
|
1040
|
+
readonly stats: TileflowTrees3D['stats'] | undefined;
|
|
1041
|
+
dispose(): void;
|
|
1042
|
+
};
|
|
1043
|
+
/** Mount once per map. OFF hides every representation; mode selects how enabled trees are drawn. */
|
|
1044
|
+
declare function createTileflowVegetation(options: TileflowVegetationOptions): TileflowVegetationController;
|
|
1045
|
+
|
|
1046
|
+
/** The MapLibre GL JS map capabilities the 3D scene uses. */
|
|
1047
|
+
type TileflowMap3DMap = TileflowBuildings3DMap & TileflowStreetLightsMap & TileflowVegetationOptions['map'];
|
|
1048
|
+
type TileflowMap3DOptions = Readonly<{
|
|
1049
|
+
map: TileflowMap3DMap;
|
|
1050
|
+
/** The theme controller, for the sun and the scene's design in every theme. */
|
|
1051
|
+
controller?: TileflowBuildings3DThemes;
|
|
1052
|
+
/** `3d` (the default) shows the scene; `2d` mounts no 3D layers and draws `auto` vegetation flat. */
|
|
1053
|
+
viewMode?: TileflowViewMode;
|
|
1054
|
+
/** Overrides the map's vegetation visibility; undefined uses the authored default. */
|
|
1055
|
+
vegetation?: boolean | undefined;
|
|
1056
|
+
/** The map's request rules, for the tiles the renderers read. */
|
|
1057
|
+
transformRequest?: TileflowTileRequestTransform;
|
|
1058
|
+
}>;
|
|
1059
|
+
type TileflowMap3D = {
|
|
1060
|
+
/** Shows the scene. A transition animates the buildings' rise; other parts change at once. */
|
|
1061
|
+
show(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1062
|
+
/** Hides the scene, releasing its street lights. A transition animates the buildings' descent. */
|
|
1063
|
+
hide(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1064
|
+
/** `3d` while shown, `2d` while hidden. */
|
|
1065
|
+
readonly viewMode: TileflowViewMode;
|
|
1066
|
+
/** Overrides the map's vegetation visibility; undefined restores the authored default. */
|
|
1067
|
+
setVegetation(visible: boolean | undefined): void;
|
|
1068
|
+
/** The mounted renderers, for diagnostics; each is present while the style declares it. */
|
|
1069
|
+
readonly buildings: TileflowBuildings3D | undefined;
|
|
1070
|
+
readonly vegetation: TileflowVegetationController | undefined;
|
|
1071
|
+
readonly streetLights: TileflowStreetLights | undefined;
|
|
1072
|
+
/** Takes every 3D layer off the map and restores its authored flat vegetation. */
|
|
1073
|
+
dispose(): void;
|
|
1074
|
+
};
|
|
1075
|
+
/**
|
|
1076
|
+
* Mounts every 3D renderer the map's compiled style declares — buildings with landmarks and Team
|
|
1077
|
+
* models (`tileflow:buildings`), vegetation (`tileflow:vegetation`, `tileflow:vegetation-display`)
|
|
1078
|
+
* and street lights (`tileflow:street-lights`) — on the map's shared 3D scene. It follows style and
|
|
1079
|
+
* theme changes, mounting and releasing renderers as the style declares them.
|
|
1080
|
+
*/
|
|
1081
|
+
declare function createTileflowMap3D(options: TileflowMap3DOptions): TileflowMap3D;
|
|
1082
|
+
|
|
1083
|
+
export { type TileflowTrees3DMap as $, type TileflowBuildings3DThemes as A, type TileflowMap3DMap as B, type TileflowStreetLights as C, type TileflowStreetLightsMap as D, type TileflowStreetLightsOptions as E, type TileflowSunPreset as F, type TileflowTile as G, type TileflowTileAddress as H, type TileflowTileAreaRequest as I, type TileflowTileFeature as J, type TileflowTileGeometryType as K, type TileflowTileReader as L, type TileflowTileReaderOptions as M, type TileflowTileRequestTransform as N, type TileflowTileSourceMap as O, type TileflowTreeFields as P, type TileflowTreeForm as Q, type TileflowTreeFormMix as R, type TileflowTreeFormRange as S, type TileflowSymbolStyle as T, type TileflowTreeLayers as U, type TileflowTreePlacement as V, type TileflowTreePlacementOptions as W, type TileflowTreeRange as X, type TileflowTreeRegion as Y, type TileflowTrees3D as Z, type TileflowTrees3DChange as _, type TileflowThemeImageValue as a, type TileflowTrees3DOptions as a0, type TileflowTrees3DThemes as a1, type TileflowVectorTileDecodeOptions as a2, type TileflowVegetation3D as a3, type TileflowVegetationController as a4, type TileflowVegetationDisplay as a5, type TileflowVegetationOptions as a6, type TileflowVegetationRepresentation as a7, createTileflowBuildings3D as a8, createTileflowMap3D as a9, tileflowVegetationDisplayMetadataKey as aA, tileflowVegetationMetadataKey as aB, createTileflowStreetLights as aa, createTileflowTileReader as ab, createTileflowTrees3D as ac, createTileflowVegetation as ad, decodeTileflowVectorTile as ae, mixTileflowSunPresets as af, placeTileflowTrees as ag, readTileflowMapTileSource as ah, readTileflowSunPreset as ai, readTileflowVegetation3D as aj, readTileflowVegetationDisplay as ak, resolveTileflowSun as al, resolveTileflowVegetationRepresentation as am, tileflowBuildings3DLayerId as an, tileflowDefaultSunPreset as ao, tileflowStreetLightsLayerId as ap, tileflowStyleSunPreset as aq, tileflowSunDirection as ar, tileflowSunMetadataKey as as, tileflowSunPosition as at, tileflowTilePointToLngLat as au, tileflowTilesForBounds as av, tileflowTreeBytes as aw, tileflowTreeFormOf as ax, tileflowTreeForms as ay, tileflowTrees3DLayerId as az, type TileflowThemeColorValue as b, type TileflowMarkerSymbolStyle as c, type TileflowAreaStyle as d, type TileflowLineStackStyle as e, type TileflowLineHatchStyle as f, type TileflowIconStyle as g, type TileflowLinePaint as h, type TileflowThemeNumberValue as i, type TileflowNumberStyleValue as j, type TileflowCircleStyle as k, type TileflowLineStyle as l, type TileflowFillStyle as m, type TileflowExtrusionStyle as n, type TileflowBackgroundStyle as o, type TileflowSymbolPlacement as p, type TileflowVegetationModuleConfig as q, type TileflowTileLayer as r, type TileflowMap3DOptions as s, type TileflowMap3D as t, type TileflowViewMode as u, type TileflowSun as v, type TileflowBuildings3D as w, type TileflowBuildings3DChange as x, type TileflowBuildings3DMap as y, type TileflowBuildings3DOptions as z };
|