@tileflow/core 0.1.0-alpha.36 → 0.1.0-alpha.38
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 +13 -12
- package/dist/3d-D9c3i78O.d.ts +1080 -0
- package/dist/3d.d.ts +1 -0
- package/dist/3d.js +12082 -0
- package/dist/browser.d.ts +530 -1306
- package/dist/browser.js +7166 -5194
- package/dist/build.d.ts +2 -2
- package/dist/build.js +1707 -824
- package/dist/config-reference.json +3772 -1380
- package/dist/{icon-composition-sN3JkXdb.d.ts → icon-composition-Br4Bd2bY.d.ts} +348 -6
- package/dist/index.d.ts +162 -154
- package/dist/index.js +4003 -2740
- package/dist/worker/camera-tile-worker.global.js +1 -0
- package/docs/application-tile-reading.md +5 -2
- package/docs/authoring-model.md +8 -0
- package/docs/buildings-3d.md +185 -25
- package/docs/compiled-style-performance.md +11 -2
- package/docs/data-is-separate-from-design.md +18 -34
- package/docs/nautical-marks.md +200 -0
- package/docs/public-api-and-browser-subpath.md +8 -1
- package/docs/street-lights.md +5 -1
- package/docs/trees-3d.md +11 -6
- package/package.json +6 -1
- package/dist/worker/buildings-3d-worker.global.js +0 -1
package/dist/browser.d.ts
CHANGED
|
@@ -1,3 +1,264 @@
|
|
|
1
|
+
import { T as TileflowSymbolStyle, a as TileflowThemeImageValue, b as TileflowThemeColorValue, c as TileflowMarkerSymbolStyle, d as TileflowAreaStyle, e as TileflowLineStackStyle, f as TileflowLineHatchStyle, g as TileflowIconStyle, h as TileflowLinePaint, i as TileflowThemeNumberValue, j as TileflowNumberStyleValue, k as TileflowCircleStyle, l as TileflowLineStyle, m as TileflowFillStyle, n as TileflowExtrusionStyle, o as TileflowBackgroundStyle, p as TileflowSymbolPlacement, q as TileflowVegetationModuleConfig, r as TileflowTileLayer, s as TileflowMap3DOptions, t as TileflowMap3D, u as TileflowViewMode, v as TileflowSun } from './3d-D9c3i78O.js';
|
|
2
|
+
export { w as TileflowBuildings3D, x as TileflowBuildings3DChange, y as TileflowBuildings3DMap, z as TileflowBuildings3DOptions, A as TileflowBuildings3DThemes, B as TileflowMap3DMap, C as TileflowStreetLights, D as TileflowStreetLightsMap, E as TileflowStreetLightsOptions, F as TileflowSunPreset, G as TileflowTile, H as TileflowTileAddress, I as TileflowTileAreaRequest, J as TileflowTileFeature, K as TileflowTileGeometryType, L as TileflowTileReader, M as TileflowTileReaderOptions, N as TileflowTileRequestTransform, O as TileflowTileSourceMap, P as TileflowTreeFields, Q as TileflowTreeForm, R as TileflowTreeFormMix, S as TileflowTreeFormRange, U as TileflowTreeLayers, V as TileflowTreePlacement, W as TileflowTreePlacementOptions, X as TileflowTreeRange, Y as TileflowTreeRegion, Z as TileflowTrees3D, _ as TileflowTrees3DChange, $ as TileflowTrees3DMap, a0 as TileflowTrees3DOptions, a1 as TileflowTrees3DThemes, a2 as TileflowVectorTileDecodeOptions, a3 as TileflowVegetation3D, a4 as TileflowVegetationController, a5 as TileflowVegetationDisplay, a6 as TileflowVegetationOptions, a7 as TileflowVegetationRepresentation, a8 as createTileflowBuildings3D, a9 as createTileflowMap3D, aa as createTileflowStreetLights, ab as createTileflowTileReader, ac as createTileflowTrees3D, ad as createTileflowVegetation, ae as decodeTileflowVectorTile, af as mixTileflowSunPresets, ag as placeTileflowTrees, ah as readTileflowMapTileSource, ai as readTileflowSunPreset, aj as readTileflowVegetation3D, ak as readTileflowVegetationDisplay, al as resolveTileflowSun, am as resolveTileflowVegetationRepresentation, an as tileflowBuildings3DLayerId, ao as tileflowDefaultSunPreset, ap as tileflowStreetLightsLayerId, aq as tileflowStyleSunPreset, ar as tileflowSunDirection, as as tileflowSunMetadataKey, at as tileflowSunPosition, au as tileflowTilePointToLngLat, av as tileflowTilesForBounds, aw as tileflowTreeBytes, ax as tileflowTreeFormOf, ay as tileflowTreeForms, az as tileflowTrees3DLayerId, aA as tileflowVegetationDisplayMetadataKey, aB as tileflowVegetationMetadataKey } from './3d-D9c3i78O.js';
|
|
3
|
+
|
|
4
|
+
type TileflowColor = `#${string}`;
|
|
5
|
+
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
6
|
+
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
7
|
+
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
8
|
+
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
9
|
+
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
10
|
+
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
11
|
+
type TileflowRoadExtras = {
|
|
12
|
+
paths?: boolean;
|
|
13
|
+
};
|
|
14
|
+
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
15
|
+
hatch?: TileflowLineHatchStyle;
|
|
16
|
+
};
|
|
17
|
+
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
18
|
+
type TileflowRoadTreatmentLayerStyle = {
|
|
19
|
+
casing?: TileflowRoadTreatmentLineStyle;
|
|
20
|
+
fill?: TileflowRoadTreatmentLineStyle;
|
|
21
|
+
shadow?: TileflowRoadTreatmentLineStyle;
|
|
22
|
+
};
|
|
23
|
+
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
widthScale?: TileflowThemeNumberValue;
|
|
26
|
+
};
|
|
27
|
+
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
28
|
+
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
29
|
+
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
30
|
+
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
31
|
+
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
32
|
+
enabled?: boolean;
|
|
33
|
+
};
|
|
34
|
+
type TileflowRoadAreaStyle = {
|
|
35
|
+
pedestrian?: TileflowAreaStyle;
|
|
36
|
+
pier?: TileflowAreaStyle;
|
|
37
|
+
road?: TileflowAreaStyle;
|
|
38
|
+
};
|
|
39
|
+
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
40
|
+
type TileflowRoadRoundaboutStyle = {
|
|
41
|
+
/** Extra casing width in pixels, split equally across both edges; defaults to the road border. */
|
|
42
|
+
borderWidth?: TileflowNumberStyleValue;
|
|
43
|
+
casing?: TileflowCircleStyle;
|
|
44
|
+
/** Road width in pixels when metric radii are absent; defaults to the effective surface fill width. */
|
|
45
|
+
fallbackWidth?: TileflowNumberStyleValue;
|
|
46
|
+
fill?: TileflowCircleStyle;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* How Core's street lights renderer lights the map's streets at night, from the lamps and lit
|
|
50
|
+
* streets its data holds.
|
|
51
|
+
*/
|
|
52
|
+
type TileflowRoadStreetLightStyle = {
|
|
53
|
+
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
54
|
+
color?: TileflowThemeColorValue;
|
|
55
|
+
/** Whether the map has street lights; defaults to false. Set true to opt in. */
|
|
56
|
+
enabled?: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
59
|
+
* pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
|
|
60
|
+
* that map few lamps, which invents light; `none` nowhere.
|
|
61
|
+
*/
|
|
62
|
+
estimate?: 'lit' | 'streets' | 'none';
|
|
63
|
+
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
64
|
+
intensity?: TileflowThemeNumberValue;
|
|
65
|
+
};
|
|
66
|
+
type TileflowRoadSidewalkStyle = {
|
|
67
|
+
outline?: TileflowLineStyle;
|
|
68
|
+
pattern?: TileflowFillStyle;
|
|
69
|
+
surface?: TileflowFillStyle;
|
|
70
|
+
};
|
|
71
|
+
type TileflowRoadsModuleConfig = {
|
|
72
|
+
type: 'roads';
|
|
73
|
+
areas?: TileflowRoadAreaStyle;
|
|
74
|
+
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
75
|
+
crossings?: TileflowRoadCrossingStyle;
|
|
76
|
+
detail?: TileflowRoadDetail;
|
|
77
|
+
extras?: TileflowRoadExtras;
|
|
78
|
+
hierarchy?: TileflowRoadHierarchy;
|
|
79
|
+
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
80
|
+
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
81
|
+
oneWayMarkers?: boolean;
|
|
82
|
+
outline?: TileflowRoadOutline;
|
|
83
|
+
/** Draw ramp fills below receiving roads by default; `by-class` keeps their class's order. */
|
|
84
|
+
rampOrder?: 'below-roads' | 'by-class';
|
|
85
|
+
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
86
|
+
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
87
|
+
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
88
|
+
sidewalks?: TileflowRoadSidewalkStyle;
|
|
89
|
+
streetLights?: TileflowRoadStreetLightStyle;
|
|
90
|
+
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
91
|
+
weight?: TileflowRoadWeight;
|
|
92
|
+
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
93
|
+
};
|
|
94
|
+
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
95
|
+
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
96
|
+
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
97
|
+
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
98
|
+
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
99
|
+
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
100
|
+
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
101
|
+
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
102
|
+
type TileflowRoadShieldStyles = {
|
|
103
|
+
default?: TileflowSymbolStyle;
|
|
104
|
+
detail?: TileflowSymbolStyle;
|
|
105
|
+
kinds?: Record<string, {
|
|
106
|
+
image: TileflowThemeImageValue;
|
|
107
|
+
}>;
|
|
108
|
+
overview?: TileflowSymbolStyle;
|
|
109
|
+
textColors?: Record<string, {
|
|
110
|
+
color: TileflowThemeColorValue;
|
|
111
|
+
}>;
|
|
112
|
+
};
|
|
113
|
+
type TileflowLabelStyles = {
|
|
114
|
+
aerodrome?: TileflowSymbolStyle;
|
|
115
|
+
junctions?: TileflowSymbolStyle;
|
|
116
|
+
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
117
|
+
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
118
|
+
shields?: TileflowRoadShieldStyles;
|
|
119
|
+
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
120
|
+
};
|
|
121
|
+
type TileflowLabelsModuleConfig = {
|
|
122
|
+
type: 'labels';
|
|
123
|
+
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
124
|
+
collisionPriority?: TileflowLabelCollisionPriority;
|
|
125
|
+
junctions?: boolean;
|
|
126
|
+
language?: TileflowLabelLanguage;
|
|
127
|
+
places?: TileflowLabelDetail;
|
|
128
|
+
roadClasses?: readonly TileflowRoadClass[];
|
|
129
|
+
/**
|
|
130
|
+
* Where street names draw. `foreground` (the default) keeps them above buildings and
|
|
131
|
+
* vegetation. `ground` places them below buildings, with map-aligned text by default.
|
|
132
|
+
* Ground names retain their road-class collision order, but foreground symbols are offered
|
|
133
|
+
* first by the renderer; `collisionPriority` cannot make ground names outrank those symbols.
|
|
134
|
+
* Shields and junction numbers keep their foreground placement.
|
|
135
|
+
*/
|
|
136
|
+
roadPlacement?: 'ground' | 'foreground';
|
|
137
|
+
roads?: TileflowRoadLabelDetail;
|
|
138
|
+
shields?: TileflowRoadShieldDetail;
|
|
139
|
+
styles?: TileflowLabelStyles;
|
|
140
|
+
water?: TileflowLabelDetail;
|
|
141
|
+
};
|
|
142
|
+
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
143
|
+
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
144
|
+
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
145
|
+
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
146
|
+
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
147
|
+
/**
|
|
148
|
+
* How POI categories are placed against each other. `importance` places every category in one
|
|
149
|
+
* order, by World's ranks. `categories` gives each category its own layer and places the
|
|
150
|
+
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
151
|
+
*/
|
|
152
|
+
type TileflowPoiPlacementOrder = 'categories' | 'importance';
|
|
153
|
+
/**
|
|
154
|
+
* The appearance of one POI category. With the default `importance` order every category shares
|
|
155
|
+
* one placement layer, so categories may differ only in properties MapLibre evaluates per feature
|
|
156
|
+
* (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
|
|
157
|
+
* overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
|
|
158
|
+
*/
|
|
159
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
|
|
160
|
+
type TileflowPoiModuleConfig = {
|
|
161
|
+
type: 'poi';
|
|
162
|
+
categories?: readonly TileflowPoiCategory[];
|
|
163
|
+
color?: TileflowPoiColorMode;
|
|
164
|
+
/** One density for the whole module: World's ranks decide what each category shows. */
|
|
165
|
+
density?: TileflowPoiDensity;
|
|
166
|
+
icons?: boolean;
|
|
167
|
+
labels?: boolean;
|
|
168
|
+
minZoom?: number;
|
|
169
|
+
placement?: {
|
|
170
|
+
/**
|
|
171
|
+
* Places each pictogram with its name as one unit that needs room for both. Defaults to
|
|
172
|
+
* `false`.
|
|
173
|
+
*/
|
|
174
|
+
coupleIconAndLabel?: boolean;
|
|
175
|
+
iconPadding?: number;
|
|
176
|
+
/**
|
|
177
|
+
* World POI `type` values whose pictogram explains them. When pictograms and names are both
|
|
178
|
+
* drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
|
|
179
|
+
* Defaults to parking and public toilets.
|
|
180
|
+
*/
|
|
181
|
+
iconOnlyTypes?: readonly string[];
|
|
182
|
+
/** Defaults to `importance`. */
|
|
183
|
+
order?: TileflowPoiPlacementOrder;
|
|
184
|
+
/**
|
|
185
|
+
* With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
|
|
186
|
+
* before the map's road and place labels, and the others after them. A map that gives street
|
|
187
|
+
* names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
|
|
188
|
+
* way. Unset, every POI is placed at the module's own position.
|
|
189
|
+
*/
|
|
190
|
+
prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
191
|
+
textPadding?: number;
|
|
192
|
+
};
|
|
193
|
+
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
194
|
+
};
|
|
195
|
+
type MapLibreSprite = string | Array<{
|
|
196
|
+
id: string;
|
|
197
|
+
url: string;
|
|
198
|
+
}>;
|
|
199
|
+
type TileflowProjection = 'globe' | 'mercator';
|
|
200
|
+
type TileflowLight = {
|
|
201
|
+
anchor?: 'map' | 'viewport';
|
|
202
|
+
color?: TileflowColor;
|
|
203
|
+
intensity?: number;
|
|
204
|
+
position?: readonly [number, number, number];
|
|
205
|
+
};
|
|
206
|
+
type MapLibreStyle = {
|
|
207
|
+
sky?: Record<string, unknown>;
|
|
208
|
+
version: 8;
|
|
209
|
+
name: string;
|
|
210
|
+
glyphs?: string;
|
|
211
|
+
light?: TileflowLight;
|
|
212
|
+
projection?: {
|
|
213
|
+
type: TileflowProjection;
|
|
214
|
+
};
|
|
215
|
+
sprite?: MapLibreSprite;
|
|
216
|
+
sources: Record<string, Record<string, unknown>>;
|
|
217
|
+
layers: Array<Record<string, unknown>>;
|
|
218
|
+
terrain?: Record<string, unknown>;
|
|
219
|
+
metadata?: Record<string, unknown>;
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
type ShadowPoint = readonly number[];
|
|
223
|
+
type ShadowBox = Readonly<{
|
|
224
|
+
min: ShadowPoint;
|
|
225
|
+
max: ShadowPoint;
|
|
226
|
+
}>;
|
|
227
|
+
type ShadowRange = readonly [number, number];
|
|
228
|
+
/** The light-space ranges a light view covers: across and up the shadow map, and along the light. */
|
|
229
|
+
type ShadowFit = Readonly<{
|
|
230
|
+
right: ShadowRange;
|
|
231
|
+
up: ShadowRange;
|
|
232
|
+
depth: ShadowRange;
|
|
233
|
+
}>;
|
|
234
|
+
type ShadowView = Readonly<{
|
|
235
|
+
/** Visible receiver points, in the caster box's metre frame. All casters still draw. */
|
|
236
|
+
receivers?: readonly ShadowPoint[];
|
|
237
|
+
/** Snap to world-aligned texels; omit for an unsnapped mathematical projection. */
|
|
238
|
+
resolution?: number;
|
|
239
|
+
origin?: ShadowPoint;
|
|
240
|
+
/** Metres per fixed world unit; keeps texel quantization independent of latitude scale. */
|
|
241
|
+
gridScale?: number;
|
|
242
|
+
/** A share of the focused span added on each side, so a moving view stays inside the fit. */
|
|
243
|
+
margin?: number;
|
|
244
|
+
/**
|
|
245
|
+
* A fit in the same frame and light, kept on each axis while it covers the view and is at most
|
|
246
|
+
* half again as wide as a new fit would be.
|
|
247
|
+
*/
|
|
248
|
+
previous?: ShadowFit;
|
|
249
|
+
}>;
|
|
250
|
+
/**
|
|
251
|
+
* The sun's orthographic view, in metres, with room for each caster's shadow to reach the ground.
|
|
252
|
+
* Optional receivers concentrate XY resolution without dropping offscreen casters along a ray;
|
|
253
|
+
* quantized extents and a world-anchored texel grid keep stationary shadows stable during pans.
|
|
254
|
+
*/
|
|
255
|
+
declare function tileflowSunLightMatrix(direction: readonly number[], box: ShadowBox, view?: ShadowView): {
|
|
256
|
+
matrix: Float32Array;
|
|
257
|
+
depth: number;
|
|
258
|
+
extent: number;
|
|
259
|
+
fit: ShadowFit;
|
|
260
|
+
};
|
|
261
|
+
|
|
1
262
|
/** Inputs to one fixed-size, application-owned RGBA image. */
|
|
2
263
|
type TileflowDynamicImageContext = Readonly<{
|
|
3
264
|
theme: string;
|
|
@@ -75,318 +336,13 @@ declare function registerTileflowWorldRequestBridge(input: {
|
|
|
75
336
|
declare function tileflowFairUseNoticeMessage(state: TileflowFairUseNoticeState): string;
|
|
76
337
|
declare function attachTileflowFairUseNotice(container: HTMLElement): TileflowFairUseNoticeController;
|
|
77
338
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
type
|
|
83
|
-
type
|
|
84
|
-
|
|
85
|
-
font: string;
|
|
86
|
-
image: string;
|
|
87
|
-
number: number;
|
|
88
|
-
};
|
|
89
|
-
/** A JSON-safe semantic reference. The category is carried at runtime as well as in its type. */
|
|
90
|
-
type TileflowThemeTokenReference<TCategory extends TileflowThemeTokenCategory = TileflowThemeTokenCategory> = {
|
|
91
|
-
readonly category: TCategory;
|
|
92
|
-
readonly kind: 'theme-token';
|
|
93
|
-
readonly token: string;
|
|
94
|
-
readonly [themeValueBrand]: TileflowThemeTokenPrimitive[TCategory];
|
|
95
|
-
};
|
|
96
|
-
/** An explicit opt-out from theme substitution. A reason is mandatory for auditability. */
|
|
97
|
-
type TileflowFixedValue<T> = {
|
|
98
|
-
readonly kind: 'theme-fixed';
|
|
99
|
-
readonly reason: string;
|
|
100
|
-
readonly value: T;
|
|
101
|
-
readonly [themeValueBrand]: T;
|
|
102
|
-
};
|
|
103
|
-
type TileflowThemeColorMix = {
|
|
104
|
-
readonly amount: TileflowThemeNumberValue;
|
|
105
|
-
readonly from: TileflowThemeColorValue;
|
|
106
|
-
readonly kind: 'theme-color';
|
|
107
|
-
readonly operation: 'mix';
|
|
108
|
-
readonly space: 'oklch';
|
|
109
|
-
readonly to: TileflowThemeColorValue;
|
|
110
|
-
readonly [themeValueBrand]: string;
|
|
111
|
-
};
|
|
112
|
-
type TileflowThemeColorAlpha = {
|
|
113
|
-
readonly color: TileflowThemeColorValue;
|
|
114
|
-
readonly kind: 'theme-color';
|
|
115
|
-
readonly opacity: TileflowThemeNumberValue;
|
|
116
|
-
readonly operation: 'alpha';
|
|
117
|
-
readonly [themeValueBrand]: string;
|
|
118
|
-
};
|
|
119
|
-
type TileflowThemeColorOperation = TileflowThemeColorAlpha | TileflowThemeColorMix;
|
|
120
|
-
type TileflowThemeNumberValue = number | TileflowFixedValue<number> | TileflowThemeTokenReference<'number'>;
|
|
121
|
-
type TileflowThemeColorValue = string | TileflowFixedValue<string> | TileflowThemeColorOperation | TileflowThemeTokenReference<'color'>;
|
|
122
|
-
type TileflowThemeFontValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'font'>;
|
|
123
|
-
type TileflowThemeImageValue = string | TileflowFixedValue<string> | TileflowThemeTokenReference<'image'>;
|
|
124
|
-
type TileflowExpression<T> = {
|
|
125
|
-
readonly kind: 'expression';
|
|
126
|
-
readonly value: readonly unknown[];
|
|
127
|
-
/** Opaque result type. Only Tileflow's closed `expr.*` builders expose this brand publicly. */
|
|
128
|
-
readonly [expressionBrand]: T;
|
|
129
|
-
};
|
|
130
|
-
type TileflowZoomValueCommon<T> = {
|
|
131
|
-
readonly kind: 'zoom';
|
|
132
|
-
readonly stops: readonly (readonly [number, T])[];
|
|
133
|
-
readonly [zoomBrand]?: T;
|
|
134
|
-
};
|
|
135
|
-
type TileflowZoomValue<T> = TileflowZoomValueCommon<T> & ({
|
|
136
|
-
readonly base: number;
|
|
137
|
-
readonly interpolation: 'exponential';
|
|
138
|
-
} | {
|
|
139
|
-
readonly base?: never;
|
|
140
|
-
readonly interpolation: 'linear' | 'step';
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
/** A color literal, semantic color token, color operation, expression, or zoom ramp. */
|
|
144
|
-
type TileflowColorStyleValue = TileflowExpression<string> | TileflowThemeColorValue | TileflowZoomValue<TileflowThemeColorValue>;
|
|
145
|
-
/** An image name, semantic image token, expression, or zoom ramp. */
|
|
146
|
-
type TileflowImageStyleValue = TileflowExpression<string> | TileflowThemeImageValue | TileflowZoomValue<TileflowThemeImageValue>;
|
|
147
|
-
/** A number, semantic number token, expression, or zoom ramp. */
|
|
148
|
-
type TileflowNumberStyleValue = TileflowExpression<number> | TileflowThemeNumberValue | TileflowZoomValue<TileflowThemeNumberValue>;
|
|
149
|
-
/** A visual numeric array whose components may be themed, or whose full shape is fixed. */
|
|
150
|
-
type TileflowThemeNumberArrayValue = readonly TileflowThemeNumberValue[] | TileflowFixedValue<readonly number[]>;
|
|
151
|
-
/** A visual numeric array, expression, or zoom ramp with explicit theme intent. */
|
|
152
|
-
type TileflowNumberArrayStyleValue = TileflowExpression<readonly number[]> | TileflowThemeNumberArrayValue | TileflowZoomValue<TileflowThemeNumberArrayValue>;
|
|
153
|
-
/** A two-dimensional visual offset with category-safe numeric components. */
|
|
154
|
-
type TileflowNumberOffsetStyleValue = readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [TileflowThemeNumberValue, TileflowThemeNumberValue] | TileflowFixedValue<readonly number[]>>;
|
|
155
|
-
/** Top, right, bottom, and left visual insets with category-safe numeric components. */
|
|
156
|
-
type TileflowNumberInsetsStyleValue = readonly [
|
|
157
|
-
TileflowThemeNumberValue,
|
|
158
|
-
TileflowThemeNumberValue,
|
|
159
|
-
TileflowThemeNumberValue,
|
|
160
|
-
TileflowThemeNumberValue
|
|
161
|
-
] | TileflowFixedValue<readonly [number, number, number, number]> | TileflowExpression<readonly number[]> | TileflowZoomValue<readonly [
|
|
162
|
-
TileflowThemeNumberValue,
|
|
163
|
-
TileflowThemeNumberValue,
|
|
164
|
-
TileflowThemeNumberValue,
|
|
165
|
-
TileflowThemeNumberValue
|
|
166
|
-
] | TileflowFixedValue<readonly [number, number, number, number]>>;
|
|
167
|
-
/** A structural value that does not participate in semantic theme-token substitution. */
|
|
168
|
-
type TileflowStructuralStyleValue<T> = T | TileflowExpression<T> | TileflowZoomValue<T>;
|
|
169
|
-
/** Structural text, including expressions and zoom-dependent literal strings. */
|
|
170
|
-
type TileflowStringStyleValue = TileflowStructuralStyleValue<string>;
|
|
171
|
-
type TileflowLineCap = 'butt' | 'round' | 'square';
|
|
172
|
-
type TileflowLineJoin = 'bevel' | 'miter' | 'round';
|
|
173
|
-
type TileflowSymbolPlacement = 'line' | 'line-center' | 'point';
|
|
174
|
-
type TileflowSymbolZOrder = 'auto' | 'source' | 'viewport-y';
|
|
175
|
-
type TileflowPriorityOrder = 'higher-first' | 'lower-first';
|
|
176
|
-
type TileflowTextAnchor = 'bottom' | 'bottom-left' | 'bottom-right' | 'center' | 'left' | 'right' | 'top' | 'top-left' | 'top-right';
|
|
177
|
-
type TileflowTextJustify = 'auto' | 'center' | 'left' | 'right';
|
|
178
|
-
type TileflowIconAnchor = TileflowTextAnchor;
|
|
179
|
-
type TileflowAlignment = 'auto' | 'map' | 'viewport';
|
|
180
|
-
type TileflowIconTextFit = 'both' | 'height' | 'none' | 'width';
|
|
181
|
-
/**
|
|
182
|
-
* How a symbol part treats collisions with symbols placed before it. `never` hides it, `always`
|
|
183
|
-
* shows it, and `cooperative` shows it unless the earlier symbol was placed with `never`.
|
|
184
|
-
*/
|
|
185
|
-
type TileflowSymbolOverlap = 'always' | 'cooperative' | 'never';
|
|
186
|
-
/** Visibility and zoom bounds shared by every visual primitive. */
|
|
187
|
-
type TileflowLayerRange = {
|
|
188
|
-
maxZoom?: number;
|
|
189
|
-
minZoom?: number;
|
|
190
|
-
visible?: boolean;
|
|
191
|
-
};
|
|
192
|
-
type TileflowBackgroundPaint = {
|
|
193
|
-
color?: TileflowColorStyleValue;
|
|
194
|
-
opacity?: TileflowNumberStyleValue;
|
|
195
|
-
pattern?: TileflowImageStyleValue;
|
|
196
|
-
};
|
|
197
|
-
type TileflowBackgroundStyle = TileflowLayerRange & TileflowBackgroundPaint;
|
|
198
|
-
type TileflowFillPaint = {
|
|
199
|
-
antialias?: boolean;
|
|
200
|
-
color?: TileflowColorStyleValue;
|
|
201
|
-
opacity?: TileflowNumberStyleValue;
|
|
202
|
-
pattern?: TileflowImageStyleValue;
|
|
203
|
-
translate?: TileflowNumberOffsetStyleValue;
|
|
204
|
-
translateAnchor?: 'map' | 'viewport';
|
|
205
|
-
};
|
|
206
|
-
type TileflowFillStyle = TileflowLayerRange & TileflowFillPaint;
|
|
207
|
-
type TileflowLinePaint = {
|
|
208
|
-
blur?: TileflowNumberStyleValue;
|
|
209
|
-
color?: TileflowColorStyleValue;
|
|
210
|
-
dash?: TileflowNumberArrayStyleValue;
|
|
211
|
-
gapWidth?: TileflowNumberStyleValue;
|
|
212
|
-
offset?: TileflowNumberStyleValue;
|
|
213
|
-
opacity?: TileflowNumberStyleValue;
|
|
214
|
-
pattern?: TileflowImageStyleValue;
|
|
215
|
-
translate?: TileflowNumberOffsetStyleValue;
|
|
216
|
-
translateAnchor?: 'map' | 'viewport';
|
|
217
|
-
width?: TileflowNumberStyleValue;
|
|
218
|
-
};
|
|
219
|
-
type TileflowLineLayout = {
|
|
220
|
-
cap?: TileflowStructuralStyleValue<TileflowLineCap>;
|
|
221
|
-
join?: TileflowStructuralStyleValue<TileflowLineJoin>;
|
|
222
|
-
miterLimit?: TileflowNumberStyleValue;
|
|
223
|
-
roundLimit?: TileflowNumberStyleValue;
|
|
224
|
-
};
|
|
225
|
-
type TileflowLineStyle = TileflowLayerRange & TileflowLinePaint & TileflowLineLayout;
|
|
226
|
-
/** Repeated diagonal marks placed along a stroked geographic feature. */
|
|
227
|
-
type TileflowLineHatchStyle = TileflowLayerRange & {
|
|
228
|
-
angle?: TileflowNumberStyleValue;
|
|
229
|
-
color?: TileflowColorStyleValue;
|
|
230
|
-
opacity?: TileflowNumberStyleValue;
|
|
231
|
-
/** Sprite pattern clipped to the line deck; when set, it replaces glyph hatching. */
|
|
232
|
-
pattern?: TileflowImageStyleValue;
|
|
233
|
-
/**
|
|
234
|
-
* Intrinsic pixel heights available as `${pattern}-${width}` sprites. Tileflow
|
|
235
|
-
* selects the closest height to the rendered line width so marks retain a
|
|
236
|
-
* nearly fixed screen-pixel thickness instead of stretching with the road.
|
|
237
|
-
* Requires `pattern` to be a literal sprite-name prefix.
|
|
238
|
-
*/
|
|
239
|
-
patternWidths?: TileflowThemeNumberArrayValue;
|
|
240
|
-
size?: TileflowNumberStyleValue;
|
|
241
|
-
spacing?: TileflowNumberStyleValue;
|
|
242
|
-
};
|
|
243
|
-
type TileflowTextPaint = {
|
|
244
|
-
color?: TileflowColorStyleValue;
|
|
245
|
-
haloBlur?: TileflowNumberStyleValue;
|
|
246
|
-
haloColor?: TileflowColorStyleValue;
|
|
247
|
-
haloWidth?: TileflowNumberStyleValue;
|
|
248
|
-
opacity?: TileflowNumberStyleValue;
|
|
249
|
-
};
|
|
250
|
-
/**
|
|
251
|
-
* One opaque strip behind each shaped line of a label. Tileflow lowers it to a derived glyph stack
|
|
252
|
-
* whose cells MapLibre's text halo paints, so placement, wrapping and collision stay native.
|
|
253
|
-
*/
|
|
254
|
-
type TileflowTextBackground = {
|
|
255
|
-
/** Strip colour. Cells overlap at their joins, so the colour must be opaque. */
|
|
256
|
-
color: TileflowColorStyleValue;
|
|
257
|
-
/** `lines` fits one strip to each shaped line. */
|
|
258
|
-
fit: 'lines';
|
|
259
|
-
/** Strip extension beyond the first and last glyph of each line, in ems. Defaults to 0.33. */
|
|
260
|
-
padding?: TileflowThemeNumberValue;
|
|
261
|
-
};
|
|
262
|
-
type TileflowTextLayout = {
|
|
263
|
-
allowOverlap?: boolean;
|
|
264
|
-
anchor?: TileflowTextAnchor;
|
|
265
|
-
/**
|
|
266
|
-
* Replaces the text halo with line-fitted strips. Requires a map `glyphs` provider that serves
|
|
267
|
-
* derived stacks, one font without fallbacks, and constant `letterSpacing` and `lineHeight`.
|
|
268
|
-
*/
|
|
269
|
-
background?: TileflowTextBackground;
|
|
270
|
-
field?: TileflowStringStyleValue;
|
|
271
|
-
font?: TileflowThemeFontValue;
|
|
272
|
-
fallbacks?: readonly TileflowThemeFontValue[];
|
|
273
|
-
ignorePlacement?: boolean;
|
|
274
|
-
justify?: TileflowTextJustify;
|
|
275
|
-
keepUpright?: boolean;
|
|
276
|
-
letterSpacing?: TileflowNumberStyleValue;
|
|
277
|
-
lineHeight?: TileflowNumberStyleValue;
|
|
278
|
-
maxAngle?: TileflowNumberStyleValue;
|
|
279
|
-
maxWidth?: TileflowNumberStyleValue;
|
|
280
|
-
offset?: TileflowNumberOffsetStyleValue;
|
|
281
|
-
optional?: boolean;
|
|
282
|
-
/**
|
|
283
|
-
* Overlap mode. Takes precedence over `allowOverlap`, so the compiled layer carries only the mode.
|
|
284
|
-
* Native artifacts, whose renderer has no overlap modes, use `allowOverlap: false` for `never`
|
|
285
|
-
* and `true` otherwise.
|
|
286
|
-
*/
|
|
287
|
-
overlap?: TileflowSymbolOverlap;
|
|
288
|
-
padding?: TileflowNumberStyleValue;
|
|
289
|
-
pitchAlignment?: TileflowAlignment;
|
|
290
|
-
radialOffset?: TileflowNumberStyleValue;
|
|
291
|
-
rotate?: TileflowNumberStyleValue;
|
|
292
|
-
rotationAlignment?: TileflowAlignment;
|
|
293
|
-
size?: TileflowNumberStyleValue;
|
|
294
|
-
transform?: 'lowercase' | 'none' | 'uppercase';
|
|
295
|
-
variableAnchors?: readonly TileflowTextAnchor[];
|
|
296
|
-
};
|
|
297
|
-
type TileflowTextStyle = TileflowLayerRange & TileflowTextPaint & TileflowTextLayout;
|
|
298
|
-
type TileflowIconPaint = {
|
|
299
|
-
color?: TileflowColorStyleValue;
|
|
300
|
-
haloBlur?: TileflowNumberStyleValue;
|
|
301
|
-
haloColor?: TileflowColorStyleValue;
|
|
302
|
-
haloWidth?: TileflowNumberStyleValue;
|
|
303
|
-
opacity?: TileflowNumberStyleValue;
|
|
304
|
-
};
|
|
305
|
-
type TileflowIconLayout = {
|
|
306
|
-
allowOverlap?: boolean;
|
|
307
|
-
anchor?: TileflowIconAnchor;
|
|
308
|
-
image?: TileflowImageStyleValue;
|
|
309
|
-
ignorePlacement?: boolean;
|
|
310
|
-
keepUpright?: boolean;
|
|
311
|
-
offset?: TileflowNumberOffsetStyleValue;
|
|
312
|
-
optional?: boolean;
|
|
313
|
-
/**
|
|
314
|
-
* Overlap mode. Takes precedence over `allowOverlap`, so the compiled layer carries only the mode.
|
|
315
|
-
* Native artifacts, whose renderer has no overlap modes, use `allowOverlap: false` for `never`
|
|
316
|
-
* and `true` otherwise.
|
|
317
|
-
*/
|
|
318
|
-
overlap?: TileflowSymbolOverlap;
|
|
319
|
-
padding?: TileflowNumberStyleValue;
|
|
320
|
-
pitchAlignment?: TileflowAlignment;
|
|
321
|
-
rotate?: TileflowNumberStyleValue;
|
|
322
|
-
rotationAlignment?: TileflowAlignment;
|
|
323
|
-
size?: TileflowNumberStyleValue;
|
|
324
|
-
textFit?: TileflowIconTextFit;
|
|
325
|
-
textFitPadding?: TileflowNumberInsetsStyleValue;
|
|
326
|
-
};
|
|
327
|
-
type TileflowIconStyle = TileflowLayerRange & TileflowIconPaint & TileflowIconLayout;
|
|
328
|
-
type TileflowSymbolPlacementStyle = TileflowLayerRange & {
|
|
329
|
-
placement?: TileflowSymbolPlacement;
|
|
330
|
-
priority?: TileflowStructuralStyleValue<number>;
|
|
331
|
-
/** Collision order for the semantic priority value. Defaults to `higher-first`. */
|
|
332
|
-
priorityOrder?: TileflowPriorityOrder;
|
|
333
|
-
spacing?: TileflowNumberStyleValue;
|
|
334
|
-
zOrder?: TileflowSymbolZOrder;
|
|
335
|
-
};
|
|
336
|
-
type TileflowCirclePaint = {
|
|
337
|
-
blur?: TileflowNumberStyleValue;
|
|
338
|
-
color?: TileflowColorStyleValue;
|
|
339
|
-
opacity?: TileflowNumberStyleValue;
|
|
340
|
-
pitchAlignment?: 'map' | 'viewport';
|
|
341
|
-
pitchScale?: 'map' | 'viewport';
|
|
342
|
-
priority?: TileflowStructuralStyleValue<number>;
|
|
343
|
-
/** Drawing order for the semantic priority value. Defaults to `higher-first`. */
|
|
344
|
-
priorityOrder?: TileflowPriorityOrder;
|
|
345
|
-
radius?: TileflowNumberStyleValue;
|
|
346
|
-
strokeColor?: TileflowColorStyleValue;
|
|
347
|
-
strokeOpacity?: TileflowNumberStyleValue;
|
|
348
|
-
strokeWidth?: TileflowNumberStyleValue;
|
|
349
|
-
translate?: TileflowNumberOffsetStyleValue;
|
|
350
|
-
translateAnchor?: 'map' | 'viewport';
|
|
351
|
-
};
|
|
352
|
-
type TileflowCircleStyle = TileflowLayerRange & TileflowCirclePaint;
|
|
353
|
-
type TileflowExtrusionPaint = {
|
|
354
|
-
base?: TileflowNumberStyleValue;
|
|
355
|
-
color?: TileflowColorStyleValue;
|
|
356
|
-
height?: TileflowNumberStyleValue;
|
|
357
|
-
opacity?: TileflowNumberStyleValue;
|
|
358
|
-
pattern?: TileflowImageStyleValue;
|
|
359
|
-
verticalGradient?: boolean;
|
|
360
|
-
};
|
|
361
|
-
type TileflowExtrusionStyle = TileflowLayerRange & TileflowExtrusionPaint;
|
|
362
|
-
/** A polygon rendered as a fill and, when requested, a separate line layer. */
|
|
363
|
-
type TileflowAreaStyle = {
|
|
364
|
-
fill?: TileflowFillStyle;
|
|
365
|
-
outline?: TileflowLineStyle;
|
|
366
|
-
};
|
|
367
|
-
/** The canonical ordered phases used for roads, aeroways, and other stroked paths. */
|
|
368
|
-
type TileflowLineStackStyle = {
|
|
369
|
-
casing?: TileflowLineStyle;
|
|
370
|
-
fill?: TileflowLineStyle;
|
|
371
|
-
shadow?: TileflowLineStyle;
|
|
372
|
-
};
|
|
373
|
-
/** A symbol layer composed from one placement policy and optional text/icon parts. */
|
|
374
|
-
type TileflowSymbolStyle = TileflowSymbolPlacementStyle & {
|
|
375
|
-
icon?: TileflowIconStyle;
|
|
376
|
-
text?: TileflowTextStyle;
|
|
377
|
-
};
|
|
378
|
-
/** A symbol style that may also materialize a separate circle marker layer. */
|
|
379
|
-
type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
|
|
380
|
-
marker?: TileflowCircleStyle;
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
type TileflowAddressesModuleOptions = {
|
|
384
|
-
/** Styling for OpenMapTiles point house-number labels. */
|
|
385
|
-
labels?: TileflowSymbolStyle;
|
|
386
|
-
};
|
|
387
|
-
type TileflowAddressesModuleConfig = TileflowAddressesModuleOptions & {
|
|
388
|
-
type: 'addresses';
|
|
389
|
-
};
|
|
339
|
+
type TileflowAddressesModuleOptions = {
|
|
340
|
+
/** Styling for OpenMapTiles point house-number labels. */
|
|
341
|
+
labels?: TileflowSymbolStyle;
|
|
342
|
+
};
|
|
343
|
+
type TileflowAddressesModuleConfig = TileflowAddressesModuleOptions & {
|
|
344
|
+
type: 'addresses';
|
|
345
|
+
};
|
|
390
346
|
|
|
391
347
|
type TileflowAerowaysModuleOptions = {
|
|
392
348
|
area?: TileflowAreaStyle;
|
|
@@ -408,6 +364,27 @@ type TileflowBoundariesModuleConfig = TileflowBoundariesModuleOptions & {
|
|
|
408
364
|
type: 'boundaries';
|
|
409
365
|
};
|
|
410
366
|
|
|
367
|
+
/** The parts of a model, each coloured by the theme: the model's materials name them. */
|
|
368
|
+
declare const tileflowModelParts: Readonly<{
|
|
369
|
+
surface: 0;
|
|
370
|
+
secondary: 1;
|
|
371
|
+
glass: 2;
|
|
372
|
+
accent: 3;
|
|
373
|
+
roof: 4;
|
|
374
|
+
}>;
|
|
375
|
+
type TileflowModelPart = keyof typeof tileflowModelParts;
|
|
376
|
+
/** Architectural roles control lighting independently of the model's palette slots. */
|
|
377
|
+
declare const tileflowModelLightingRoles: Readonly<{
|
|
378
|
+
unclassified: 0;
|
|
379
|
+
wall: 1;
|
|
380
|
+
door: 2;
|
|
381
|
+
roof: 3;
|
|
382
|
+
window: 4;
|
|
383
|
+
lamp: 5;
|
|
384
|
+
logo: 6;
|
|
385
|
+
}>;
|
|
386
|
+
type TileflowModelLightingRole = keyof typeof tileflowModelLightingRoles;
|
|
387
|
+
|
|
411
388
|
type TileflowBuildingMode = '3d' | 'flat';
|
|
412
389
|
/**
|
|
413
390
|
* How Core's 3D buildings renderer draws the map's buildings. Their colour is the map's own 3D
|
|
@@ -426,8 +403,62 @@ type TileflowBuildingsThreeDimensionalStyle = {
|
|
|
426
403
|
edgeColor?: TileflowThemeColorValue;
|
|
427
404
|
/** How bright the buildings light the street at night, from 0 (none) to 2; defaults to 0. */
|
|
428
405
|
nightLight?: TileflowThemeNumberValue;
|
|
406
|
+
/** Height-selected architectural flood lighting. Off by default; follows scene darkness. */
|
|
407
|
+
floodLight?: {
|
|
408
|
+
intensity?: TileflowThemeNumberValue;
|
|
409
|
+
/** Compensates authored light-colour transforms during darkness evaluation; defaults to 1. */
|
|
410
|
+
brightnessScale?: TileflowThemeNumberValue;
|
|
411
|
+
color?: TileflowThemeColorValue;
|
|
412
|
+
/** Stable per-building ground radius range in metres; defaults to [30, 100]. */
|
|
413
|
+
groundRadius?: readonly [number, number];
|
|
414
|
+
/** Ground light starts at this height in metres; defaults to 30. */
|
|
415
|
+
minGroundHeight?: number;
|
|
416
|
+
/** Wall light starts above this height in metres; defaults to 200. */
|
|
417
|
+
minWallHeight?: number;
|
|
418
|
+
/** Wall radius as a fraction of building height; defaults to 1/3. */
|
|
419
|
+
wallHeightRatio?: number;
|
|
420
|
+
};
|
|
421
|
+
/** Per-role physical materials and emission, separate from palette slots and occlusion. */
|
|
422
|
+
modelLighting?: Partial<Record<TileflowModelLightingRole, {
|
|
423
|
+
emissiveStrength?: TileflowThemeNumberValue;
|
|
424
|
+
/** Stable per-model addition to emission, from zero to this amount. */
|
|
425
|
+
emissiveVariation?: TileflowThemeNumberValue;
|
|
426
|
+
emissiveColor?: TileflowThemeColorValue;
|
|
427
|
+
/** Height fractions, multipliers and curve exponent; defaults to a constant multiplier of one. */
|
|
428
|
+
emissiveHeight?: readonly [
|
|
429
|
+
TileflowThemeNumberValue,
|
|
430
|
+
TileflowThemeNumberValue,
|
|
431
|
+
TileflowThemeNumberValue,
|
|
432
|
+
TileflowThemeNumberValue,
|
|
433
|
+
TileflowThemeNumberValue
|
|
434
|
+
];
|
|
435
|
+
/** Physical-material tint. Explicit modelColors take precedence. */
|
|
436
|
+
color?: TileflowThemeColorValue;
|
|
437
|
+
colorMix?: TileflowThemeNumberValue;
|
|
438
|
+
metallic?: TileflowThemeNumberValue;
|
|
439
|
+
roughness?: TileflowThemeNumberValue;
|
|
440
|
+
/** Independent HSL ranges, seeded by model identity; no window geometry is invented. */
|
|
441
|
+
colorVariation?: {
|
|
442
|
+
hue: readonly [TileflowThemeNumberValue, TileflowThemeNumberValue];
|
|
443
|
+
saturation: readonly [TileflowThemeNumberValue, TileflowThemeNumberValue];
|
|
444
|
+
lightness: readonly [TileflowThemeNumberValue, TileflowThemeNumberValue];
|
|
445
|
+
space?: 'srgb' | 'linear';
|
|
446
|
+
};
|
|
447
|
+
}>>;
|
|
448
|
+
/**
|
|
449
|
+
* The zoom bands the city comes in over: zooming in, across each band its part fades in and rises
|
|
450
|
+
* from the ground, and zooming out it sinks and fades again. Defaults to the 0.3 zooms from the
|
|
451
|
+
* renderer's `minzoom` (15) for the buildings, and to the 0.4 zooms from 0.8 before it for the
|
|
452
|
+
* placed models and landmarks, which stand first. With reduced motion they only fade.
|
|
453
|
+
*/
|
|
454
|
+
entrance?: {
|
|
455
|
+
buildings?: readonly [number, number];
|
|
456
|
+
models?: readonly [number, number];
|
|
457
|
+
};
|
|
429
458
|
/** Contact shadow at the foot of the walls and in tight corners; defaults to true. */
|
|
430
459
|
occlusion?: boolean;
|
|
460
|
+
/** Prepared model ambient occlusion strength, from 0 to 1; defaults to 0.75. */
|
|
461
|
+
modelOcclusion?: TileflowThemeNumberValue;
|
|
431
462
|
/** Shadows from the sun, on the buildings and the flat map; defaults to true. */
|
|
432
463
|
shadows?: boolean;
|
|
433
464
|
/**
|
|
@@ -520,22 +551,47 @@ type TileflowLandformsModuleConfig = TileflowLandformsModuleOptions & {
|
|
|
520
551
|
|
|
521
552
|
/** Labels anchored inside polygon features; point-feature labels remain on their feature style. */
|
|
522
553
|
type TileflowNauticalAreaLabelStyles = {
|
|
554
|
+
/** Provider coverage cells; hidden unless a map makes this style visible. */
|
|
523
555
|
coverage?: TileflowSymbolStyle;
|
|
524
556
|
hazards?: TileflowSymbolStyle;
|
|
525
557
|
navigationAreas?: TileflowSymbolStyle;
|
|
526
558
|
reefs?: TileflowSymbolStyle;
|
|
527
559
|
wrecks?: TileflowSymbolStyle;
|
|
528
560
|
};
|
|
561
|
+
/**
|
|
562
|
+
* One style per semantic group of `nautical-v1` objects. Point groups draw a circle `marker`, an
|
|
563
|
+
* `icon` from the theme's nautical image tokens, and `text`; area groups draw a `fill` and an
|
|
564
|
+
* `outline`; line groups draw one stroke. Every group respects each feature's `min_zoom`, and
|
|
565
|
+
* point groups place more important features (lower `rank`) first.
|
|
566
|
+
*/
|
|
529
567
|
type TileflowNauticalModuleOptions = {
|
|
568
|
+
/** Other aids: moorings, fog signals, racons, radio and signal stations, and virtual aids. */
|
|
530
569
|
aids?: TileflowMarkerSymbolStyle;
|
|
570
|
+
/** Fixed beacons and daymarks, coloured by their first colour. */
|
|
571
|
+
beacons?: TileflowMarkerSymbolStyle;
|
|
572
|
+
/** Buoys, light floats, and light vessels, coloured by their first colour. */
|
|
573
|
+
buoys?: TileflowMarkerSymbolStyle;
|
|
574
|
+
/** Submarine cable and pipeline lines. */
|
|
575
|
+
cables?: TileflowLineStyle;
|
|
576
|
+
/** Restrained indication of where a provider publishes marks. */
|
|
531
577
|
coverage?: TileflowAreaStyle;
|
|
578
|
+
/** Harbour and marina points. */
|
|
579
|
+
harbours?: TileflowMarkerSymbolStyle;
|
|
580
|
+
/** Hazard areas; the outline also strokes linear hazards such as booms. */
|
|
532
581
|
hazardAreas?: TileflowAreaStyle;
|
|
582
|
+
/** Rocks by water level, obstructions, and offshore platforms. */
|
|
533
583
|
hazards?: TileflowMarkerSymbolStyle;
|
|
534
584
|
labels?: TileflowNauticalAreaLabelStyles;
|
|
535
585
|
lighthouses?: TileflowMarkerSymbolStyle;
|
|
586
|
+
/** Light flares coloured by the light's first colour, with the chart light label. */
|
|
536
587
|
lights?: TileflowMarkerSymbolStyle;
|
|
588
|
+
/** Restricted, military, anchorage, traffic-separation, and other navigation areas. */
|
|
537
589
|
navigationAreas?: TileflowAreaStyle;
|
|
590
|
+
/** Ports, sized by `size` and placed by `rank` from low zooms. */
|
|
591
|
+
ports?: TileflowMarkerSymbolStyle;
|
|
538
592
|
reefs?: TileflowAreaStyle;
|
|
593
|
+
/** Traffic-separation lines and recommended routes, tracks, and ferry routes. */
|
|
594
|
+
routes?: TileflowLineStyle;
|
|
539
595
|
soundings?: TileflowMarkerSymbolStyle;
|
|
540
596
|
wreckAreas?: TileflowAreaStyle;
|
|
541
597
|
wrecks?: TileflowMarkerSymbolStyle;
|
|
@@ -560,512 +616,36 @@ type TileflowTransitModuleConfig = TileflowTransitModuleOptions & {
|
|
|
560
616
|
type: 'transit';
|
|
561
617
|
};
|
|
562
618
|
|
|
563
|
-
/** A prepared model, near and optionally far, as the style's tree description carries it. */
|
|
564
|
-
type TileflowTreeModel = Readonly<{
|
|
565
|
-
near: string;
|
|
566
|
-
far?: string;
|
|
567
|
-
}>;
|
|
568
|
-
|
|
569
|
-
type TileflowTileGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
570
|
-
type TileflowTileFeature = Readonly<{
|
|
571
|
-
/** The feature's id in the tile, when it has one. */
|
|
572
|
-
id?: number;
|
|
573
|
-
type: TileflowTileGeometryType;
|
|
574
|
-
properties: Readonly<Record<string, string | number | boolean>>;
|
|
575
|
-
/**
|
|
576
|
-
* One flat `[x0, y0, x1, y1, …]` array per point set, line or ring, in tile units from 0 to the
|
|
577
|
-
* layer's extent (coordinates in a tile's buffer fall outside that range). Polygon rings follow
|
|
578
|
-
* the MVT winding: an exterior ring is clockwise in tile units, a hole anticlockwise.
|
|
579
|
-
*/
|
|
580
|
-
geometry: readonly (readonly number[])[];
|
|
581
|
-
}>;
|
|
582
|
-
type TileflowTileLayer = Readonly<{
|
|
583
|
-
/** Tile units across the tile, usually 4096. */
|
|
584
|
-
extent: number;
|
|
585
|
-
features: readonly TileflowTileFeature[];
|
|
586
|
-
}>;
|
|
587
|
-
type TileflowVectorTileDecodeOptions = Readonly<{
|
|
588
|
-
/** The layers to decode; others are skipped without decoding. Defaults to every layer. */
|
|
589
|
-
layers?: readonly string[];
|
|
590
|
-
}>;
|
|
591
|
-
/** Decodes a Mapbox Vector Tile's layers. Throws on bytes that are not a vector tile. */
|
|
592
|
-
declare function decodeTileflowVectorTile(bytes: Uint8Array, options?: TileflowVectorTileDecodeOptions): Readonly<Record<string, TileflowTileLayer>>;
|
|
593
|
-
|
|
594
|
-
/** The forms a 3D tree takes. */
|
|
595
|
-
declare const tileflowTreeForms: readonly ["round", "open", "tall", "conifer", "columnar", "palm"];
|
|
596
|
-
type TileflowTreeForm = (typeof tileflowTreeForms)[number];
|
|
597
|
-
/** How a tree's surfaces take the light: facets, a smooth round shape, or bands as drawn. */
|
|
598
|
-
declare const tileflowTreeFinishes: readonly ["faceted", "smooth", "toon"];
|
|
599
|
-
type TileflowTreeFinish = (typeof tileflowTreeFinishes)[number];
|
|
600
|
-
/** A form's own scales, on top of the map's, and the map's own models it draws. */
|
|
601
|
-
type TileflowTreeFormStyle = Readonly<{
|
|
602
|
-
heightScale?: number;
|
|
603
|
-
crownScale?: number;
|
|
604
|
-
/** Ids of the map's own models, one to four; each tree draws one by its stable seed. */
|
|
605
|
-
models?: readonly string[];
|
|
606
|
-
}>;
|
|
607
|
-
/** Relative weights of the forms given to trees whose data gives none. */
|
|
608
|
-
type TileflowTreeFormMix = Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
609
|
-
/** A region whose trees without a form in the data take their own mix. */
|
|
610
|
-
type TileflowTreeRegion = Readonly<{
|
|
611
|
-
/** `[west, south, east, north]` in degrees. */
|
|
612
|
-
bounds: readonly [number, number, number, number];
|
|
613
|
-
unknownForms: TileflowTreeFormMix;
|
|
614
|
-
}>;
|
|
615
|
-
/** The fields of the tree and canopy layers, as World names them. */
|
|
616
|
-
type TileflowTreeFields = Readonly<{
|
|
617
|
-
height: string;
|
|
618
|
-
diameterCrown: string;
|
|
619
|
-
circumference: string;
|
|
620
|
-
genus: string;
|
|
621
|
-
species: string;
|
|
622
|
-
leafType: string;
|
|
623
|
-
/** The tree's taxon at any rank, such as `Arecaceae` for palms or a genus or species. */
|
|
624
|
-
taxon: string;
|
|
625
|
-
canopyRank: string;
|
|
626
|
-
canopyClearance: string;
|
|
627
|
-
canopyCover: string;
|
|
628
|
-
/** A canopy point's measured canopy height, in metres. */
|
|
629
|
-
canopyHeight: string;
|
|
630
|
-
/** The kind of barrier in the hedge layer: hedges are `hedge`. */
|
|
631
|
-
subclass: string;
|
|
632
|
-
/** A hedge's kind: `hedge_bank` when it stands on an earth bank. */
|
|
633
|
-
hedge: string;
|
|
634
|
-
}>;
|
|
635
|
-
type TileflowTreePlacementOptions = Readonly<{
|
|
636
|
-
/** The tile's address, for regions and for a stable look per tree. */
|
|
637
|
-
tile: Readonly<{
|
|
638
|
-
x: number;
|
|
639
|
-
y: number;
|
|
640
|
-
z: number;
|
|
641
|
-
}>;
|
|
642
|
-
/** The tile's width in metres. */
|
|
643
|
-
tileMetres: number;
|
|
644
|
-
fields?: Partial<TileflowTreeFields>;
|
|
645
|
-
unknownForms?: TileflowTreeFormMix;
|
|
646
|
-
regions?: readonly TileflowTreeRegion[];
|
|
647
|
-
/** Metres between the trees of a row; defaults to 8. */
|
|
648
|
-
rowSpacing?: number;
|
|
649
|
-
/** How many models each form draws from, 1 to 4; each tree draws one by its seed. */
|
|
650
|
-
variants?: Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
651
|
-
}>;
|
|
652
|
-
/** A tile's layers trees come from, as World names them. */
|
|
653
|
-
type TileflowTreeLayers = Readonly<{
|
|
654
|
-
/**
|
|
655
|
-
* World's `tree`: trees mapped one by one as points, and rows of trees as lines, planted every
|
|
656
|
-
* `rowSpacing` metres.
|
|
657
|
-
*/
|
|
658
|
-
trees?: TileflowTileLayer;
|
|
659
|
-
/** Decorative canopy points in parks and gardens (World's `canopy`). */
|
|
660
|
-
canopy?: TileflowTileLayer;
|
|
661
|
-
/**
|
|
662
|
-
* World's `traffic_control`: its hedges, lines and areas of `subclass=hedge`, stand as clipped
|
|
663
|
-
* pieces along each line and round each area. Other barriers are left out.
|
|
664
|
-
*/
|
|
665
|
-
hedges?: TileflowTileLayer;
|
|
666
|
-
}>;
|
|
667
|
-
/** Where some trees are in a placement, and how many of them have each rank or a lower one. */
|
|
668
|
-
type TileflowTreeRange = Readonly<{
|
|
669
|
-
start: number;
|
|
670
|
-
count: number;
|
|
671
|
-
/** `upTo[r]`: trees of the range with a rank of `r` or lower, from 0 to 15. */
|
|
672
|
-
upTo: readonly number[];
|
|
673
|
-
}>;
|
|
674
|
-
/** Where a form's trees are in a placement, and those of each of its models in turn. */
|
|
675
|
-
type TileflowTreeFormRange = TileflowTreeRange & Readonly<{
|
|
676
|
-
/** One range per model the form draws from, in order; one when it draws Core's own tree. */
|
|
677
|
-
variants: readonly TileflowTreeRange[];
|
|
678
|
-
}>;
|
|
679
|
-
/** One tile's trees, ready to upload. */
|
|
680
|
-
type TileflowTreePlacement = Readonly<{
|
|
681
|
-
/** `tileflowTreeBytes` bytes per tree, ordered by form, model, then rank; see the layout below. */
|
|
682
|
-
trees: Uint8Array;
|
|
683
|
-
forms: Readonly<Record<TileflowTreeForm, TileflowTreeFormRange>>;
|
|
684
|
-
/**
|
|
685
|
-
* `tileflowTreeBytes` bytes per piece of hedge, as a tree's: its middle, its height, its length
|
|
686
|
-
* as the crown, and its turn along the hedge.
|
|
687
|
-
*/
|
|
688
|
-
hedges: Uint8Array;
|
|
689
|
-
/** The tallest tree or hedge, in metres. */
|
|
690
|
-
tallest: number;
|
|
691
|
-
/** Trees from the data's trees and rows, and trees from canopy points. */
|
|
692
|
-
mapped: number;
|
|
693
|
-
canopy: number;
|
|
694
|
-
}>;
|
|
695
|
-
/**
|
|
696
|
-
* Bytes per tree: x and y in tile units of 8192 (uint16 each), height and crown diameter in
|
|
697
|
-
* decimetres (uint16 each), then one byte each for its turn (of a full turn), its shade among the
|
|
698
|
-
* theme's colours, its form, its rank (0–15, lower shows first), a seed, whether it stands for a
|
|
699
|
-
* canopy point (1) or a mapped tree (0), the model of its form it draws, and a byte of padding.
|
|
700
|
-
*/
|
|
701
|
-
declare const tileflowTreeBytes = 16;
|
|
702
|
-
/**
|
|
703
|
-
* The form a tree's data gives it, or undefined when its data says nothing about its form: a palm
|
|
704
|
-
* by `leaf_type` or genus, a column, a conifer by `leaf_type` or genus, or one of the broadleaf
|
|
705
|
-
* forms by genus. `broadleaf` means the data says broadleaved without a known genus.
|
|
706
|
-
*/
|
|
707
|
-
declare function tileflowTreeFormOf(properties: Readonly<Record<string, unknown>>, fields?: Partial<TileflowTreeFields>): TileflowTreeForm | 'broadleaf' | undefined;
|
|
708
|
-
/** Places a tile's trees. Points in the tile's buffer belong to the neighbouring tile. */
|
|
709
|
-
declare function placeTileflowTrees(layers: TileflowTreeLayers, options: TileflowTreePlacementOptions): TileflowTreePlacement;
|
|
710
|
-
/** The style metadata key under which a compiled map describes its 3D trees. */
|
|
711
|
-
declare const tileflowVegetationMetadataKey = "tileflow:vegetation";
|
|
712
|
-
/** How a compiled map's 3D trees look and where their data is, resolved for one theme. */
|
|
713
|
-
type TileflowVegetation3D = Readonly<{
|
|
714
|
-
/** The vector source and its layers with the trees, the canopy points and the hedges. */
|
|
715
|
-
source: string;
|
|
716
|
-
layers: Readonly<{
|
|
717
|
-
tree: string;
|
|
718
|
-
canopy?: string;
|
|
719
|
-
hedge?: string;
|
|
720
|
-
}>;
|
|
721
|
-
fields: TileflowTreeFields;
|
|
722
|
-
/**
|
|
723
|
-
* Sunlit colours: bark, the leaves of each kind of tree from darkest to lightest, and those of
|
|
724
|
-
* hedges.
|
|
725
|
-
*/
|
|
726
|
-
colors: Readonly<{
|
|
727
|
-
bark: string;
|
|
728
|
-
broadleaf: readonly string[];
|
|
729
|
-
conifer: readonly string[];
|
|
730
|
-
palm: readonly string[];
|
|
731
|
-
hedge: readonly string[];
|
|
732
|
-
}>;
|
|
733
|
-
heightScale: number;
|
|
734
|
-
crownScale: number;
|
|
735
|
-
/** Each form's own scales and models. */
|
|
736
|
-
forms: Readonly<Partial<Record<TileflowTreeForm, TileflowTreeFormStyle>>>;
|
|
737
|
-
/** The map's own models its forms draw, by id, prepared from its `models` directories. */
|
|
738
|
-
models: Readonly<Record<string, TileflowTreeModel>>;
|
|
739
|
-
finish: TileflowTreeFinish;
|
|
740
|
-
/** How strongly an outline rings each tree, from 0 (none) to 1, and its colour. */
|
|
741
|
-
edges: number;
|
|
742
|
-
edgeColor?: string;
|
|
743
|
-
unknownForms: TileflowTreeFormMix;
|
|
744
|
-
regions: readonly TileflowTreeRegion[];
|
|
745
|
-
/** The style's layers that draw the trees flat, which the 3D trees stand in for while shown. */
|
|
746
|
-
flatLayers: readonly string[];
|
|
747
|
-
}>;
|
|
748
|
-
/**
|
|
749
|
-
* Reads the 3D trees a compiled style describes, or undefined when its metadata has none or holds
|
|
750
|
-
* a version or shape this Core does not know.
|
|
751
|
-
*/
|
|
752
|
-
declare function readTileflowVegetation3D(metadata: unknown): TileflowVegetation3D | undefined;
|
|
753
|
-
|
|
754
|
-
type TileflowVegetationMode = '3d' | 'flat' | 'auto';
|
|
755
|
-
type TileflowVegetationThreeDimensionalStyle = {
|
|
756
|
-
barkColor?: TileflowThemeColorValue;
|
|
757
|
-
/** Sunlit leaf colours of broadleaf trees, from darkest to lightest; up to four are used. */
|
|
758
|
-
broadleafColors?: readonly TileflowThemeColorValue[];
|
|
759
|
-
/** Sunlit needle colours of conifers and columns, from darkest to lightest. */
|
|
760
|
-
coniferColors?: readonly TileflowThemeColorValue[];
|
|
761
|
-
/** Sunlit frond colours of palms, from darkest to lightest; the broadleaf colours by default. */
|
|
762
|
-
palmColors?: readonly TileflowThemeColorValue[];
|
|
763
|
-
/**
|
|
764
|
-
* Whether the data's hedges stand as clipped green walls beside the trees, at their height or
|
|
765
|
-
* 1.3 m, a metre higher on an earth bank. Defaults to true where the data has hedges.
|
|
766
|
-
*/
|
|
767
|
-
hedges?: boolean;
|
|
768
|
-
/** Sunlit colours of hedges, from darkest to lightest; the two darkest broadleaf colours by default. */
|
|
769
|
-
hedgeColors?: readonly TileflowThemeColorValue[];
|
|
770
|
-
crownScale?: TileflowThemeNumberValue;
|
|
771
|
-
heightScale?: TileflowThemeNumberValue;
|
|
772
|
-
/**
|
|
773
|
-
* How trees take the light: `faceted` (the default), low-poly facets softened towards a round
|
|
774
|
-
* crown; `smooth`, round crowns; or `toon`, three bands of light and a crisp shadow, as a drawn
|
|
775
|
-
* tree has them.
|
|
776
|
-
*/
|
|
777
|
-
finish?: TileflowTreeFinish;
|
|
778
|
-
/** How strongly an outline rings each tree, from 0 (none, the default) to 1. */
|
|
779
|
-
edges?: TileflowThemeNumberValue;
|
|
780
|
-
/** The outline's colour; the crown's darkest colour, deepened, by default. */
|
|
781
|
-
edgeColor?: TileflowThemeColorValue;
|
|
782
|
-
/**
|
|
783
|
-
* Each form's own scales, on top of `heightScale` and `crownScale`, such as taller palms, and the
|
|
784
|
-
* map's own models it draws: ids of `.glb` files in the map's `models` directories, one to four,
|
|
785
|
-
* each tree drawing one. A model's materials named `bark`, `leaves`, `fronds` or `stem` take
|
|
786
|
-
* those parts' colours.
|
|
787
|
-
*/
|
|
788
|
-
forms?: Partial<Record<TileflowTreeForm, {
|
|
789
|
-
heightScale?: TileflowThemeNumberValue;
|
|
790
|
-
crownScale?: TileflowThemeNumberValue;
|
|
791
|
-
models?: readonly string[];
|
|
792
|
-
}>>;
|
|
793
|
-
/**
|
|
794
|
-
* The forms of trees whose data gives none, as relative weights: `round`, `open` and `tall`
|
|
795
|
-
* (broadleaf), `conifer`, `columnar` and `palm`. Each tree draws one from a stable hash, so it
|
|
796
|
-
* keeps its form everywhere. Defaults to the three broadleaf forms, evenly. A tree the data calls
|
|
797
|
-
* broadleaved keeps to the broadleaf forms of the mix.
|
|
798
|
-
*/
|
|
799
|
-
unknownForms?: TileflowTreeFormMix;
|
|
800
|
-
/**
|
|
801
|
-
* Regions whose trees without a form in the data take their own mix, such as palms along a
|
|
802
|
-
* subtropical coast. Bounds are `[west, south, east, north]` in degrees; the first region holding
|
|
803
|
-
* a tree applies. At most 16.
|
|
804
|
-
*/
|
|
805
|
-
regions?: readonly TileflowTreeRegion[];
|
|
806
|
-
};
|
|
807
|
-
type TileflowVegetationModuleOptions = {
|
|
808
|
-
flat?: TileflowCircleStyle;
|
|
809
|
-
/** `3d` uses models at every pitch; `auto` follows the runtime's explicit 2D/3D view mode. */
|
|
810
|
-
mode?: TileflowVegetationMode;
|
|
811
|
-
/** Representation when a renderer cannot draw models. Defaults to `flat`. */
|
|
812
|
-
fallback?: 'flat' | 'none';
|
|
813
|
-
/** Initial visibility; a runtime control may override it. Defaults to true. */
|
|
814
|
-
visible?: boolean;
|
|
815
|
-
threeDimensional?: TileflowVegetationThreeDimensionalStyle;
|
|
816
|
-
};
|
|
817
|
-
type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
818
|
-
type: 'vegetation';
|
|
819
|
-
};
|
|
820
|
-
|
|
821
619
|
type TileflowWaterwayClass = 'canal' | 'other' | 'river' | 'stream';
|
|
822
620
|
/** Explicit placement for every geometry family in a declared Bathymetry name layer. */
|
|
823
621
|
type TileflowBathymetryNamePlacement = {
|
|
824
|
-
point: 'point';
|
|
825
|
-
line: TileflowSymbolPlacement;
|
|
826
|
-
polygon: TileflowSymbolPlacement;
|
|
827
|
-
};
|
|
828
|
-
type TileflowBathymetryNameStyle = TileflowSymbolStyle & {
|
|
829
|
-
/** Overrides scalar placement for these names; omission preserves scalar placement. */
|
|
830
|
-
placementByGeometry?: TileflowBathymetryNamePlacement;
|
|
831
|
-
};
|
|
832
|
-
type TileflowWaterModuleOptions = {
|
|
833
|
-
bathymetry?: TileflowFillStyle;
|
|
834
|
-
/** Contour lines when declared by Bathymetry; otherwise approximate polygon band edges. */
|
|
835
|
-
bathymetryContours?: TileflowLineStyle;
|
|
836
|
-
/** Contour-depth or legacy band-floor labels, not measured survey soundings. */
|
|
837
|
-
bathymetryLabels?: TileflowSymbolStyle;
|
|
838
|
-
/** Names from an explicitly declared seafloor_landform layer. */
|
|
839
|
-
bathymetryLandforms?: TileflowBathymetryNameStyle;
|
|
840
|
-
/** Names from an explicitly declared water_name layer. */
|
|
841
|
-
bathymetryWaterNames?: TileflowBathymetryNameStyle;
|
|
842
|
-
bodies?: TileflowAreaStyle;
|
|
843
|
-
intermittent?: {
|
|
844
|
-
bodies?: TileflowAreaStyle;
|
|
845
|
-
waterways?: TileflowLineStyle;
|
|
846
|
-
};
|
|
847
|
-
waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
|
|
848
|
-
};
|
|
849
|
-
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
850
|
-
type: 'water';
|
|
851
|
-
};
|
|
852
|
-
|
|
853
|
-
type TileflowColor = `#${string}`;
|
|
854
|
-
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
855
|
-
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
856
|
-
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
857
|
-
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
858
|
-
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
859
|
-
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
860
|
-
type TileflowRoadExtras = {
|
|
861
|
-
paths?: boolean;
|
|
862
|
-
};
|
|
863
|
-
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
864
|
-
hatch?: TileflowLineHatchStyle;
|
|
865
|
-
};
|
|
866
|
-
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
867
|
-
type TileflowRoadTreatmentLayerStyle = {
|
|
868
|
-
casing?: TileflowRoadTreatmentLineStyle;
|
|
869
|
-
fill?: TileflowRoadTreatmentLineStyle;
|
|
870
|
-
shadow?: TileflowRoadTreatmentLineStyle;
|
|
871
|
-
};
|
|
872
|
-
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
873
|
-
enabled?: boolean;
|
|
874
|
-
widthScale?: TileflowThemeNumberValue;
|
|
875
|
-
};
|
|
876
|
-
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
877
|
-
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
878
|
-
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
879
|
-
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
880
|
-
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
881
|
-
enabled?: boolean;
|
|
882
|
-
};
|
|
883
|
-
type TileflowRoadAreaStyle = {
|
|
884
|
-
pedestrian?: TileflowAreaStyle;
|
|
885
|
-
pier?: TileflowAreaStyle;
|
|
886
|
-
road?: TileflowAreaStyle;
|
|
887
|
-
};
|
|
888
|
-
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
889
|
-
type TileflowRoadRoundaboutStyle = {
|
|
890
|
-
/** Extra casing width in pixels, split equally across both edges; defaults to the road border. */
|
|
891
|
-
borderWidth?: TileflowNumberStyleValue;
|
|
892
|
-
casing?: TileflowCircleStyle;
|
|
893
|
-
/** Road width in pixels when metric radii are absent; defaults to the effective surface fill width. */
|
|
894
|
-
fallbackWidth?: TileflowNumberStyleValue;
|
|
895
|
-
fill?: TileflowCircleStyle;
|
|
896
|
-
};
|
|
897
|
-
/**
|
|
898
|
-
* How Core's street lights renderer lights the map's streets at night, from the lamps and lit
|
|
899
|
-
* streets its data holds.
|
|
900
|
-
*/
|
|
901
|
-
type TileflowRoadStreetLightStyle = {
|
|
902
|
-
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
903
|
-
color?: TileflowThemeColorValue;
|
|
904
|
-
/** Whether the map has street lights; defaults to false. Set true to opt in. */
|
|
905
|
-
enabled?: boolean;
|
|
906
|
-
/**
|
|
907
|
-
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
908
|
-
* pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
|
|
909
|
-
* that map few lamps, which invents light; `none` nowhere.
|
|
910
|
-
*/
|
|
911
|
-
estimate?: 'lit' | 'streets' | 'none';
|
|
912
|
-
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
913
|
-
intensity?: TileflowThemeNumberValue;
|
|
914
|
-
};
|
|
915
|
-
type TileflowRoadSidewalkStyle = {
|
|
916
|
-
outline?: TileflowLineStyle;
|
|
917
|
-
pattern?: TileflowFillStyle;
|
|
918
|
-
surface?: TileflowFillStyle;
|
|
919
|
-
};
|
|
920
|
-
type TileflowRoadsModuleConfig = {
|
|
921
|
-
type: 'roads';
|
|
922
|
-
areas?: TileflowRoadAreaStyle;
|
|
923
|
-
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
924
|
-
crossings?: TileflowRoadCrossingStyle;
|
|
925
|
-
detail?: TileflowRoadDetail;
|
|
926
|
-
extras?: TileflowRoadExtras;
|
|
927
|
-
hierarchy?: TileflowRoadHierarchy;
|
|
928
|
-
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
929
|
-
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
930
|
-
oneWayMarkers?: boolean;
|
|
931
|
-
outline?: TileflowRoadOutline;
|
|
932
|
-
/** Draw ramp fills below receiving roads by default; `by-class` keeps their class's order. */
|
|
933
|
-
rampOrder?: 'below-roads' | 'by-class';
|
|
934
|
-
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
935
|
-
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
936
|
-
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
937
|
-
sidewalks?: TileflowRoadSidewalkStyle;
|
|
938
|
-
streetLights?: TileflowRoadStreetLightStyle;
|
|
939
|
-
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
940
|
-
weight?: TileflowRoadWeight;
|
|
941
|
-
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
942
|
-
};
|
|
943
|
-
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
944
|
-
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
945
|
-
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
946
|
-
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
947
|
-
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
948
|
-
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
949
|
-
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
950
|
-
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
951
|
-
type TileflowRoadShieldStyles = {
|
|
952
|
-
default?: TileflowSymbolStyle;
|
|
953
|
-
detail?: TileflowSymbolStyle;
|
|
954
|
-
kinds?: Record<string, {
|
|
955
|
-
image: TileflowThemeImageValue;
|
|
956
|
-
}>;
|
|
957
|
-
overview?: TileflowSymbolStyle;
|
|
958
|
-
textColors?: Record<string, {
|
|
959
|
-
color: TileflowThemeColorValue;
|
|
960
|
-
}>;
|
|
961
|
-
};
|
|
962
|
-
type TileflowLabelStyles = {
|
|
963
|
-
aerodrome?: TileflowSymbolStyle;
|
|
964
|
-
junctions?: TileflowSymbolStyle;
|
|
965
|
-
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
966
|
-
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
967
|
-
shields?: TileflowRoadShieldStyles;
|
|
968
|
-
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
969
|
-
};
|
|
970
|
-
type TileflowLabelsModuleConfig = {
|
|
971
|
-
type: 'labels';
|
|
972
|
-
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
973
|
-
collisionPriority?: TileflowLabelCollisionPriority;
|
|
974
|
-
junctions?: boolean;
|
|
975
|
-
language?: TileflowLabelLanguage;
|
|
976
|
-
places?: TileflowLabelDetail;
|
|
977
|
-
roadClasses?: readonly TileflowRoadClass[];
|
|
978
|
-
/**
|
|
979
|
-
* Where street names draw. `foreground` (the default) keeps them above buildings and
|
|
980
|
-
* vegetation. `ground` places them below buildings, with map-aligned text by default.
|
|
981
|
-
* Ground names retain their road-class collision order, but foreground symbols are offered
|
|
982
|
-
* first by the renderer; `collisionPriority` cannot make ground names outrank those symbols.
|
|
983
|
-
* Shields and junction numbers keep their foreground placement.
|
|
984
|
-
*/
|
|
985
|
-
roadPlacement?: 'ground' | 'foreground';
|
|
986
|
-
roads?: TileflowRoadLabelDetail;
|
|
987
|
-
shields?: TileflowRoadShieldDetail;
|
|
988
|
-
styles?: TileflowLabelStyles;
|
|
989
|
-
water?: TileflowLabelDetail;
|
|
990
|
-
};
|
|
991
|
-
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
992
|
-
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
993
|
-
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
994
|
-
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
995
|
-
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
996
|
-
/**
|
|
997
|
-
* How POI categories are placed against each other. `importance` places every category in one
|
|
998
|
-
* order, by World's ranks. `categories` gives each category its own layer and places the
|
|
999
|
-
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
1000
|
-
*/
|
|
1001
|
-
type TileflowPoiPlacementOrder = 'categories' | 'importance';
|
|
1002
|
-
/**
|
|
1003
|
-
* The appearance of one POI category. With the default `importance` order every category shares
|
|
1004
|
-
* one placement layer, so categories may differ only in properties MapLibre evaluates per feature
|
|
1005
|
-
* (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
|
|
1006
|
-
* overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
|
|
1007
|
-
*/
|
|
1008
|
-
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
|
|
1009
|
-
type TileflowPoiModuleConfig = {
|
|
1010
|
-
type: 'poi';
|
|
1011
|
-
categories?: readonly TileflowPoiCategory[];
|
|
1012
|
-
color?: TileflowPoiColorMode;
|
|
1013
|
-
/** One density for the whole module: World's ranks decide what each category shows. */
|
|
1014
|
-
density?: TileflowPoiDensity;
|
|
1015
|
-
icons?: boolean;
|
|
1016
|
-
labels?: boolean;
|
|
1017
|
-
minZoom?: number;
|
|
1018
|
-
placement?: {
|
|
1019
|
-
/**
|
|
1020
|
-
* Places each pictogram with its name as one unit that needs room for both. Defaults to
|
|
1021
|
-
* `false`.
|
|
1022
|
-
*/
|
|
1023
|
-
coupleIconAndLabel?: boolean;
|
|
1024
|
-
iconPadding?: number;
|
|
1025
|
-
/**
|
|
1026
|
-
* World POI `type` values whose pictogram explains them. When pictograms and names are both
|
|
1027
|
-
* drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
|
|
1028
|
-
* Defaults to parking and public toilets.
|
|
1029
|
-
*/
|
|
1030
|
-
iconOnlyTypes?: readonly string[];
|
|
1031
|
-
/** Defaults to `importance`. */
|
|
1032
|
-
order?: TileflowPoiPlacementOrder;
|
|
1033
|
-
/**
|
|
1034
|
-
* With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
|
|
1035
|
-
* before the map's road and place labels, and the others after them. A map that gives street
|
|
1036
|
-
* names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
|
|
1037
|
-
* way. Unset, every POI is placed at the module's own position.
|
|
1038
|
-
*/
|
|
1039
|
-
prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
1040
|
-
textPadding?: number;
|
|
1041
|
-
};
|
|
1042
|
-
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
622
|
+
point: 'point';
|
|
623
|
+
line: TileflowSymbolPlacement;
|
|
624
|
+
polygon: TileflowSymbolPlacement;
|
|
1043
625
|
};
|
|
1044
|
-
type
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
}>;
|
|
1048
|
-
type TileflowProjection = 'globe' | 'mercator';
|
|
1049
|
-
type TileflowLight = {
|
|
1050
|
-
anchor?: 'map' | 'viewport';
|
|
1051
|
-
color?: TileflowColor;
|
|
1052
|
-
intensity?: number;
|
|
1053
|
-
position?: readonly [number, number, number];
|
|
626
|
+
type TileflowBathymetryNameStyle = TileflowSymbolStyle & {
|
|
627
|
+
/** Overrides scalar placement for these names; omission preserves scalar placement. */
|
|
628
|
+
placementByGeometry?: TileflowBathymetryNamePlacement;
|
|
1054
629
|
};
|
|
1055
|
-
type
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
630
|
+
type TileflowWaterModuleOptions = {
|
|
631
|
+
bathymetry?: TileflowFillStyle;
|
|
632
|
+
/** Contour lines when declared by Bathymetry; otherwise approximate polygon band edges. */
|
|
633
|
+
bathymetryContours?: TileflowLineStyle;
|
|
634
|
+
/** Contour-depth or legacy band-floor labels, not measured survey soundings. */
|
|
635
|
+
bathymetryLabels?: TileflowSymbolStyle;
|
|
636
|
+
/** Names from an explicitly declared seafloor_landform layer. */
|
|
637
|
+
bathymetryLandforms?: TileflowBathymetryNameStyle;
|
|
638
|
+
/** Names from an explicitly declared water_name layer. */
|
|
639
|
+
bathymetryWaterNames?: TileflowBathymetryNameStyle;
|
|
640
|
+
bodies?: TileflowAreaStyle;
|
|
641
|
+
intermittent?: {
|
|
642
|
+
bodies?: TileflowAreaStyle;
|
|
643
|
+
waterways?: TileflowLineStyle;
|
|
1063
644
|
};
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
metadata?: Record<string, unknown>;
|
|
645
|
+
waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
|
|
646
|
+
};
|
|
647
|
+
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
648
|
+
type: 'water';
|
|
1069
649
|
};
|
|
1070
650
|
|
|
1071
651
|
/**
|
|
@@ -1094,97 +674,6 @@ type TileflowSemanticModules = {
|
|
|
1094
674
|
};
|
|
1095
675
|
type TileflowSemanticModuleName = keyof TileflowSemanticModules;
|
|
1096
676
|
|
|
1097
|
-
declare const tileflowSunMetadataKey = "tileflow:sun";
|
|
1098
|
-
/** A theme's sun and sky light with every value resolved; see `TileflowThemeSun`. */
|
|
1099
|
-
type TileflowSunPreset = Readonly<{
|
|
1100
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
1101
|
-
azimuth: number;
|
|
1102
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
1103
|
-
altitude: number;
|
|
1104
|
-
/** The direct light's colour. */
|
|
1105
|
-
color: string;
|
|
1106
|
-
/** The direct light's strength, from 0 to 1. */
|
|
1107
|
-
intensity: number;
|
|
1108
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
1109
|
-
shadowIntensity: number;
|
|
1110
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
1111
|
-
ambient: Readonly<{
|
|
1112
|
-
color: string;
|
|
1113
|
-
intensity: number;
|
|
1114
|
-
}>;
|
|
1115
|
-
}>;
|
|
1116
|
-
/** The sun as the map shows it, ready for an application's own layers. */
|
|
1117
|
-
type TileflowSun = Readonly<{
|
|
1118
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
1119
|
-
azimuth: number;
|
|
1120
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
1121
|
-
altitude: number;
|
|
1122
|
-
/** A unit vector towards the sun: x east, y north, z up. */
|
|
1123
|
-
direction: readonly [number, number, number];
|
|
1124
|
-
/** The direct light's colour, as a CSS colour. */
|
|
1125
|
-
color: string;
|
|
1126
|
-
/** The direct light's colour as sRGB channels from 0 to 1. */
|
|
1127
|
-
rgb: readonly [number, number, number];
|
|
1128
|
-
/**
|
|
1129
|
-
* The direct light's strength, from 0 to 1. It fades to 0 as the sun sets: a sun below the
|
|
1130
|
-
* horizon lights nothing and casts no shadow.
|
|
1131
|
-
*/
|
|
1132
|
-
intensity: number;
|
|
1133
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
1134
|
-
shadowIntensity: number;
|
|
1135
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
1136
|
-
ambient: Readonly<{
|
|
1137
|
-
color: string;
|
|
1138
|
-
rgb: readonly [number, number, number];
|
|
1139
|
-
intensity: number;
|
|
1140
|
-
}>;
|
|
1141
|
-
/**
|
|
1142
|
-
* How bright flat, open ground is under this light, from 0 (dark) to 1: the sky's light plus the
|
|
1143
|
-
* sun's at its height, each weighted by its colour's luminance. Use it to switch lamps or windows
|
|
1144
|
-
* on as a scene darkens, whatever theme or sun lights it.
|
|
1145
|
-
*/
|
|
1146
|
-
brightness: number;
|
|
1147
|
-
/** Where the direction comes from: the themes, angles, or a date and place. */
|
|
1148
|
-
source: 'theme' | 'direction' | 'date';
|
|
1149
|
-
}>;
|
|
1150
|
-
/** Unset sun values: high in the south-south-west, with soft white daylight and ambient fill. */
|
|
1151
|
-
declare const tileflowDefaultSunPreset: TileflowSunPreset;
|
|
1152
|
-
/**
|
|
1153
|
-
* Where the sun stands for an instant and a place ([longitude, latitude] in degrees): its azimuth
|
|
1154
|
-
* in degrees clockwise from north and its apparent altitude above the horizon, with atmospheric
|
|
1155
|
-
* refraction. It follows NOAA's solar equations, accurate to about a hundredth of a degree for
|
|
1156
|
-
* years 1800 to 2200.
|
|
1157
|
-
*/
|
|
1158
|
-
declare function tileflowSunPosition(date: Date | number, location: readonly [number, number]): Readonly<{
|
|
1159
|
-
azimuth: number;
|
|
1160
|
-
altitude: number;
|
|
1161
|
-
}>;
|
|
1162
|
-
/** A unit vector towards a direction in the sky: x east, y north, z up. */
|
|
1163
|
-
declare function tileflowSunDirection(azimuth: number, altitude: number): readonly [number, number, number];
|
|
1164
|
-
/**
|
|
1165
|
-
* The sun as the map shows it: a preset's light from a direction. Direct light fades out over the
|
|
1166
|
-
* sun's last degrees above the horizon and is gone below it.
|
|
1167
|
-
*/
|
|
1168
|
-
declare function resolveTileflowSun(preset: TileflowSunPreset, direction?: Readonly<{
|
|
1169
|
-
azimuth: number;
|
|
1170
|
-
altitude: number;
|
|
1171
|
-
}>, source?: TileflowSun['source']): TileflowSun;
|
|
1172
|
-
/**
|
|
1173
|
-
* A preset `t` of the way from `from` to `to`: the azimuth turns the short way round, colours mix
|
|
1174
|
-
* in OKLab, as theme blends mix paint colours, and numbers linearly.
|
|
1175
|
-
*/
|
|
1176
|
-
declare function mixTileflowSunPresets(from: TileflowSunPreset, to: TileflowSunPreset, t: number): TileflowSunPreset;
|
|
1177
|
-
/** Reads the sun a compiled style publishes, or undefined when its metadata has none. */
|
|
1178
|
-
declare function readTileflowSunPreset(metadata: unknown): TileflowSunPreset | undefined;
|
|
1179
|
-
/**
|
|
1180
|
-
* The sun of a compiled style: the one it publishes, else one read from its light (a style whose
|
|
1181
|
-
* theme describes no sun lights its extrusions from `light.position`), else the default.
|
|
1182
|
-
*/
|
|
1183
|
-
declare function tileflowStyleSunPreset(style: {
|
|
1184
|
-
light?: unknown;
|
|
1185
|
-
metadata?: unknown;
|
|
1186
|
-
} | undefined): TileflowSunPreset;
|
|
1187
|
-
|
|
1188
677
|
type TileflowThemeColorScheme = 'dark' | 'light';
|
|
1189
678
|
|
|
1190
679
|
declare const tileflowRouteMetadataKey = "tileflow:route";
|
|
@@ -1528,209 +1017,6 @@ type TileflowLineProgressController = {
|
|
|
1528
1017
|
*/
|
|
1529
1018
|
declare function createTileflowLineProgress(map: TileflowLineProgressMap, options: TileflowLineProgressOptions): TileflowLineProgressController;
|
|
1530
1019
|
|
|
1531
|
-
/** Bounded, read-only mesh snapshot for developer tooling. Positions are x east, y north, z up. */
|
|
1532
|
-
type TileflowModelInspection = Readonly<{
|
|
1533
|
-
id: string;
|
|
1534
|
-
module: string;
|
|
1535
|
-
format: string;
|
|
1536
|
-
vertices: number;
|
|
1537
|
-
triangles: number;
|
|
1538
|
-
bytes: number;
|
|
1539
|
-
lods: number;
|
|
1540
|
-
instances?: number;
|
|
1541
|
-
positions: number[];
|
|
1542
|
-
indices: number[];
|
|
1543
|
-
colors?: string[];
|
|
1544
|
-
}>;
|
|
1545
|
-
|
|
1546
|
-
type TileflowTileAddress = Readonly<{
|
|
1547
|
-
z: number;
|
|
1548
|
-
x: number;
|
|
1549
|
-
y: number;
|
|
1550
|
-
}>;
|
|
1551
|
-
/** A decoded tile: its address and the chosen layers it holds. */
|
|
1552
|
-
type TileflowTile = TileflowTileAddress & Readonly<{
|
|
1553
|
-
layers: Readonly<Record<string, TileflowTileLayer>>;
|
|
1554
|
-
}>;
|
|
1555
|
-
/** Rewrites a tile request as a MapLibre map's `transformRequest` does. */
|
|
1556
|
-
type TileflowTileRequestTransform = (url: string, resourceType: 'Tile') => Promise<Readonly<{
|
|
1557
|
-
url: string;
|
|
1558
|
-
headers?: Readonly<Record<string, string>>;
|
|
1559
|
-
credentials?: RequestCredentials;
|
|
1560
|
-
}> | undefined> | Readonly<{
|
|
1561
|
-
url: string;
|
|
1562
|
-
headers?: Readonly<Record<string, string>>;
|
|
1563
|
-
credentials?: RequestCredentials;
|
|
1564
|
-
}> | undefined;
|
|
1565
|
-
type TileflowTileReaderOptions = Readonly<{
|
|
1566
|
-
/** The tile address with `{z}`, `{x}` and `{y}`, such as a MapLibre vector source's `tiles[0]`. */
|
|
1567
|
-
tiles: string;
|
|
1568
|
-
/** The lowest zoom the source has tiles for; defaults to 0. */
|
|
1569
|
-
minzoom?: number;
|
|
1570
|
-
/** The highest zoom the source has tiles for; deeper reads use its tiles. Defaults to 14. */
|
|
1571
|
-
maxzoom?: number;
|
|
1572
|
-
/** The layers to decode; defaults to every layer. */
|
|
1573
|
-
layers?: readonly string[];
|
|
1574
|
-
/** Decoded tiles kept for later reads, from 0 to 4096; defaults to 128. */
|
|
1575
|
-
cacheSize?: number;
|
|
1576
|
-
/** Requests in flight at once, from 1 to 32; defaults to 6. */
|
|
1577
|
-
concurrency?: number;
|
|
1578
|
-
/** The map's request rules, applied to every tile request. */
|
|
1579
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
1580
|
-
/**
|
|
1581
|
-
* Defaults to the global `fetch`, and to Core's PMTiles protocol for a source served from a
|
|
1582
|
-
* Tileflow PMTiles archive (`tileflow-pmtiles://`).
|
|
1583
|
-
*/
|
|
1584
|
-
fetch?: (url: string, init: RequestInit) => Promise<Response>;
|
|
1585
|
-
}>;
|
|
1586
|
-
type TileflowTileAreaRequest = Readonly<{
|
|
1587
|
-
/** `[west, south, east, north]` in degrees. */
|
|
1588
|
-
bounds: readonly [number, number, number, number];
|
|
1589
|
-
/** The zoom to read at, clamped to the source's zooms. */
|
|
1590
|
-
zoom: number;
|
|
1591
|
-
/** The most tiles the area may take; a larger area is refused. Defaults to 64. */
|
|
1592
|
-
maxTiles?: number;
|
|
1593
|
-
signal?: AbortSignal;
|
|
1594
|
-
}>;
|
|
1595
|
-
type TileflowTileReader = {
|
|
1596
|
-
/** A tile's chosen layers, or undefined when the source has no tile there (404 or 204). */
|
|
1597
|
-
readTile(address: TileflowTileAddress, options?: {
|
|
1598
|
-
signal?: AbortSignal;
|
|
1599
|
-
}): Promise<TileflowTile | undefined>;
|
|
1600
|
-
/** The tiles covering an area at a zoom, without the absent ones, nearest the centre first. */
|
|
1601
|
-
readArea(request: TileflowTileAreaRequest): Promise<TileflowTile[]>;
|
|
1602
|
-
/** Forgets every cached tile. */
|
|
1603
|
-
clear(): void;
|
|
1604
|
-
};
|
|
1605
|
-
/** The tiles at `zoom` covering `[west, south, east, north]`, nearest the centre first. */
|
|
1606
|
-
declare function tileflowTilesForBounds(bounds: readonly [number, number, number, number], zoom: number): TileflowTileAddress[];
|
|
1607
|
-
/** The longitude and latitude of a point in a tile, given in tile units of an `extent`. */
|
|
1608
|
-
declare function tileflowTilePointToLngLat(tile: TileflowTileAddress, x: number, y: number, extent?: number): [number, number];
|
|
1609
|
-
/**
|
|
1610
|
-
* Reads a vector source's tiles in an application: for example a MapLibre map's World source, with
|
|
1611
|
-
* `tiles`, `minzoom` and `maxzoom` taken from `map.getSource(id)`, and the map's `transformRequest`.
|
|
1612
|
-
*/
|
|
1613
|
-
declare function createTileflowTileReader(options: TileflowTileReaderOptions): TileflowTileReader;
|
|
1614
|
-
/** Structural MapLibre capability; importing this module never loads a renderer. */
|
|
1615
|
-
type TileflowTileSourceMap = {
|
|
1616
|
-
getSource(id: string): unknown;
|
|
1617
|
-
};
|
|
1618
|
-
/**
|
|
1619
|
-
* The tile address and zooms of a map's vector source once the map has loaded it, ready for
|
|
1620
|
-
* `createTileflowTileReader`; undefined while the source is not loaded or has no tile address.
|
|
1621
|
-
*/
|
|
1622
|
-
declare function readTileflowMapTileSource(map: TileflowTileSourceMap, sourceId: string): {
|
|
1623
|
-
tiles: string;
|
|
1624
|
-
minzoom: number;
|
|
1625
|
-
maxzoom: number;
|
|
1626
|
-
} | undefined;
|
|
1627
|
-
|
|
1628
|
-
type ShadowPoint = readonly number[];
|
|
1629
|
-
type ShadowBox = Readonly<{
|
|
1630
|
-
min: ShadowPoint;
|
|
1631
|
-
max: ShadowPoint;
|
|
1632
|
-
}>;
|
|
1633
|
-
type ShadowView = Readonly<{
|
|
1634
|
-
/** Visible receiver points, in the caster box's metre frame. All casters still draw. */
|
|
1635
|
-
receivers?: readonly ShadowPoint[];
|
|
1636
|
-
/** Snap to world-aligned texels; omit for an unsnapped mathematical projection. */
|
|
1637
|
-
resolution?: number;
|
|
1638
|
-
origin?: ShadowPoint;
|
|
1639
|
-
/** Metres per fixed world unit; keeps texel quantization independent of latitude scale. */
|
|
1640
|
-
gridScale?: number;
|
|
1641
|
-
}>;
|
|
1642
|
-
/**
|
|
1643
|
-
* The sun's orthographic view, in metres, with room for each caster's shadow to reach the ground.
|
|
1644
|
-
* Optional receivers concentrate XY resolution without dropping offscreen casters along a ray;
|
|
1645
|
-
* quantized extents and a world-anchored texel grid keep stationary shadows stable during pans.
|
|
1646
|
-
*/
|
|
1647
|
-
declare function tileflowSunLightMatrix(direction: readonly number[], box: ShadowBox, view?: ShadowView): {
|
|
1648
|
-
matrix: Float32Array;
|
|
1649
|
-
depth: number;
|
|
1650
|
-
extent: number;
|
|
1651
|
-
};
|
|
1652
|
-
|
|
1653
|
-
/** The MapLibre GL JS map capabilities the renderer uses. */
|
|
1654
|
-
type TileflowBuildings3DMap = {
|
|
1655
|
-
addLayer(layer: object, beforeId?: string): unknown;
|
|
1656
|
-
getCenter(): {
|
|
1657
|
-
lat: number;
|
|
1658
|
-
lng: number;
|
|
1659
|
-
};
|
|
1660
|
-
getBearing(): number;
|
|
1661
|
-
getLight?(): unknown;
|
|
1662
|
-
getLayer(id: string): unknown;
|
|
1663
|
-
getPaintProperty(layer: string, name: string): unknown;
|
|
1664
|
-
getPitch(): number;
|
|
1665
|
-
getSource(id: string): unknown;
|
|
1666
|
-
getStyle(): unknown;
|
|
1667
|
-
getZoom(): number;
|
|
1668
|
-
isStyleLoaded(): boolean | void;
|
|
1669
|
-
off(event: string, listener: () => void): unknown;
|
|
1670
|
-
on(event: string, listener: () => void): unknown;
|
|
1671
|
-
removeLayer(id: string): unknown;
|
|
1672
|
-
triggerRepaint(): unknown;
|
|
1673
|
-
};
|
|
1674
|
-
/** Where the renderer reads the sun and the map's design: a Tileflow theme controller. */
|
|
1675
|
-
type TileflowBuildings3DThemes = {
|
|
1676
|
-
getSun?(): TileflowSun;
|
|
1677
|
-
getThemeMetadata?(key: string): Readonly<{
|
|
1678
|
-
values: readonly unknown[];
|
|
1679
|
-
position: number;
|
|
1680
|
-
}>;
|
|
1681
|
-
};
|
|
1682
|
-
type TileflowBuildings3DOptions = Readonly<{
|
|
1683
|
-
map: TileflowBuildings3DMap;
|
|
1684
|
-
/** The theme controller, for the sun and the buildings' design in every theme. */
|
|
1685
|
-
controller?: TileflowBuildings3DThemes;
|
|
1686
|
-
/** The zoom where buildings start fading in, reaching full opacity 0.25 zoom later. Defaults to 15. */
|
|
1687
|
-
minzoom?: number;
|
|
1688
|
-
/** The most tiles raised round the camera, from 1 to 64; defaults to 25. */
|
|
1689
|
-
maxTiles?: number;
|
|
1690
|
-
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
1691
|
-
beforeId?: string;
|
|
1692
|
-
/** The map's request rules, for the tiles the renderer reads. */
|
|
1693
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
1694
|
-
}>;
|
|
1695
|
-
type TileflowBuildings3DChange = Readonly<{
|
|
1696
|
-
transition?: Readonly<{
|
|
1697
|
-
duration?: number;
|
|
1698
|
-
mode?: 'grow' | 'fade';
|
|
1699
|
-
}>;
|
|
1700
|
-
}>;
|
|
1701
|
-
type TileflowBuildings3D = {
|
|
1702
|
-
/** Read-only, bounded snapshots of resident prepared model meshes. */
|
|
1703
|
-
inspectModels(): TileflowModelInspection[];
|
|
1704
|
-
/** Shows buildings immediately; pass a transition duration to animate their rise. */
|
|
1705
|
-
show(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1706
|
-
/** Hides buildings immediately; pass a transition duration to animate their descent. */
|
|
1707
|
-
hide(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1708
|
-
/** Sets the height scale, from 0 (flat) to 1; animation requires a transition duration. */
|
|
1709
|
-
grow(scale: number, options?: TileflowBuildings3DChange): Promise<void>;
|
|
1710
|
-
/** The height scale shown now. */
|
|
1711
|
-
readonly scale: number;
|
|
1712
|
-
/**
|
|
1713
|
-
* Whether the map's style describes its 3D buildings (the buildings module's
|
|
1714
|
-
* `threeDimensional`), tiles raised, buildings and vertices, and the placed models standing, for
|
|
1715
|
-
* diagnostics.
|
|
1716
|
-
*/
|
|
1717
|
-
readonly stats: Readonly<{
|
|
1718
|
-
declared: boolean;
|
|
1719
|
-
tiles: number;
|
|
1720
|
-
buildings: number;
|
|
1721
|
-
vertices: number;
|
|
1722
|
-
models: number;
|
|
1723
|
-
}>;
|
|
1724
|
-
/** Takes the layer off the map and lets go of its buffers. */
|
|
1725
|
-
dispose(): void;
|
|
1726
|
-
};
|
|
1727
|
-
declare const tileflowBuildings3DLayerId = "tileflow-buildings-3d";
|
|
1728
|
-
/**
|
|
1729
|
-
* Creates the renderer, showing buildings automatically above zoom 15 unless hidden. It reads the source's
|
|
1730
|
-
* z15 tiles round the camera, the zoom at which World's buildings carry their heights.
|
|
1731
|
-
*/
|
|
1732
|
-
declare function createTileflowBuildings3D(options: TileflowBuildings3DOptions): TileflowBuildings3D;
|
|
1733
|
-
|
|
1734
1020
|
/** The renderer's tile units: MapLibre projects custom layers' tiles over 8192. */
|
|
1735
1021
|
declare const tileflowBuildingExtent = 8192;
|
|
1736
1022
|
/** Bytes per vertex; see `meshTileflowBuildings` for the layout. */
|
|
@@ -1798,85 +1084,34 @@ type TileflowBuildingMesh = Readonly<{
|
|
|
1798
1084
|
*/
|
|
1799
1085
|
declare function meshTileflowBuildings(layer: TileflowTileLayer, options: TileflowBuildingMeshOptions): TileflowBuildingMesh | undefined;
|
|
1800
1086
|
|
|
1801
|
-
/**
|
|
1802
|
-
type
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
triggerRepaint(): unknown;
|
|
1819
|
-
};
|
|
1820
|
-
type TileflowStreetLightsOptions = Readonly<{
|
|
1821
|
-
map: TileflowStreetLightsMap;
|
|
1822
|
-
/**
|
|
1823
|
-
* By default, only a map that enables roads.streetLights supplies lights. Set true to opt in
|
|
1824
|
-
* with the fallback design when metadata is absent, or false to keep every theme's lights off.
|
|
1825
|
-
*/
|
|
1826
|
-
enabled?: boolean;
|
|
1827
|
-
/**
|
|
1828
|
-
* The theme controller, whose sun switches the lights on and off and whose themes hold the map's
|
|
1829
|
-
* street lights (the roads module's `streetLights`).
|
|
1830
|
-
*/
|
|
1831
|
-
controller?: {
|
|
1832
|
-
getSun?(): TileflowSun;
|
|
1833
|
-
getThemeMetadata?(key: string): Readonly<{
|
|
1834
|
-
values: readonly unknown[];
|
|
1835
|
-
position: number;
|
|
1836
|
-
}>;
|
|
1837
|
-
};
|
|
1838
|
-
/** The zoom from which the lights shine. Defaults to 14. */
|
|
1839
|
-
minzoom?: number;
|
|
1840
|
-
/** The most tiles lit round the camera, from 1 to 64; defaults to 25. */
|
|
1841
|
-
maxTiles?: number;
|
|
1842
|
-
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
1843
|
-
beforeId?: string;
|
|
1844
|
-
/** The map's request rules, for the tiles the layer reads. */
|
|
1845
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
1846
|
-
}>;
|
|
1847
|
-
type TileflowStreetLights = {
|
|
1848
|
-
/** How far the lights have switched on, from 0 by day to 1 at night. */
|
|
1849
|
-
readonly on: number;
|
|
1850
|
-
/**
|
|
1851
|
-
* Whether the map's style describes its street lights, tiles lit, lamps, and how many of them the
|
|
1852
|
-
* data maps or the layer estimates.
|
|
1853
|
-
*/
|
|
1854
|
-
readonly stats: Readonly<{
|
|
1855
|
-
declared: boolean;
|
|
1856
|
-
tiles: number;
|
|
1857
|
-
lamps: number;
|
|
1858
|
-
mapped: number;
|
|
1859
|
-
estimated: number;
|
|
1087
|
+
/** Begin/end height fractions, begin/end multipliers and the base-10 curve exponent. */
|
|
1088
|
+
type TileflowModelEmissionGradient = readonly [number, number, number, number, number];
|
|
1089
|
+
type TileflowModelRoleLighting = Readonly<{
|
|
1090
|
+
emissiveStrength: number;
|
|
1091
|
+
emissiveVariation?: number;
|
|
1092
|
+
emissiveColor?: string;
|
|
1093
|
+
emissiveHeight: TileflowModelEmissionGradient;
|
|
1094
|
+
color?: string;
|
|
1095
|
+
colorMix?: number;
|
|
1096
|
+
metallic?: number;
|
|
1097
|
+
roughness?: number;
|
|
1098
|
+
colorVariation?: Readonly<{
|
|
1099
|
+
hue: readonly [number, number];
|
|
1100
|
+
saturation: readonly [number, number];
|
|
1101
|
+
lightness: readonly [number, number];
|
|
1102
|
+
/** Colour factors may be authored in linear light, as in glTF. Defaults to sRGB. */
|
|
1103
|
+
space?: 'srgb' | 'linear';
|
|
1860
1104
|
}>;
|
|
1861
|
-
/** Takes the layer off the map and lets go of its buffers. */
|
|
1862
|
-
dispose(): void;
|
|
1863
|
-
};
|
|
1864
|
-
declare const tileflowStreetLightsLayerId = "tileflow-street-lights";
|
|
1865
|
-
/**
|
|
1866
|
-
* Creates the street lights and puts their layer on the map. They read the source's z15 tiles round
|
|
1867
|
-
* the camera once the controller's sun darkens the map, and shine from `minzoom`.
|
|
1868
|
-
*/
|
|
1869
|
-
declare function createTileflowStreetLights(options: TileflowStreetLightsOptions): TileflowStreetLights;
|
|
1870
|
-
|
|
1871
|
-
/** The parts of a model, each coloured by the theme: the model's materials name them. */
|
|
1872
|
-
declare const tileflowModelParts: Readonly<{
|
|
1873
|
-
surface: 0;
|
|
1874
|
-
secondary: 1;
|
|
1875
|
-
glass: 2;
|
|
1876
|
-
accent: 3;
|
|
1877
|
-
roof: 4;
|
|
1878
1105
|
}>;
|
|
1879
|
-
type
|
|
1106
|
+
type TileflowBuildingFloodLight = Readonly<{
|
|
1107
|
+
intensity: number;
|
|
1108
|
+
brightnessScale: number;
|
|
1109
|
+
color: string;
|
|
1110
|
+
groundRadius: readonly [number, number];
|
|
1111
|
+
minGroundHeight: number;
|
|
1112
|
+
minWallHeight: number;
|
|
1113
|
+
wallHeightRatio: number;
|
|
1114
|
+
}>;
|
|
1880
1115
|
|
|
1881
1116
|
/** The style metadata key under which a compiled map describes its 3D buildings. */
|
|
1882
1117
|
declare const tileflowBuildingsMetadataKey = "tileflow:buildings";
|
|
@@ -1907,11 +1142,26 @@ type TileflowBuildings3DDesign = Readonly<{
|
|
|
1907
1142
|
edgeColor?: string;
|
|
1908
1143
|
/** How bright the buildings light the street at night, from 0 to 2. */
|
|
1909
1144
|
nightLight: number;
|
|
1145
|
+
/** Height-selected light on ordinary buildings and the ground, independent of shop windows. */
|
|
1146
|
+
floodLight?: TileflowBuildingFloodLight;
|
|
1147
|
+
/** Emission by architectural role, independent of model palette slots. */
|
|
1148
|
+
modelLighting?: Readonly<Partial<Record<TileflowModelLightingRole, TileflowModelRoleLighting>>>;
|
|
1910
1149
|
/** Invented night windows, lit by rooms: decoration, not data. */
|
|
1911
1150
|
windows: boolean;
|
|
1151
|
+
/**
|
|
1152
|
+
* The zoom bands, `[from, to]`, the buildings and the placed models and landmarks come in over:
|
|
1153
|
+
* across its band each fades in and rises from the ground. The renderer's defaults stand for a
|
|
1154
|
+
* band left out.
|
|
1155
|
+
*/
|
|
1156
|
+
entrance?: Readonly<{
|
|
1157
|
+
buildings?: readonly [number, number];
|
|
1158
|
+
models?: readonly [number, number];
|
|
1159
|
+
}>;
|
|
1912
1160
|
/** Shadows from the sun, and contact shadow at the foot of the walls. */
|
|
1913
1161
|
shadows: boolean;
|
|
1914
1162
|
occlusion: boolean;
|
|
1163
|
+
/** Strength of prepared model ambient visibility; zero leaves the sky contribution unchanged. */
|
|
1164
|
+
modelOcclusion?: number;
|
|
1915
1165
|
/** Building models the map places in its city, each replacing the buildings under it. */
|
|
1916
1166
|
models?: readonly TileflowBuildingModelPlacement[];
|
|
1917
1167
|
/** The colours of the models' parts; a part without one takes it from the building colour. */
|
|
@@ -1942,92 +1192,13 @@ type TileflowBuildingModelPlacement = Readonly<{
|
|
|
1942
1192
|
declare function readTileflowBuildings3D(metadata: unknown): TileflowBuildings3DDesign | undefined;
|
|
1943
1193
|
/** The most models one map places. */
|
|
1944
1194
|
declare const tileflowBuildingModelPlacementLimit = 256;
|
|
1945
|
-
|
|
1946
|
-
/** The MapLibre GL JS map capabilities the trees use. */
|
|
1947
|
-
type TileflowTrees3DMap = {
|
|
1948
|
-
addLayer(layer: object, beforeId?: string): unknown;
|
|
1949
|
-
getBearing(): number;
|
|
1950
|
-
getCenter(): {
|
|
1951
|
-
lat: number;
|
|
1952
|
-
lng: number;
|
|
1953
|
-
};
|
|
1954
|
-
getLayer(id: string): unknown;
|
|
1955
|
-
getLayoutProperty?(layer: string, name: string): unknown;
|
|
1956
|
-
getPitch(): number;
|
|
1957
|
-
getSource(id: string): unknown;
|
|
1958
|
-
getStyle(): unknown;
|
|
1959
|
-
getZoom(): number;
|
|
1960
|
-
isStyleLoaded(): boolean | void;
|
|
1961
|
-
off(event: string, listener: () => void): unknown;
|
|
1962
|
-
on(event: string, listener: () => void): unknown;
|
|
1963
|
-
removeLayer(id: string): unknown;
|
|
1964
|
-
setLayoutProperty?(layer: string, name: string, value: unknown): unknown;
|
|
1965
|
-
triggerRepaint(): unknown;
|
|
1966
|
-
};
|
|
1967
|
-
/** Where the trees read the sun and the map's design: a Tileflow theme controller. */
|
|
1968
|
-
type TileflowTrees3DThemes = {
|
|
1969
|
-
getSun?(): TileflowSun;
|
|
1970
|
-
getThemeMetadata?(key: string): Readonly<{
|
|
1971
|
-
values: readonly unknown[];
|
|
1972
|
-
position: number;
|
|
1973
|
-
}>;
|
|
1974
|
-
};
|
|
1975
|
-
type TileflowTrees3DOptions = Readonly<{
|
|
1976
|
-
map: TileflowTrees3DMap;
|
|
1977
|
-
/** The theme controller, for the sun and the trees' colours in every theme. */
|
|
1978
|
-
controller?: TileflowTrees3DThemes;
|
|
1979
|
-
/** The vector source with the canopy points, when not the map's World source. */
|
|
1980
|
-
canopySource?: string;
|
|
1981
|
-
/** The zoom from which trees stand; they reach full opacity 0.25 zoom later. Defaults to 15. */
|
|
1982
|
-
minzoom?: number;
|
|
1983
|
-
/** The most tiles of trees round the camera, from 1 to 64; defaults to 25. */
|
|
1984
|
-
maxTiles?: number;
|
|
1985
|
-
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
1986
|
-
beforeId?: string;
|
|
1987
|
-
/** The map's request rules, for the tiles the layer reads. */
|
|
1988
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
1989
|
-
/** Let a vegetation controller own flat-layer visibility. Defaults to true. */
|
|
1990
|
-
manageFlatLayers?: boolean;
|
|
1991
|
-
}>;
|
|
1992
|
-
type TileflowTrees3DChange = Readonly<{
|
|
1993
|
-
transition?: Readonly<{
|
|
1994
|
-
duration?: number;
|
|
1995
|
-
}>;
|
|
1996
|
-
}>;
|
|
1997
|
-
type TileflowTrees3D = {
|
|
1998
|
-
/** Read-only snapshots of the meshes used by the active vegetation palette. */
|
|
1999
|
-
inspectModels(): TileflowModelInspection[];
|
|
2000
|
-
/** Grows the trees out of the ground; resolves once they stand. */
|
|
2001
|
-
show(options?: TileflowTrees3DChange): Promise<void>;
|
|
2002
|
-
/** Sinks the trees back into the ground; resolves once they are gone. */
|
|
2003
|
-
hide(options?: TileflowTrees3DChange): Promise<void>;
|
|
2004
|
-
/** Eases the trees to `scale` of their size, from 0 (none) to 1. */
|
|
2005
|
-
grow(scale: number, options?: TileflowTrees3DChange): Promise<void>;
|
|
2006
|
-
/** The size scale shown now. */
|
|
2007
|
-
readonly scale: number;
|
|
2008
|
-
/**
|
|
2009
|
-
* Whether the map's style describes 3D trees (`vegetation({mode: '3d'})`), tiles of trees,
|
|
2010
|
-
* trees placed (mapped and from canopy points), pieces of hedge placed and trees drawn in the
|
|
2011
|
-
* last frame.
|
|
2012
|
-
*/
|
|
2013
|
-
readonly stats: Readonly<{
|
|
2014
|
-
declared: boolean;
|
|
2015
|
-
tiles: number;
|
|
2016
|
-
trees: number;
|
|
2017
|
-
mapped: number;
|
|
2018
|
-
canopy: number;
|
|
2019
|
-
hedges: number;
|
|
2020
|
-
drawn: number;
|
|
2021
|
-
}>;
|
|
2022
|
-
/** Takes the layer off the map and lets go of its buffers. */
|
|
2023
|
-
dispose(): void;
|
|
2024
|
-
};
|
|
2025
|
-
declare const tileflowTrees3DLayerId = "tileflow-trees-3d";
|
|
2026
1195
|
/**
|
|
2027
|
-
*
|
|
2028
|
-
*
|
|
1196
|
+
* The address a hosted build gives a placement of one of the map's own models: a placeholder that
|
|
1197
|
+
* Tileflow replaces, when the map is deployed, with that model's address in the map's Team.
|
|
2029
1198
|
*/
|
|
2030
|
-
declare function
|
|
1199
|
+
declare function tileflowTeamModelUrl(model: string): string;
|
|
1200
|
+
/** The Team model a placement's address is the placeholder of, if it is one. */
|
|
1201
|
+
declare function readTileflowTeamModelName(url: string): string | undefined;
|
|
2031
1202
|
|
|
2032
1203
|
/** Bytes per lamp; see `placeTileflowStreetLights` for the layout. */
|
|
2033
1204
|
declare const tileflowStreetLightBytes = 12;
|
|
@@ -2329,6 +1500,54 @@ type TileflowShotPlayback = {
|
|
|
2329
1500
|
*/
|
|
2330
1501
|
declare function playTileflowShot(map: TileflowShotPlayerMap, shot: TileflowShotMotion, options?: TileflowShotPlaybackOptions): TileflowShotPlayback;
|
|
2331
1502
|
|
|
1503
|
+
type TileflowNoticeControlPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
1504
|
+
/** A MapLibre control; its methods receive the map that owns it. */
|
|
1505
|
+
type TileflowNoticeControl = {
|
|
1506
|
+
onAdd(map: unknown): HTMLElement;
|
|
1507
|
+
onRemove(map: unknown): void;
|
|
1508
|
+
};
|
|
1509
|
+
type TileflowNoticeEvent = 'remove' | 'style.load' | 'styledata';
|
|
1510
|
+
/** Structural MapLibre capabilities; importing this module never loads a renderer. */
|
|
1511
|
+
type TileflowNoticesMap = {
|
|
1512
|
+
addControl(control: TileflowNoticeControl, position?: TileflowNoticeControlPosition): unknown;
|
|
1513
|
+
getContainer(): HTMLElement;
|
|
1514
|
+
getStyle(): {
|
|
1515
|
+
metadata?: unknown;
|
|
1516
|
+
} | undefined;
|
|
1517
|
+
off(event: TileflowNoticeEvent, listener: () => void): unknown;
|
|
1518
|
+
on(event: TileflowNoticeEvent, listener: () => void): unknown;
|
|
1519
|
+
removeControl(control: TileflowNoticeControl): unknown;
|
|
1520
|
+
};
|
|
1521
|
+
type TileflowNoticesOptions = {
|
|
1522
|
+
/** Map corner for the notice. Defaults to the attribution corner, `bottom-right`. */
|
|
1523
|
+
position?: TileflowNoticeControlPosition;
|
|
1524
|
+
};
|
|
1525
|
+
/**
|
|
1526
|
+
* Render the notices a compiled style declares, such as "Not for navigation" for Nautical, as a
|
|
1527
|
+
* compact always-visible map control. Call after constructing a browser map. Follows style
|
|
1528
|
+
* replacements and removes its control, listeners, and pending read on disposal or map removal.
|
|
1529
|
+
*/
|
|
1530
|
+
declare function attachTileflowNotices(map: TileflowNoticesMap, options?: TileflowNoticesOptions): () => void;
|
|
1531
|
+
|
|
1532
|
+
/** Style metadata key for notices that must stay visible whenever the map is displayed. */
|
|
1533
|
+
declare const tileflowNoticesMetadataKey: "tileflow:notices";
|
|
1534
|
+
/**
|
|
1535
|
+
* A short plain-text notice the compiled style declares for the sources it names. Runtimes render
|
|
1536
|
+
* it on the map, next to the attribution; it never replaces a source's own attribution.
|
|
1537
|
+
*/
|
|
1538
|
+
type TileflowMapNotice = Readonly<{
|
|
1539
|
+
id: string;
|
|
1540
|
+
sources: readonly string[];
|
|
1541
|
+
text: string;
|
|
1542
|
+
}>;
|
|
1543
|
+
declare const tileflowNoticeLimits: Readonly<{
|
|
1544
|
+
maxNotices: 8;
|
|
1545
|
+
maxSources: 16;
|
|
1546
|
+
maxTextLength: 120;
|
|
1547
|
+
}>;
|
|
1548
|
+
/** Read bounded notices from style metadata; malformed entries are ignored, never rendered. */
|
|
1549
|
+
declare function readTileflowNotices(metadata: unknown): readonly TileflowMapNotice[];
|
|
1550
|
+
|
|
2332
1551
|
declare const tileflowMaplibreContourVersion: "0.1.0";
|
|
2333
1552
|
type TileflowContourProtocolRequest = Readonly<{
|
|
2334
1553
|
url: string;
|
|
@@ -2368,49 +1587,54 @@ declare const tileflowPmtilesProtocol: "tileflow-pmtiles";
|
|
|
2368
1587
|
/** Register only Tileflow's managed PMTiles namespace. Third-party `pmtiles://` remains untouched. */
|
|
2369
1588
|
declare function registerTileflowPmtilesProtocol(registry: TileflowPmtilesProtocolRegistry, options?: TileflowPmtilesProtocolRegistrationOptions): void;
|
|
2370
1589
|
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
}>[];
|
|
1590
|
+
/** The style metadata through which a compiled map declares its 3D scene. */
|
|
1591
|
+
declare const tileflowMap3DMetadataKeys: readonly ["tileflow:buildings", "tileflow:vegetation", "tileflow:vegetation-display", "tileflow:street-lights"];
|
|
1592
|
+
/** Where the 3D scene reads the style: the map, and the theme controller when there is one. */
|
|
1593
|
+
type TileflowMap3DSource = Readonly<{
|
|
1594
|
+
map: {
|
|
1595
|
+
getStyle(): unknown;
|
|
1596
|
+
};
|
|
1597
|
+
controller?: {
|
|
1598
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
1599
|
+
values: readonly unknown[];
|
|
1600
|
+
position: number;
|
|
1601
|
+
}>;
|
|
1602
|
+
};
|
|
2385
1603
|
}>;
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
1604
|
+
/**
|
|
1605
|
+
* The parts of a 3D scene the style on screen declares, as their metadata keys; during a theme
|
|
1606
|
+
* blend, those any blended theme declares.
|
|
1607
|
+
*/
|
|
1608
|
+
declare function tileflowMap3DDeclarations(source: TileflowMap3DSource): ReadonlySet<string>;
|
|
1609
|
+
/** Whether the style on screen declares any part of a 3D scene: buildings, trees or lights. */
|
|
1610
|
+
declare function tileflowMapDeclares3D(source: TileflowMap3DSource): boolean;
|
|
1611
|
+
/** Loads the 3D renderers: a dynamic import of the `@tileflow/core/3d` entry. */
|
|
1612
|
+
type TileflowMap3DLoader = () => Promise<{
|
|
1613
|
+
createTileflowMap3D(options: TileflowMap3DOptions): TileflowMap3D;
|
|
1614
|
+
}>;
|
|
1615
|
+
type AttachTileflowMap3DOptions = TileflowMap3DOptions & {
|
|
1616
|
+
map: TileflowMap3DOptions['map'] & {
|
|
1617
|
+
getStyle(): unknown;
|
|
2396
1618
|
};
|
|
2397
|
-
/**
|
|
2398
|
-
|
|
2399
|
-
/**
|
|
2400
|
-
|
|
2401
|
-
};
|
|
2402
|
-
type
|
|
2403
|
-
|
|
2404
|
-
|
|
1619
|
+
/** Loads the renderers the first time the map's style declares 3D. */
|
|
1620
|
+
load: TileflowMap3DLoader;
|
|
1621
|
+
/** Receives a failure to load or mount the renderers; the 2D map keeps working. */
|
|
1622
|
+
onError?: (error: unknown) => void;
|
|
1623
|
+
};
|
|
1624
|
+
type TileflowMap3DAttachment = {
|
|
1625
|
+
/** The mounted scene, once a style that declares 3D has loaded the renderers. */
|
|
1626
|
+
readonly scene: TileflowMap3D | undefined;
|
|
1627
|
+
/** `3d` shows the scene; `2d` hides it and draws `auto` vegetation flat. */
|
|
2405
1628
|
setViewMode(mode: TileflowViewMode): void;
|
|
2406
|
-
/**
|
|
2407
|
-
|
|
2408
|
-
readonly representation: TileflowVegetationRepresentation;
|
|
2409
|
-
readonly stats: TileflowTrees3D['stats'] | undefined;
|
|
1629
|
+
/** Overrides the map's vegetation visibility; undefined restores the authored default. */
|
|
1630
|
+
setVegetation(visible: boolean | undefined): void;
|
|
2410
1631
|
dispose(): void;
|
|
2411
1632
|
};
|
|
2412
|
-
/**
|
|
2413
|
-
|
|
1633
|
+
/**
|
|
1634
|
+
* Mounts the map's 3D scene when, and only when, its style declares one. Until then it loads
|
|
1635
|
+
* nothing, so a 2D map does not pay for the 3D renderers. Requested state applies on mount.
|
|
1636
|
+
*/
|
|
1637
|
+
declare function attachTileflowMap3D(options: AttachTileflowMap3DOptions): TileflowMap3DAttachment;
|
|
2414
1638
|
|
|
2415
1639
|
type TileflowMapReadinessState = 'error' | 'idle' | 'loading';
|
|
2416
1640
|
/** Read the browser preference without persisting or mutating user state. */
|
|
@@ -2649,4 +1873,4 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
|
|
|
2649
1873
|
worldRequestBridge?: TileflowWorldRequestBridge;
|
|
2650
1874
|
}): TileflowTransformRequest<TRequest, TResourceType>;
|
|
2651
1875
|
|
|
2652
|
-
export { type CreateBoundaryFeatureStateOptions, type TileflowAtmosphereMap, type TileflowBoundaryFeatureState, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildingModelPlacement, type
|
|
1876
|
+
export { type AttachTileflowMap3DOptions, type CreateBoundaryFeatureStateOptions, type TileflowAtmosphereMap, type TileflowBoundaryFeatureState, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildingModelPlacement, type TileflowBuildings3DDesign, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowDepthMarker, type TileflowDepthMarkerHandle, type TileflowDepthMarkerMap, type TileflowDepthMarkers, type TileflowDepthMarkersOptions, type TileflowDynamicImage, type TileflowDynamicImageContext, type TileflowDynamicImageHandle, type TileflowEmphasis, type TileflowEmphasisArea, type TileflowEmphasisModule, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFeatureStateMap, type TileflowFrameScheduler, type TileflowGroundLayer, type TileflowGroundLayers, type TileflowGroundLayersMap, type TileflowGroundLayersOptions, type TileflowGroundOrderMap, type TileflowLineProgressAnimation, type TileflowLineProgressController, type TileflowLineProgressGradientOptions, type TileflowLineProgressLayer, type TileflowLineProgressMap, type TileflowLineProgressOptions, type TileflowLineProgressShown, type TileflowLineProgressState, TileflowMap3D, type TileflowMap3DAttachment, type TileflowMap3DLoader, TileflowMap3DOptions, type TileflowMap3DSource, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapNotice, type TileflowMapReadinessState, type TileflowNoticeControl, type TileflowNoticeControlPosition, type TileflowNoticesMap, type TileflowNoticesOptions, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowRouteInks, type TileflowSessionSender, type TileflowSessionStarter, type TileflowShotCamera, type TileflowShotCue, type TileflowShotKeyframe, type TileflowShotMotion, type TileflowShotPlayback, type TileflowShotPlaybackOptions, type TileflowShotPlayerMap, type TileflowShotState, type TileflowStreetLightEstimate, type TileflowStreetLightLayers, type TileflowStreetLightPlacement, type TileflowStreetLightPlacementOptions, type TileflowStreetLightsDesign, type TileflowStyleFontLoadOptions, type TileflowStyleStateValue, type TileflowStyleSwitchMap, TileflowSun, type TileflowSunRequest, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, TileflowTileLayer, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowUserTransformRequest, TileflowViewMode, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMap3D, attachTileflowMapLifecycle, attachTileflowNotices, createBoundaryFeatureState, createTileflowDepthMarkers, createTileflowGroundLayers, createTileflowLineProgress, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, meshTileflowBuildings, mixTileflowRouteInks, placeTileflowStreetLights, playTileflowShot, readTileflowBuildings3D, readTileflowNotices, readTileflowRouteInks, readTileflowStreetLights, readTileflowTeamModelName, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowBuildingExtent, tileflowBuildingModelPlacementLimit, tileflowBuildingVertexBytes, tileflowBuildingsMetadataKey, tileflowDefaultRouteInks, tileflowDepthMarkerPlacement, tileflowFairUseNoticeMessage, tileflowGroundBeforeId, tileflowLayerDomainMetadataKey, tileflowLineProgressGradient, tileflowMap3DDeclarations, tileflowMap3DMetadataKeys, tileflowMapDeclares3D, tileflowMaplibreContourVersion, tileflowNoticeLimits, tileflowNoticesMetadataKey, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, tileflowRouteMetadataKey, tileflowShotStateAt, tileflowStreetLightBytes, tileflowStreetLightsMetadataKey, tileflowStyleRouteInks, tileflowSunLightMatrix, tileflowTeamModelUrl, validateTileflowBrowserThemeBlendSelection, validateTileflowEmphasis };
|