@tileflow/core 0.1.0-alpha.37 → 0.1.0-alpha.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/3d-BkaJjwfk.d.ts +1083 -0
- package/dist/3d.d.ts +1 -0
- package/dist/3d.js +12331 -0
- package/dist/browser.d.ts +788 -1409
- package/dist/browser.js +11457 -9407
- package/dist/build.d.ts +4 -3
- package/dist/build.js +1135 -203
- package/dist/capture.js +4 -1
- package/dist/config-reference.json +927 -548
- package/dist/{icon-composition-C5X3Q9Ya.d.ts → icon-composition-Ivgoxz8d.d.ts} +172 -5
- package/dist/index.d.ts +174 -5
- package/dist/index.js +1797 -330
- package/dist/{manifest-types-jrBdBrES.d.ts → manifest-types-DRy2980g.d.ts} +5 -2
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.js +4 -1
- package/dist/native-profile.d.ts +4 -0
- package/dist/native-profile.js +2 -0
- package/dist/native.js +11 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +11 -1
- package/dist/worker/camera-tile-worker.global.js +20 -0
- package/docs/application-tile-reading.md +5 -2
- package/docs/authoring-model.md +8 -0
- package/docs/buildings-3d.md +80 -12
- package/docs/compiled-style-performance.md +11 -2
- package/docs/data-is-separate-from-design.md +6 -3
- package/docs/globe-atmosphere.md +3 -0
- package/docs/native-artifact-profile.md +2 -2
- package/docs/nautical-marks.md +147 -39
- package/docs/public-api-and-browser-subpath.md +7 -2
- package/docs/street-lights.md +5 -1
- package/docs/street-sky.md +153 -0
- package/docs/sun-and-light.md +4 -2
- package/docs/trees-3d.md +11 -6
- package/package.json +6 -1
- package/dist/worker/buildings-3d-worker.global.js +0 -1
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-BkaJjwfk.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-BkaJjwfk.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;
|
|
@@ -41,7 +302,12 @@ type TileflowDynamicImageMap = {
|
|
|
41
302
|
off(event: string, listener: () => void): unknown;
|
|
42
303
|
};
|
|
43
304
|
|
|
44
|
-
|
|
305
|
+
/**
|
|
306
|
+
* `GRACE` and `MANAGED_REQUIRED` come from the site's fair-use state. `LIMITED` means Tileflow is
|
|
307
|
+
* temporarily limiting anonymous World delivery for everyone: cached areas keep loading while some
|
|
308
|
+
* uncached areas fail, and a managed map is not affected.
|
|
309
|
+
*/
|
|
310
|
+
type TileflowFairUseNoticeState = 'GRACE' | 'MANAGED_REQUIRED' | 'LIMITED';
|
|
45
311
|
type TileflowFairUseNotice = Readonly<{
|
|
46
312
|
action: string;
|
|
47
313
|
helpUrl: string;
|
|
@@ -70,316 +336,12 @@ type TileflowFairUseNoticeController = Readonly<{
|
|
|
70
336
|
declare function registerTileflowWorldRequestBridge(input: {
|
|
71
337
|
addProtocol: (name: string, handler: TileflowWorldProtocolHandler) => void;
|
|
72
338
|
fetch?: typeof fetch;
|
|
339
|
+
now?: () => number;
|
|
73
340
|
onNotice: (notice: TileflowFairUseNotice | null) => void;
|
|
74
341
|
}): TileflowWorldRequestBridge;
|
|
75
342
|
declare function tileflowFairUseNoticeMessage(state: TileflowFairUseNoticeState): string;
|
|
76
343
|
declare function attachTileflowFairUseNotice(container: HTMLElement): TileflowFairUseNoticeController;
|
|
77
344
|
|
|
78
|
-
declare const expressionBrand: unique symbol;
|
|
79
|
-
declare const themeValueBrand: unique symbol;
|
|
80
|
-
declare const zoomBrand: unique symbol;
|
|
81
|
-
declare const tileflowThemeTokenCategories: readonly ["color", "font", "image", "number"];
|
|
82
|
-
type TileflowThemeTokenCategory = (typeof tileflowThemeTokenCategories)[number];
|
|
83
|
-
type TileflowThemeTokenPrimitive = {
|
|
84
|
-
color: string;
|
|
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
345
|
type TileflowAddressesModuleOptions = {
|
|
384
346
|
/** Styling for OpenMapTiles point house-number labels. */
|
|
385
347
|
labels?: TileflowSymbolStyle;
|
|
@@ -489,6 +451,16 @@ type TileflowBuildingsThreeDimensionalStyle = {
|
|
|
489
451
|
space?: 'srgb' | 'linear';
|
|
490
452
|
};
|
|
491
453
|
}>>;
|
|
454
|
+
/**
|
|
455
|
+
* The zoom bands the city comes in over: zooming in, across each band its part fades in and rises
|
|
456
|
+
* from the ground, and zooming out it sinks and fades again. Defaults to the 0.3 zooms from the
|
|
457
|
+
* renderer's `minzoom` (15) for the buildings, and to the 0.4 zooms from 0.8 before it for the
|
|
458
|
+
* placed models and landmarks, which stand first. With reduced motion they only fade.
|
|
459
|
+
*/
|
|
460
|
+
entrance?: {
|
|
461
|
+
buildings?: readonly [number, number];
|
|
462
|
+
models?: readonly [number, number];
|
|
463
|
+
};
|
|
492
464
|
/** Contact shadow at the foot of the walls and in tight corners; defaults to true. */
|
|
493
465
|
occlusion?: boolean;
|
|
494
466
|
/** Prepared model ambient occlusion strength, from 0 to 1; defaults to 0.75. */
|
|
@@ -565,597 +537,153 @@ type TileflowLandModuleOptions = {
|
|
|
565
537
|
*/
|
|
566
538
|
barriers?: Partial<Record<TileflowBarrierClass, TileflowBarrierStyle>>;
|
|
567
539
|
globalLandcover?: TileflowFillStyle;
|
|
568
|
-
landcover?: Partial<Record<TileflowLandcoverClass, TileflowAreaStyle>>;
|
|
569
|
-
landuse?: Partial<Record<TileflowLanduseClass, TileflowAreaStyle>>;
|
|
570
|
-
};
|
|
571
|
-
type TileflowLandModuleConfig = TileflowLandModuleOptions & {
|
|
572
|
-
type: 'land';
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
declare const tileflowLandformClasses: readonly ["peak", "volcano", "saddle", "ridge", "cliff", "arete"];
|
|
576
|
-
type TileflowLandformClass = (typeof tileflowLandformClasses)[number];
|
|
577
|
-
type TileflowLandformsModuleOptions = {
|
|
578
|
-
classes?: Partial<Record<TileflowLandformClass, TileflowSymbolStyle>>;
|
|
579
|
-
/** Append source elevation in metres when the feature provides it. */
|
|
580
|
-
elevation?: boolean;
|
|
581
|
-
};
|
|
582
|
-
type TileflowLandformsModuleConfig = TileflowLandformsModuleOptions & {
|
|
583
|
-
type: 'landforms';
|
|
584
|
-
};
|
|
585
|
-
|
|
586
|
-
/** Labels anchored inside polygon features; point-feature labels remain on their feature style. */
|
|
587
|
-
type TileflowNauticalAreaLabelStyles = {
|
|
588
|
-
/** Provider coverage cells; hidden unless a map makes this style visible. */
|
|
589
|
-
coverage?: TileflowSymbolStyle;
|
|
590
|
-
hazards?: TileflowSymbolStyle;
|
|
591
|
-
navigationAreas?: TileflowSymbolStyle;
|
|
592
|
-
reefs?: TileflowSymbolStyle;
|
|
593
|
-
wrecks?: TileflowSymbolStyle;
|
|
594
|
-
};
|
|
595
|
-
/**
|
|
596
|
-
* One style per semantic group of `nautical-v1` objects. Point groups draw a circle `marker`, an
|
|
597
|
-
* `icon` from the theme's nautical image tokens, and `text`; area groups draw a `fill` and an
|
|
598
|
-
* `outline`; line groups draw one stroke. Every group respects each feature's `min_zoom`, and
|
|
599
|
-
* point groups place more important features (lower `rank`) first.
|
|
600
|
-
*/
|
|
601
|
-
type TileflowNauticalModuleOptions = {
|
|
602
|
-
/** Other aids: moorings, fog signals, racons, radio and signal stations, and virtual aids. */
|
|
603
|
-
aids?: TileflowMarkerSymbolStyle;
|
|
604
|
-
/** Fixed beacons and daymarks, coloured by their first colour. */
|
|
605
|
-
beacons?: TileflowMarkerSymbolStyle;
|
|
606
|
-
/** Buoys, light floats, and light vessels, coloured by their first colour. */
|
|
607
|
-
buoys?: TileflowMarkerSymbolStyle;
|
|
608
|
-
/** Submarine cable and pipeline lines. */
|
|
609
|
-
cables?: TileflowLineStyle;
|
|
610
|
-
/** Restrained indication of where a provider publishes marks. */
|
|
611
|
-
coverage?: TileflowAreaStyle;
|
|
612
|
-
/** Harbour and marina points. */
|
|
613
|
-
harbours?: TileflowMarkerSymbolStyle;
|
|
614
|
-
/** Hazard areas; the outline also strokes linear hazards such as booms. */
|
|
615
|
-
hazardAreas?: TileflowAreaStyle;
|
|
616
|
-
/** Rocks by water level, obstructions, and offshore platforms. */
|
|
617
|
-
hazards?: TileflowMarkerSymbolStyle;
|
|
618
|
-
labels?: TileflowNauticalAreaLabelStyles;
|
|
619
|
-
lighthouses?: TileflowMarkerSymbolStyle;
|
|
620
|
-
/** Light flares coloured by the light's first colour, with the chart light label. */
|
|
621
|
-
lights?: TileflowMarkerSymbolStyle;
|
|
622
|
-
/** Restricted, military, anchorage, traffic-separation, and other navigation areas. */
|
|
623
|
-
navigationAreas?: TileflowAreaStyle;
|
|
624
|
-
/** Ports, sized by `size` and placed by `rank` from low zooms. */
|
|
625
|
-
ports?: TileflowMarkerSymbolStyle;
|
|
626
|
-
reefs?: TileflowAreaStyle;
|
|
627
|
-
/** Traffic-separation lines and recommended routes, tracks, and ferry routes. */
|
|
628
|
-
routes?: TileflowLineStyle;
|
|
629
|
-
soundings?: TileflowMarkerSymbolStyle;
|
|
630
|
-
wreckAreas?: TileflowAreaStyle;
|
|
631
|
-
wrecks?: TileflowMarkerSymbolStyle;
|
|
632
|
-
};
|
|
633
|
-
type TileflowNauticalModuleConfig = TileflowNauticalModuleOptions & {
|
|
634
|
-
type: 'nautical';
|
|
635
|
-
};
|
|
636
|
-
|
|
637
|
-
type TileflowTransitModuleOptions = {
|
|
638
|
-
cableway?: TileflowLineStyle;
|
|
639
|
-
ferry?: TileflowLineStyle;
|
|
640
|
-
rail?: TileflowTransitRailStyle;
|
|
641
|
-
railHatching?: TileflowTransitRailStyle;
|
|
642
|
-
serviceRail?: TileflowTransitRailStyle;
|
|
643
|
-
};
|
|
644
|
-
type TileflowTransitRailStyle = {
|
|
645
|
-
bridge?: TileflowLineStyle;
|
|
646
|
-
surface?: TileflowLineStyle;
|
|
647
|
-
tunnel?: TileflowLineStyle;
|
|
648
|
-
};
|
|
649
|
-
type TileflowTransitModuleConfig = TileflowTransitModuleOptions & {
|
|
650
|
-
type: 'transit';
|
|
651
|
-
};
|
|
652
|
-
|
|
653
|
-
/** A prepared model, near and optionally far, as the style's tree description carries it. */
|
|
654
|
-
type TileflowTreeModel = Readonly<{
|
|
655
|
-
near: string;
|
|
656
|
-
far?: string;
|
|
657
|
-
}>;
|
|
658
|
-
|
|
659
|
-
type TileflowTileGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
660
|
-
type TileflowTileFeature = Readonly<{
|
|
661
|
-
/** The feature's id in the tile, when it has one. */
|
|
662
|
-
id?: number;
|
|
663
|
-
type: TileflowTileGeometryType;
|
|
664
|
-
properties: Readonly<Record<string, string | number | boolean>>;
|
|
665
|
-
/**
|
|
666
|
-
* One flat `[x0, y0, x1, y1, …]` array per point set, line or ring, in tile units from 0 to the
|
|
667
|
-
* layer's extent (coordinates in a tile's buffer fall outside that range). Polygon rings follow
|
|
668
|
-
* the MVT winding: an exterior ring is clockwise in tile units, a hole anticlockwise.
|
|
669
|
-
*/
|
|
670
|
-
geometry: readonly (readonly number[])[];
|
|
671
|
-
}>;
|
|
672
|
-
type TileflowTileLayer = Readonly<{
|
|
673
|
-
/** Tile units across the tile, usually 4096. */
|
|
674
|
-
extent: number;
|
|
675
|
-
features: readonly TileflowTileFeature[];
|
|
676
|
-
}>;
|
|
677
|
-
type TileflowVectorTileDecodeOptions = Readonly<{
|
|
678
|
-
/** The layers to decode; others are skipped without decoding. Defaults to every layer. */
|
|
679
|
-
layers?: readonly string[];
|
|
680
|
-
}>;
|
|
681
|
-
/** Decodes a Mapbox Vector Tile's layers. Throws on bytes that are not a vector tile. */
|
|
682
|
-
declare function decodeTileflowVectorTile(bytes: Uint8Array, options?: TileflowVectorTileDecodeOptions): Readonly<Record<string, TileflowTileLayer>>;
|
|
683
|
-
|
|
684
|
-
/** The forms a 3D tree takes. */
|
|
685
|
-
declare const tileflowTreeForms: readonly ["round", "open", "tall", "conifer", "columnar", "palm"];
|
|
686
|
-
type TileflowTreeForm = (typeof tileflowTreeForms)[number];
|
|
687
|
-
/** How a tree's surfaces take the light: facets, a smooth round shape, or bands as drawn. */
|
|
688
|
-
declare const tileflowTreeFinishes: readonly ["faceted", "smooth", "toon"];
|
|
689
|
-
type TileflowTreeFinish = (typeof tileflowTreeFinishes)[number];
|
|
690
|
-
/** A form's own scales, on top of the map's, and the map's own models it draws. */
|
|
691
|
-
type TileflowTreeFormStyle = Readonly<{
|
|
692
|
-
heightScale?: number;
|
|
693
|
-
crownScale?: number;
|
|
694
|
-
/** Ids of the map's own models, one to four; each tree draws one by its stable seed. */
|
|
695
|
-
models?: readonly string[];
|
|
696
|
-
}>;
|
|
697
|
-
/** Relative weights of the forms given to trees whose data gives none. */
|
|
698
|
-
type TileflowTreeFormMix = Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
699
|
-
/** A region whose trees without a form in the data take their own mix. */
|
|
700
|
-
type TileflowTreeRegion = Readonly<{
|
|
701
|
-
/** `[west, south, east, north]` in degrees. */
|
|
702
|
-
bounds: readonly [number, number, number, number];
|
|
703
|
-
unknownForms: TileflowTreeFormMix;
|
|
704
|
-
}>;
|
|
705
|
-
/** The fields of the tree and canopy layers, as World names them. */
|
|
706
|
-
type TileflowTreeFields = Readonly<{
|
|
707
|
-
height: string;
|
|
708
|
-
diameterCrown: string;
|
|
709
|
-
circumference: string;
|
|
710
|
-
genus: string;
|
|
711
|
-
species: string;
|
|
712
|
-
leafType: string;
|
|
713
|
-
/** The tree's taxon at any rank, such as `Arecaceae` for palms or a genus or species. */
|
|
714
|
-
taxon: string;
|
|
715
|
-
canopyRank: string;
|
|
716
|
-
canopyClearance: string;
|
|
717
|
-
canopyCover: string;
|
|
718
|
-
/** A canopy point's measured canopy height, in metres. */
|
|
719
|
-
canopyHeight: string;
|
|
720
|
-
/** The kind of barrier in the hedge layer: hedges are `hedge`. */
|
|
721
|
-
subclass: string;
|
|
722
|
-
/** A hedge's kind: `hedge_bank` when it stands on an earth bank. */
|
|
723
|
-
hedge: string;
|
|
724
|
-
}>;
|
|
725
|
-
type TileflowTreePlacementOptions = Readonly<{
|
|
726
|
-
/** The tile's address, for regions and for a stable look per tree. */
|
|
727
|
-
tile: Readonly<{
|
|
728
|
-
x: number;
|
|
729
|
-
y: number;
|
|
730
|
-
z: number;
|
|
731
|
-
}>;
|
|
732
|
-
/** The tile's width in metres. */
|
|
733
|
-
tileMetres: number;
|
|
734
|
-
fields?: Partial<TileflowTreeFields>;
|
|
735
|
-
unknownForms?: TileflowTreeFormMix;
|
|
736
|
-
regions?: readonly TileflowTreeRegion[];
|
|
737
|
-
/** Metres between the trees of a row; defaults to 8. */
|
|
738
|
-
rowSpacing?: number;
|
|
739
|
-
/** How many models each form draws from, 1 to 4; each tree draws one by its seed. */
|
|
740
|
-
variants?: Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
741
|
-
}>;
|
|
742
|
-
/** A tile's layers trees come from, as World names them. */
|
|
743
|
-
type TileflowTreeLayers = Readonly<{
|
|
744
|
-
/**
|
|
745
|
-
* World's `tree`: trees mapped one by one as points, and rows of trees as lines, planted every
|
|
746
|
-
* `rowSpacing` metres.
|
|
747
|
-
*/
|
|
748
|
-
trees?: TileflowTileLayer;
|
|
749
|
-
/** Decorative canopy points in parks and gardens (World's `canopy`). */
|
|
750
|
-
canopy?: TileflowTileLayer;
|
|
751
|
-
/**
|
|
752
|
-
* World's `traffic_control`: its hedges, lines and areas of `subclass=hedge`, stand as clipped
|
|
753
|
-
* pieces along each line and round each area. Other barriers are left out.
|
|
754
|
-
*/
|
|
755
|
-
hedges?: TileflowTileLayer;
|
|
756
|
-
}>;
|
|
757
|
-
/** Where some trees are in a placement, and how many of them have each rank or a lower one. */
|
|
758
|
-
type TileflowTreeRange = Readonly<{
|
|
759
|
-
start: number;
|
|
760
|
-
count: number;
|
|
761
|
-
/** `upTo[r]`: trees of the range with a rank of `r` or lower, from 0 to 15. */
|
|
762
|
-
upTo: readonly number[];
|
|
763
|
-
}>;
|
|
764
|
-
/** Where a form's trees are in a placement, and those of each of its models in turn. */
|
|
765
|
-
type TileflowTreeFormRange = TileflowTreeRange & Readonly<{
|
|
766
|
-
/** One range per model the form draws from, in order; one when it draws Core's own tree. */
|
|
767
|
-
variants: readonly TileflowTreeRange[];
|
|
768
|
-
}>;
|
|
769
|
-
/** One tile's trees, ready to upload. */
|
|
770
|
-
type TileflowTreePlacement = Readonly<{
|
|
771
|
-
/** `tileflowTreeBytes` bytes per tree, ordered by form, model, then rank; see the layout below. */
|
|
772
|
-
trees: Uint8Array;
|
|
773
|
-
forms: Readonly<Record<TileflowTreeForm, TileflowTreeFormRange>>;
|
|
774
|
-
/**
|
|
775
|
-
* `tileflowTreeBytes` bytes per piece of hedge, as a tree's: its middle, its height, its length
|
|
776
|
-
* as the crown, and its turn along the hedge.
|
|
777
|
-
*/
|
|
778
|
-
hedges: Uint8Array;
|
|
779
|
-
/** The tallest tree or hedge, in metres. */
|
|
780
|
-
tallest: number;
|
|
781
|
-
/** Trees from the data's trees and rows, and trees from canopy points. */
|
|
782
|
-
mapped: number;
|
|
783
|
-
canopy: number;
|
|
784
|
-
}>;
|
|
785
|
-
/**
|
|
786
|
-
* Bytes per tree: x and y in tile units of 8192 (uint16 each), height and crown diameter in
|
|
787
|
-
* decimetres (uint16 each), then one byte each for its turn (of a full turn), its shade among the
|
|
788
|
-
* theme's colours, its form, its rank (0–15, lower shows first), a seed, whether it stands for a
|
|
789
|
-
* canopy point (1) or a mapped tree (0), the model of its form it draws, and a byte of padding.
|
|
790
|
-
*/
|
|
791
|
-
declare const tileflowTreeBytes = 16;
|
|
792
|
-
/**
|
|
793
|
-
* The form a tree's data gives it, or undefined when its data says nothing about its form: a palm
|
|
794
|
-
* by `leaf_type` or genus, a column, a conifer by `leaf_type` or genus, or one of the broadleaf
|
|
795
|
-
* forms by genus. `broadleaf` means the data says broadleaved without a known genus.
|
|
796
|
-
*/
|
|
797
|
-
declare function tileflowTreeFormOf(properties: Readonly<Record<string, unknown>>, fields?: Partial<TileflowTreeFields>): TileflowTreeForm | 'broadleaf' | undefined;
|
|
798
|
-
/** Places a tile's trees. Points in the tile's buffer belong to the neighbouring tile. */
|
|
799
|
-
declare function placeTileflowTrees(layers: TileflowTreeLayers, options: TileflowTreePlacementOptions): TileflowTreePlacement;
|
|
800
|
-
/** The style metadata key under which a compiled map describes its 3D trees. */
|
|
801
|
-
declare const tileflowVegetationMetadataKey = "tileflow:vegetation";
|
|
802
|
-
/** How a compiled map's 3D trees look and where their data is, resolved for one theme. */
|
|
803
|
-
type TileflowVegetation3D = Readonly<{
|
|
804
|
-
/** The vector source and its layers with the trees, the canopy points and the hedges. */
|
|
805
|
-
source: string;
|
|
806
|
-
layers: Readonly<{
|
|
807
|
-
tree: string;
|
|
808
|
-
canopy?: string;
|
|
809
|
-
hedge?: string;
|
|
810
|
-
}>;
|
|
811
|
-
fields: TileflowTreeFields;
|
|
812
|
-
/**
|
|
813
|
-
* Sunlit colours: bark, the leaves of each kind of tree from darkest to lightest, and those of
|
|
814
|
-
* hedges.
|
|
815
|
-
*/
|
|
816
|
-
colors: Readonly<{
|
|
817
|
-
bark: string;
|
|
818
|
-
broadleaf: readonly string[];
|
|
819
|
-
conifer: readonly string[];
|
|
820
|
-
palm: readonly string[];
|
|
821
|
-
hedge: readonly string[];
|
|
822
|
-
}>;
|
|
823
|
-
heightScale: number;
|
|
824
|
-
crownScale: number;
|
|
825
|
-
/** Each form's own scales and models. */
|
|
826
|
-
forms: Readonly<Partial<Record<TileflowTreeForm, TileflowTreeFormStyle>>>;
|
|
827
|
-
/** The map's own models its forms draw, by id, prepared from its `models` directories. */
|
|
828
|
-
models: Readonly<Record<string, TileflowTreeModel>>;
|
|
829
|
-
finish: TileflowTreeFinish;
|
|
830
|
-
/** How strongly an outline rings each tree, from 0 (none) to 1, and its colour. */
|
|
831
|
-
edges: number;
|
|
832
|
-
edgeColor?: string;
|
|
833
|
-
unknownForms: TileflowTreeFormMix;
|
|
834
|
-
regions: readonly TileflowTreeRegion[];
|
|
835
|
-
/** The style's layers that draw the trees flat, which the 3D trees stand in for while shown. */
|
|
836
|
-
flatLayers: readonly string[];
|
|
837
|
-
}>;
|
|
838
|
-
/**
|
|
839
|
-
* Reads the 3D trees a compiled style describes, or undefined when its metadata has none or holds
|
|
840
|
-
* a version or shape this Core does not know.
|
|
841
|
-
*/
|
|
842
|
-
declare function readTileflowVegetation3D(metadata: unknown): TileflowVegetation3D | undefined;
|
|
843
|
-
|
|
844
|
-
type TileflowVegetationMode = '3d' | 'flat' | 'auto';
|
|
845
|
-
type TileflowVegetationThreeDimensionalStyle = {
|
|
846
|
-
barkColor?: TileflowThemeColorValue;
|
|
847
|
-
/** Sunlit leaf colours of broadleaf trees, from darkest to lightest; up to four are used. */
|
|
848
|
-
broadleafColors?: readonly TileflowThemeColorValue[];
|
|
849
|
-
/** Sunlit needle colours of conifers and columns, from darkest to lightest. */
|
|
850
|
-
coniferColors?: readonly TileflowThemeColorValue[];
|
|
851
|
-
/** Sunlit frond colours of palms, from darkest to lightest; the broadleaf colours by default. */
|
|
852
|
-
palmColors?: readonly TileflowThemeColorValue[];
|
|
853
|
-
/**
|
|
854
|
-
* Whether the data's hedges stand as clipped green walls beside the trees, at their height or
|
|
855
|
-
* 1.3 m, a metre higher on an earth bank. Defaults to true where the data has hedges.
|
|
856
|
-
*/
|
|
857
|
-
hedges?: boolean;
|
|
858
|
-
/** Sunlit colours of hedges, from darkest to lightest; the two darkest broadleaf colours by default. */
|
|
859
|
-
hedgeColors?: readonly TileflowThemeColorValue[];
|
|
860
|
-
crownScale?: TileflowThemeNumberValue;
|
|
861
|
-
heightScale?: TileflowThemeNumberValue;
|
|
862
|
-
/**
|
|
863
|
-
* How trees take the light: `faceted` (the default), low-poly facets softened towards a round
|
|
864
|
-
* crown; `smooth`, round crowns; or `toon`, three bands of light and a crisp shadow, as a drawn
|
|
865
|
-
* tree has them.
|
|
866
|
-
*/
|
|
867
|
-
finish?: TileflowTreeFinish;
|
|
868
|
-
/** How strongly an outline rings each tree, from 0 (none, the default) to 1. */
|
|
869
|
-
edges?: TileflowThemeNumberValue;
|
|
870
|
-
/** The outline's colour; the crown's darkest colour, deepened, by default. */
|
|
871
|
-
edgeColor?: TileflowThemeColorValue;
|
|
872
|
-
/**
|
|
873
|
-
* Each form's own scales, on top of `heightScale` and `crownScale`, such as taller palms, and the
|
|
874
|
-
* map's own models it draws: ids of `.glb` files in the map's `models` directories, one to four,
|
|
875
|
-
* each tree drawing one. A model's materials named `bark`, `leaves`, `fronds` or `stem` take
|
|
876
|
-
* those parts' colours.
|
|
877
|
-
*/
|
|
878
|
-
forms?: Partial<Record<TileflowTreeForm, {
|
|
879
|
-
heightScale?: TileflowThemeNumberValue;
|
|
880
|
-
crownScale?: TileflowThemeNumberValue;
|
|
881
|
-
models?: readonly string[];
|
|
882
|
-
}>>;
|
|
883
|
-
/**
|
|
884
|
-
* The forms of trees whose data gives none, as relative weights: `round`, `open` and `tall`
|
|
885
|
-
* (broadleaf), `conifer`, `columnar` and `palm`. Each tree draws one from a stable hash, so it
|
|
886
|
-
* keeps its form everywhere. Defaults to the three broadleaf forms, evenly. A tree the data calls
|
|
887
|
-
* broadleaved keeps to the broadleaf forms of the mix.
|
|
888
|
-
*/
|
|
889
|
-
unknownForms?: TileflowTreeFormMix;
|
|
890
|
-
/**
|
|
891
|
-
* Regions whose trees without a form in the data take their own mix, such as palms along a
|
|
892
|
-
* subtropical coast. Bounds are `[west, south, east, north]` in degrees; the first region holding
|
|
893
|
-
* a tree applies. At most 16.
|
|
894
|
-
*/
|
|
895
|
-
regions?: readonly TileflowTreeRegion[];
|
|
896
|
-
};
|
|
897
|
-
type TileflowVegetationModuleOptions = {
|
|
898
|
-
flat?: TileflowCircleStyle;
|
|
899
|
-
/** `3d` uses models at every pitch; `auto` follows the runtime's explicit 2D/3D view mode. */
|
|
900
|
-
mode?: TileflowVegetationMode;
|
|
901
|
-
/** Representation when a renderer cannot draw models. Defaults to `flat`. */
|
|
902
|
-
fallback?: 'flat' | 'none';
|
|
903
|
-
/** Initial visibility; a runtime control may override it. Defaults to true. */
|
|
904
|
-
visible?: boolean;
|
|
905
|
-
threeDimensional?: TileflowVegetationThreeDimensionalStyle;
|
|
906
|
-
};
|
|
907
|
-
type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
908
|
-
type: 'vegetation';
|
|
909
|
-
};
|
|
910
|
-
|
|
911
|
-
type TileflowWaterwayClass = 'canal' | 'other' | 'river' | 'stream';
|
|
912
|
-
/** Explicit placement for every geometry family in a declared Bathymetry name layer. */
|
|
913
|
-
type TileflowBathymetryNamePlacement = {
|
|
914
|
-
point: 'point';
|
|
915
|
-
line: TileflowSymbolPlacement;
|
|
916
|
-
polygon: TileflowSymbolPlacement;
|
|
917
|
-
};
|
|
918
|
-
type TileflowBathymetryNameStyle = TileflowSymbolStyle & {
|
|
919
|
-
/** Overrides scalar placement for these names; omission preserves scalar placement. */
|
|
920
|
-
placementByGeometry?: TileflowBathymetryNamePlacement;
|
|
921
|
-
};
|
|
922
|
-
type TileflowWaterModuleOptions = {
|
|
923
|
-
bathymetry?: TileflowFillStyle;
|
|
924
|
-
/** Contour lines when declared by Bathymetry; otherwise approximate polygon band edges. */
|
|
925
|
-
bathymetryContours?: TileflowLineStyle;
|
|
926
|
-
/** Contour-depth or legacy band-floor labels, not measured survey soundings. */
|
|
927
|
-
bathymetryLabels?: TileflowSymbolStyle;
|
|
928
|
-
/** Names from an explicitly declared seafloor_landform layer. */
|
|
929
|
-
bathymetryLandforms?: TileflowBathymetryNameStyle;
|
|
930
|
-
/** Names from an explicitly declared water_name layer. */
|
|
931
|
-
bathymetryWaterNames?: TileflowBathymetryNameStyle;
|
|
932
|
-
bodies?: TileflowAreaStyle;
|
|
933
|
-
intermittent?: {
|
|
934
|
-
bodies?: TileflowAreaStyle;
|
|
935
|
-
waterways?: TileflowLineStyle;
|
|
936
|
-
};
|
|
937
|
-
waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
|
|
938
|
-
};
|
|
939
|
-
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
940
|
-
type: 'water';
|
|
941
|
-
};
|
|
942
|
-
|
|
943
|
-
type TileflowColor = `#${string}`;
|
|
944
|
-
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
945
|
-
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
946
|
-
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
947
|
-
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
948
|
-
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
949
|
-
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
950
|
-
type TileflowRoadExtras = {
|
|
951
|
-
paths?: boolean;
|
|
952
|
-
};
|
|
953
|
-
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
954
|
-
hatch?: TileflowLineHatchStyle;
|
|
955
|
-
};
|
|
956
|
-
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
957
|
-
type TileflowRoadTreatmentLayerStyle = {
|
|
958
|
-
casing?: TileflowRoadTreatmentLineStyle;
|
|
959
|
-
fill?: TileflowRoadTreatmentLineStyle;
|
|
960
|
-
shadow?: TileflowRoadTreatmentLineStyle;
|
|
961
|
-
};
|
|
962
|
-
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
963
|
-
enabled?: boolean;
|
|
964
|
-
widthScale?: TileflowThemeNumberValue;
|
|
965
|
-
};
|
|
966
|
-
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
967
|
-
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
968
|
-
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
969
|
-
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
970
|
-
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
971
|
-
enabled?: boolean;
|
|
972
|
-
};
|
|
973
|
-
type TileflowRoadAreaStyle = {
|
|
974
|
-
pedestrian?: TileflowAreaStyle;
|
|
975
|
-
pier?: TileflowAreaStyle;
|
|
976
|
-
road?: TileflowAreaStyle;
|
|
977
|
-
};
|
|
978
|
-
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
979
|
-
type TileflowRoadRoundaboutStyle = {
|
|
980
|
-
/** Extra casing width in pixels, split equally across both edges; defaults to the road border. */
|
|
981
|
-
borderWidth?: TileflowNumberStyleValue;
|
|
982
|
-
casing?: TileflowCircleStyle;
|
|
983
|
-
/** Road width in pixels when metric radii are absent; defaults to the effective surface fill width. */
|
|
984
|
-
fallbackWidth?: TileflowNumberStyleValue;
|
|
985
|
-
fill?: TileflowCircleStyle;
|
|
986
|
-
};
|
|
987
|
-
/**
|
|
988
|
-
* How Core's street lights renderer lights the map's streets at night, from the lamps and lit
|
|
989
|
-
* streets its data holds.
|
|
990
|
-
*/
|
|
991
|
-
type TileflowRoadStreetLightStyle = {
|
|
992
|
-
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
993
|
-
color?: TileflowThemeColorValue;
|
|
994
|
-
/** Whether the map has street lights; defaults to false. Set true to opt in. */
|
|
995
|
-
enabled?: boolean;
|
|
996
|
-
/**
|
|
997
|
-
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
998
|
-
* pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
|
|
999
|
-
* that map few lamps, which invents light; `none` nowhere.
|
|
1000
|
-
*/
|
|
1001
|
-
estimate?: 'lit' | 'streets' | 'none';
|
|
1002
|
-
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
1003
|
-
intensity?: TileflowThemeNumberValue;
|
|
1004
|
-
};
|
|
1005
|
-
type TileflowRoadSidewalkStyle = {
|
|
1006
|
-
outline?: TileflowLineStyle;
|
|
1007
|
-
pattern?: TileflowFillStyle;
|
|
1008
|
-
surface?: TileflowFillStyle;
|
|
1009
|
-
};
|
|
1010
|
-
type TileflowRoadsModuleConfig = {
|
|
1011
|
-
type: 'roads';
|
|
1012
|
-
areas?: TileflowRoadAreaStyle;
|
|
1013
|
-
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
1014
|
-
crossings?: TileflowRoadCrossingStyle;
|
|
1015
|
-
detail?: TileflowRoadDetail;
|
|
1016
|
-
extras?: TileflowRoadExtras;
|
|
1017
|
-
hierarchy?: TileflowRoadHierarchy;
|
|
1018
|
-
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
1019
|
-
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
1020
|
-
oneWayMarkers?: boolean;
|
|
1021
|
-
outline?: TileflowRoadOutline;
|
|
1022
|
-
/** Draw ramp fills below receiving roads by default; `by-class` keeps their class's order. */
|
|
1023
|
-
rampOrder?: 'below-roads' | 'by-class';
|
|
1024
|
-
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
1025
|
-
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
1026
|
-
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
1027
|
-
sidewalks?: TileflowRoadSidewalkStyle;
|
|
1028
|
-
streetLights?: TileflowRoadStreetLightStyle;
|
|
1029
|
-
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
1030
|
-
weight?: TileflowRoadWeight;
|
|
1031
|
-
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
1032
|
-
};
|
|
1033
|
-
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
1034
|
-
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
1035
|
-
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
1036
|
-
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
1037
|
-
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
1038
|
-
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
1039
|
-
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
1040
|
-
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
1041
|
-
type TileflowRoadShieldStyles = {
|
|
1042
|
-
default?: TileflowSymbolStyle;
|
|
1043
|
-
detail?: TileflowSymbolStyle;
|
|
1044
|
-
kinds?: Record<string, {
|
|
1045
|
-
image: TileflowThemeImageValue;
|
|
1046
|
-
}>;
|
|
1047
|
-
overview?: TileflowSymbolStyle;
|
|
1048
|
-
textColors?: Record<string, {
|
|
1049
|
-
color: TileflowThemeColorValue;
|
|
1050
|
-
}>;
|
|
1051
|
-
};
|
|
1052
|
-
type TileflowLabelStyles = {
|
|
1053
|
-
aerodrome?: TileflowSymbolStyle;
|
|
1054
|
-
junctions?: TileflowSymbolStyle;
|
|
1055
|
-
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
1056
|
-
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
1057
|
-
shields?: TileflowRoadShieldStyles;
|
|
1058
|
-
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
1059
|
-
};
|
|
1060
|
-
type TileflowLabelsModuleConfig = {
|
|
1061
|
-
type: 'labels';
|
|
1062
|
-
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
1063
|
-
collisionPriority?: TileflowLabelCollisionPriority;
|
|
1064
|
-
junctions?: boolean;
|
|
1065
|
-
language?: TileflowLabelLanguage;
|
|
1066
|
-
places?: TileflowLabelDetail;
|
|
1067
|
-
roadClasses?: readonly TileflowRoadClass[];
|
|
1068
|
-
/**
|
|
1069
|
-
* Where street names draw. `foreground` (the default) keeps them above buildings and
|
|
1070
|
-
* vegetation. `ground` places them below buildings, with map-aligned text by default.
|
|
1071
|
-
* Ground names retain their road-class collision order, but foreground symbols are offered
|
|
1072
|
-
* first by the renderer; `collisionPriority` cannot make ground names outrank those symbols.
|
|
1073
|
-
* Shields and junction numbers keep their foreground placement.
|
|
1074
|
-
*/
|
|
1075
|
-
roadPlacement?: 'ground' | 'foreground';
|
|
1076
|
-
roads?: TileflowRoadLabelDetail;
|
|
1077
|
-
shields?: TileflowRoadShieldDetail;
|
|
1078
|
-
styles?: TileflowLabelStyles;
|
|
1079
|
-
water?: TileflowLabelDetail;
|
|
540
|
+
landcover?: Partial<Record<TileflowLandcoverClass, TileflowAreaStyle>>;
|
|
541
|
+
landuse?: Partial<Record<TileflowLanduseClass, TileflowAreaStyle>>;
|
|
1080
542
|
};
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
543
|
+
type TileflowLandModuleConfig = TileflowLandModuleOptions & {
|
|
544
|
+
type: 'land';
|
|
545
|
+
};
|
|
546
|
+
|
|
547
|
+
declare const tileflowLandformClasses: readonly ["peak", "volcano", "saddle", "ridge", "cliff", "arete"];
|
|
548
|
+
type TileflowLandformClass = (typeof tileflowLandformClasses)[number];
|
|
549
|
+
type TileflowLandformsModuleOptions = {
|
|
550
|
+
classes?: Partial<Record<TileflowLandformClass, TileflowSymbolStyle>>;
|
|
551
|
+
/** Append source elevation in metres when the feature provides it. */
|
|
552
|
+
elevation?: boolean;
|
|
553
|
+
};
|
|
554
|
+
type TileflowLandformsModuleConfig = TileflowLandformsModuleOptions & {
|
|
555
|
+
type: 'landforms';
|
|
556
|
+
};
|
|
557
|
+
|
|
1086
558
|
/**
|
|
1087
|
-
*
|
|
1088
|
-
*
|
|
1089
|
-
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
559
|
+
* Labels anchored inside polygon features, and the clearance labels of bridges and overhead cables;
|
|
560
|
+
* other point-feature labels remain on their feature style.
|
|
1090
561
|
*/
|
|
1091
|
-
type
|
|
562
|
+
type TileflowNauticalAreaLabelStyles = {
|
|
563
|
+
/**
|
|
564
|
+
* Vertical clearance of bridges, or their clearance closed and open, at bridge points and inside
|
|
565
|
+
* bridge polygons; bridge lines carry it at their centre.
|
|
566
|
+
*/
|
|
567
|
+
bridges?: TileflowSymbolStyle;
|
|
568
|
+
/** Provider coverage cells; hidden unless a map makes this style visible. */
|
|
569
|
+
coverage?: TileflowSymbolStyle;
|
|
570
|
+
hazards?: TileflowSymbolStyle;
|
|
571
|
+
navigationAreas?: TileflowSymbolStyle;
|
|
572
|
+
/** Safe vertical clearance of overhead cables, at cable points and along cable lines. */
|
|
573
|
+
overheadCables?: TileflowSymbolStyle;
|
|
574
|
+
reefs?: TileflowSymbolStyle;
|
|
575
|
+
wrecks?: TileflowSymbolStyle;
|
|
576
|
+
};
|
|
1092
577
|
/**
|
|
1093
|
-
*
|
|
1094
|
-
*
|
|
1095
|
-
*
|
|
1096
|
-
*
|
|
578
|
+
* One style per semantic group of `nautical-v1` objects. Point groups draw a circle `marker`, an
|
|
579
|
+
* `icon` from the theme's nautical image tokens, and `text`; area groups draw a `fill` and an
|
|
580
|
+
* `outline`; line groups draw one stroke. Every group respects each feature's `min_zoom`, and
|
|
581
|
+
* point groups place more important features (lower `rank`) first.
|
|
1097
582
|
*/
|
|
1098
|
-
type
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
583
|
+
type TileflowNauticalModuleOptions = {
|
|
584
|
+
/** Other aids: moorings, fog signals, racons, radio and signal stations, and virtual aids. */
|
|
585
|
+
aids?: TileflowMarkerSymbolStyle;
|
|
586
|
+
/**
|
|
587
|
+
* Flash each light in its rhythm where a browser runtime animates the map. Defaults to `true`.
|
|
588
|
+
* `false` keeps every light steady, as do reduced motion, capture, and native renderers.
|
|
589
|
+
*/
|
|
590
|
+
animateLights?: boolean;
|
|
591
|
+
/** Fixed beacons and daymarks, coloured by their first colour. */
|
|
592
|
+
beacons?: TileflowMarkerSymbolStyle;
|
|
593
|
+
/** Berth polygons; the outline also strokes berth lines and emphasises guest berths. */
|
|
594
|
+
berths?: TileflowAreaStyle;
|
|
595
|
+
/** Bridge polygons; the outline also strokes bridge lines. */
|
|
596
|
+
bridges?: TileflowAreaStyle;
|
|
597
|
+
/** Buoys, light floats, and light vessels, coloured by their first colour. */
|
|
598
|
+
buoys?: TileflowMarkerSymbolStyle;
|
|
599
|
+
/** Submarine cable and pipeline lines. */
|
|
600
|
+
cables?: TileflowLineStyle;
|
|
601
|
+
/** Restrained indication of where a provider publishes marks. */
|
|
602
|
+
coverage?: TileflowAreaStyle;
|
|
603
|
+
/** Waterway distance marks with their distance and unit. */
|
|
604
|
+
distanceMarks?: TileflowMarkerSymbolStyle;
|
|
605
|
+
/**
|
|
606
|
+
* Small-craft facilities such as fuel, water, slipways, pump-out, visitor berths, boat hoists,
|
|
607
|
+
* and boatyards, at facility points, inside facility polygons, and at the centre of their lines.
|
|
608
|
+
*/
|
|
609
|
+
facilities?: TileflowMarkerSymbolStyle;
|
|
610
|
+
/** Harbour and marina polygons. */
|
|
611
|
+
harbourAreas?: TileflowAreaStyle;
|
|
612
|
+
/** Harbour and marina points, and their symbol and name inside harbour polygons. */
|
|
613
|
+
harbours?: TileflowMarkerSymbolStyle;
|
|
614
|
+
/** Hazard areas; the outline also strokes linear hazards such as booms. */
|
|
615
|
+
hazardAreas?: TileflowAreaStyle;
|
|
616
|
+
/** Rocks by water level, obstructions, and offshore platforms. */
|
|
617
|
+
hazards?: TileflowMarkerSymbolStyle;
|
|
618
|
+
labels?: TileflowNauticalAreaLabelStyles;
|
|
619
|
+
lighthouses?: TileflowMarkerSymbolStyle;
|
|
620
|
+
/** Light flares coloured by the light's first colour, with the chart light label. */
|
|
621
|
+
lights?: TileflowMarkerSymbolStyle;
|
|
622
|
+
/** Restricted, military, anchorage, traffic-separation, and other navigation areas. */
|
|
623
|
+
navigationAreas?: TileflowAreaStyle;
|
|
624
|
+
/** Inland notice boards coloured by function, with the information they show. */
|
|
625
|
+
notices?: TileflowMarkerSymbolStyle;
|
|
626
|
+
/** Overhead cable lines. */
|
|
627
|
+
overheadCables?: TileflowLineStyle;
|
|
628
|
+
/** Ports, sized by `size` and placed by `rank` from low zooms. */
|
|
629
|
+
ports?: TileflowMarkerSymbolStyle;
|
|
630
|
+
reefs?: TileflowAreaStyle;
|
|
631
|
+
/** Traffic-separation lines and recommended routes, tracks, and ferry routes. */
|
|
632
|
+
routes?: TileflowLineStyle;
|
|
633
|
+
soundings?: TileflowMarkerSymbolStyle;
|
|
634
|
+
wreckAreas?: TileflowAreaStyle;
|
|
635
|
+
wrecks?: TileflowMarkerSymbolStyle;
|
|
1133
636
|
};
|
|
1134
|
-
type
|
|
1135
|
-
|
|
1136
|
-
url: string;
|
|
1137
|
-
}>;
|
|
1138
|
-
type TileflowProjection = 'globe' | 'mercator';
|
|
1139
|
-
type TileflowLight = {
|
|
1140
|
-
anchor?: 'map' | 'viewport';
|
|
1141
|
-
color?: TileflowColor;
|
|
1142
|
-
intensity?: number;
|
|
1143
|
-
position?: readonly [number, number, number];
|
|
637
|
+
type TileflowNauticalModuleConfig = TileflowNauticalModuleOptions & {
|
|
638
|
+
type: 'nautical';
|
|
1144
639
|
};
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
640
|
+
|
|
641
|
+
type TileflowTransitModuleOptions = {
|
|
642
|
+
cableway?: TileflowLineStyle;
|
|
643
|
+
ferry?: TileflowLineStyle;
|
|
644
|
+
rail?: TileflowTransitRailStyle;
|
|
645
|
+
railHatching?: TileflowTransitRailStyle;
|
|
646
|
+
serviceRail?: TileflowTransitRailStyle;
|
|
647
|
+
};
|
|
648
|
+
type TileflowTransitRailStyle = {
|
|
649
|
+
bridge?: TileflowLineStyle;
|
|
650
|
+
surface?: TileflowLineStyle;
|
|
651
|
+
tunnel?: TileflowLineStyle;
|
|
652
|
+
};
|
|
653
|
+
type TileflowTransitModuleConfig = TileflowTransitModuleOptions & {
|
|
654
|
+
type: 'transit';
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
type TileflowWaterwayClass = 'canal' | 'other' | 'river' | 'stream';
|
|
658
|
+
/** Explicit placement for every geometry family in a declared Bathymetry name layer. */
|
|
659
|
+
type TileflowBathymetryNamePlacement = {
|
|
660
|
+
point: 'point';
|
|
661
|
+
line: TileflowSymbolPlacement;
|
|
662
|
+
polygon: TileflowSymbolPlacement;
|
|
663
|
+
};
|
|
664
|
+
type TileflowBathymetryNameStyle = TileflowSymbolStyle & {
|
|
665
|
+
/** Overrides scalar placement for these names; omission preserves scalar placement. */
|
|
666
|
+
placementByGeometry?: TileflowBathymetryNamePlacement;
|
|
667
|
+
};
|
|
668
|
+
type TileflowWaterModuleOptions = {
|
|
669
|
+
bathymetry?: TileflowFillStyle;
|
|
670
|
+
/** Contour lines when declared by Bathymetry; otherwise approximate polygon band edges. */
|
|
671
|
+
bathymetryContours?: TileflowLineStyle;
|
|
672
|
+
/** Contour-depth or legacy band-floor labels, not measured survey soundings. */
|
|
673
|
+
bathymetryLabels?: TileflowSymbolStyle;
|
|
674
|
+
/** Names from an explicitly declared seafloor_landform layer. */
|
|
675
|
+
bathymetryLandforms?: TileflowBathymetryNameStyle;
|
|
676
|
+
/** Names from an explicitly declared water_name layer. */
|
|
677
|
+
bathymetryWaterNames?: TileflowBathymetryNameStyle;
|
|
678
|
+
bodies?: TileflowAreaStyle;
|
|
679
|
+
intermittent?: {
|
|
680
|
+
bodies?: TileflowAreaStyle;
|
|
681
|
+
waterways?: TileflowLineStyle;
|
|
1153
682
|
};
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
metadata?: Record<string, unknown>;
|
|
683
|
+
waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
|
|
684
|
+
};
|
|
685
|
+
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
686
|
+
type: 'water';
|
|
1159
687
|
};
|
|
1160
688
|
|
|
1161
689
|
/**
|
|
@@ -1184,97 +712,6 @@ type TileflowSemanticModules = {
|
|
|
1184
712
|
};
|
|
1185
713
|
type TileflowSemanticModuleName = keyof TileflowSemanticModules;
|
|
1186
714
|
|
|
1187
|
-
declare const tileflowSunMetadataKey = "tileflow:sun";
|
|
1188
|
-
/** A theme's sun and sky light with every value resolved; see `TileflowThemeSun`. */
|
|
1189
|
-
type TileflowSunPreset = Readonly<{
|
|
1190
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
1191
|
-
azimuth: number;
|
|
1192
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
1193
|
-
altitude: number;
|
|
1194
|
-
/** The direct light's colour. */
|
|
1195
|
-
color: string;
|
|
1196
|
-
/** The direct light's strength, from 0 to 1. */
|
|
1197
|
-
intensity: number;
|
|
1198
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
1199
|
-
shadowIntensity: number;
|
|
1200
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
1201
|
-
ambient: Readonly<{
|
|
1202
|
-
color: string;
|
|
1203
|
-
intensity: number;
|
|
1204
|
-
}>;
|
|
1205
|
-
}>;
|
|
1206
|
-
/** The sun as the map shows it, ready for an application's own layers. */
|
|
1207
|
-
type TileflowSun = Readonly<{
|
|
1208
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
1209
|
-
azimuth: number;
|
|
1210
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
1211
|
-
altitude: number;
|
|
1212
|
-
/** A unit vector towards the sun: x east, y north, z up. */
|
|
1213
|
-
direction: readonly [number, number, number];
|
|
1214
|
-
/** The direct light's colour, as a CSS colour. */
|
|
1215
|
-
color: string;
|
|
1216
|
-
/** The direct light's colour as sRGB channels from 0 to 1. */
|
|
1217
|
-
rgb: readonly [number, number, number];
|
|
1218
|
-
/**
|
|
1219
|
-
* The direct light's strength, from 0 to 1. It fades to 0 as the sun sets: a sun below the
|
|
1220
|
-
* horizon lights nothing and casts no shadow.
|
|
1221
|
-
*/
|
|
1222
|
-
intensity: number;
|
|
1223
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
1224
|
-
shadowIntensity: number;
|
|
1225
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
1226
|
-
ambient: Readonly<{
|
|
1227
|
-
color: string;
|
|
1228
|
-
rgb: readonly [number, number, number];
|
|
1229
|
-
intensity: number;
|
|
1230
|
-
}>;
|
|
1231
|
-
/**
|
|
1232
|
-
* How bright flat, open ground is under this light, from 0 (dark) to 1: the sky's light plus the
|
|
1233
|
-
* sun's at its height, each weighted by its colour's luminance. Use it to switch lamps or windows
|
|
1234
|
-
* on as a scene darkens, whatever theme or sun lights it.
|
|
1235
|
-
*/
|
|
1236
|
-
brightness: number;
|
|
1237
|
-
/** Where the direction comes from: the themes, angles, or a date and place. */
|
|
1238
|
-
source: 'theme' | 'direction' | 'date';
|
|
1239
|
-
}>;
|
|
1240
|
-
/** Unset sun values: high in the south-south-west, with soft white daylight and ambient fill. */
|
|
1241
|
-
declare const tileflowDefaultSunPreset: TileflowSunPreset;
|
|
1242
|
-
/**
|
|
1243
|
-
* Where the sun stands for an instant and a place ([longitude, latitude] in degrees): its azimuth
|
|
1244
|
-
* in degrees clockwise from north and its apparent altitude above the horizon, with atmospheric
|
|
1245
|
-
* refraction. It follows NOAA's solar equations, accurate to about a hundredth of a degree for
|
|
1246
|
-
* years 1800 to 2200.
|
|
1247
|
-
*/
|
|
1248
|
-
declare function tileflowSunPosition(date: Date | number, location: readonly [number, number]): Readonly<{
|
|
1249
|
-
azimuth: number;
|
|
1250
|
-
altitude: number;
|
|
1251
|
-
}>;
|
|
1252
|
-
/** A unit vector towards a direction in the sky: x east, y north, z up. */
|
|
1253
|
-
declare function tileflowSunDirection(azimuth: number, altitude: number): readonly [number, number, number];
|
|
1254
|
-
/**
|
|
1255
|
-
* The sun as the map shows it: a preset's light from a direction. Direct light fades out over the
|
|
1256
|
-
* sun's last degrees above the horizon and is gone below it.
|
|
1257
|
-
*/
|
|
1258
|
-
declare function resolveTileflowSun(preset: TileflowSunPreset, direction?: Readonly<{
|
|
1259
|
-
azimuth: number;
|
|
1260
|
-
altitude: number;
|
|
1261
|
-
}>, source?: TileflowSun['source']): TileflowSun;
|
|
1262
|
-
/**
|
|
1263
|
-
* A preset `t` of the way from `from` to `to`: the azimuth turns the short way round, colours mix
|
|
1264
|
-
* in OKLab, as theme blends mix paint colours, and numbers linearly.
|
|
1265
|
-
*/
|
|
1266
|
-
declare function mixTileflowSunPresets(from: TileflowSunPreset, to: TileflowSunPreset, t: number): TileflowSunPreset;
|
|
1267
|
-
/** Reads the sun a compiled style publishes, or undefined when its metadata has none. */
|
|
1268
|
-
declare function readTileflowSunPreset(metadata: unknown): TileflowSunPreset | undefined;
|
|
1269
|
-
/**
|
|
1270
|
-
* The sun of a compiled style: the one it publishes, else one read from its light (a style whose
|
|
1271
|
-
* theme describes no sun lights its extrusions from `light.position`), else the default.
|
|
1272
|
-
*/
|
|
1273
|
-
declare function tileflowStyleSunPreset(style: {
|
|
1274
|
-
light?: unknown;
|
|
1275
|
-
metadata?: unknown;
|
|
1276
|
-
} | undefined): TileflowSunPreset;
|
|
1277
|
-
|
|
1278
715
|
type TileflowThemeColorScheme = 'dark' | 'light';
|
|
1279
716
|
|
|
1280
717
|
declare const tileflowRouteMetadataKey = "tileflow:route";
|
|
@@ -1396,27 +833,91 @@ type TileflowEmphasis = Readonly<{
|
|
|
1396
833
|
declare function validateTileflowEmphasis(value: unknown): TypeError | undefined;
|
|
1397
834
|
|
|
1398
835
|
/**
|
|
1399
|
-
* Browser helpers for theme transitions and blends. They use only methods that MapLibre GL JS maps
|
|
1400
|
-
* provide and check each one at runtime, so a map without them falls back to an immediate change.
|
|
836
|
+
* Browser helpers for theme transitions and blends. They use only methods that MapLibre GL JS maps
|
|
837
|
+
* provide and check each one at runtime, so a map without them falls back to an immediate change.
|
|
838
|
+
*/
|
|
839
|
+
type TileflowThemeMotionMap = {
|
|
840
|
+
areTilesLoaded?: unknown;
|
|
841
|
+
getCanvas?: unknown;
|
|
842
|
+
getImage?: unknown;
|
|
843
|
+
getLayer?: unknown;
|
|
844
|
+
getStyle?: unknown;
|
|
845
|
+
isStyleLoaded?: unknown;
|
|
846
|
+
off(event: string, listener: (event?: unknown) => void): unknown;
|
|
847
|
+
on(event: string, listener: (event?: unknown) => void): unknown;
|
|
848
|
+
project?: unknown;
|
|
849
|
+
redraw?: unknown;
|
|
850
|
+
setLayoutProperty?: unknown;
|
|
851
|
+
setLight?: unknown;
|
|
852
|
+
setPaintProperty?: unknown;
|
|
853
|
+
setSky?: unknown;
|
|
854
|
+
unproject?: unknown;
|
|
855
|
+
updateImage?: unknown;
|
|
856
|
+
};
|
|
857
|
+
|
|
858
|
+
declare const tileflowSkyLayerId = "tileflow-sky";
|
|
859
|
+
/** The MapLibre GL JS map capabilities the sky layer uses; importing this module loads no renderer. */
|
|
860
|
+
type TileflowSkyMap = {
|
|
861
|
+
addLayer(layer: object, beforeId?: string): unknown;
|
|
862
|
+
getBearing(): number;
|
|
863
|
+
getLayer(id: string): unknown;
|
|
864
|
+
getPitch(): number;
|
|
865
|
+
getSky?(): unknown;
|
|
866
|
+
getStyle(): unknown;
|
|
867
|
+
getTerrain?(): unknown;
|
|
868
|
+
getVerticalFieldOfView?(): number;
|
|
869
|
+
isStyleLoaded(): boolean | void;
|
|
870
|
+
off(event: string, listener: () => void): unknown;
|
|
871
|
+
on(event: string, listener: () => void): unknown;
|
|
872
|
+
removeLayer(id: string): unknown;
|
|
873
|
+
};
|
|
874
|
+
/**
|
|
875
|
+
* Light in the sky above the horizon, for maps that declare a sky: a glow on the horizon towards
|
|
876
|
+
* a low sun, the sun's disc as it sets or rises, and stars as the sky darkens. The sun is the one
|
|
877
|
+
* a theme controller shows, so a sun an application places by date brings its glow; without a
|
|
878
|
+
* controller, the theme's own sun. The layer sits under every other layer and draws only where
|
|
879
|
+
* nothing else has, so buildings and trees stand in front. Follows style replacements; the
|
|
880
|
+
* returned function removes the layer.
|
|
881
|
+
*/
|
|
882
|
+
declare function attachTileflowSky(map: TileflowSkyMap): () => void;
|
|
883
|
+
|
|
884
|
+
declare const tileflowSkyHazeLayerId = "tileflow-sky-haze";
|
|
885
|
+
/** The MapLibre GL JS map capabilities the haze reads; importing this module loads no renderer. */
|
|
886
|
+
type TileflowSkyHazeView = {
|
|
887
|
+
getBearing?(): number;
|
|
888
|
+
getCanvas?(): {
|
|
889
|
+
clientHeight: number;
|
|
890
|
+
};
|
|
891
|
+
getCenter?(): {
|
|
892
|
+
lat: number;
|
|
893
|
+
lng: number;
|
|
894
|
+
};
|
|
895
|
+
getPitch(): number;
|
|
896
|
+
getSky?(): unknown;
|
|
897
|
+
getVerticalFieldOfView?(): number;
|
|
898
|
+
getZoom?(): number;
|
|
899
|
+
};
|
|
900
|
+
/** The map capabilities the haze layer uses. */
|
|
901
|
+
type TileflowSkyHazeMap = TileflowSkyHazeView & {
|
|
902
|
+
addLayer(layer: object, beforeId?: string): unknown;
|
|
903
|
+
getLayer(id: string): unknown;
|
|
904
|
+
getLayersOrder?(): string[];
|
|
905
|
+
getStyle(): unknown;
|
|
906
|
+
getTerrain?(): unknown;
|
|
907
|
+
moveLayer?(id: string, beforeId?: string): unknown;
|
|
908
|
+
off(event: string, listener: () => void): unknown;
|
|
909
|
+
on(event: string, listener: () => void): unknown;
|
|
910
|
+
removeLayer(id: string): unknown;
|
|
911
|
+
};
|
|
912
|
+
/**
|
|
913
|
+
* The distance haze over the flat map, for maps with a sky: a band of the sky's horizon colour from
|
|
914
|
+
* where the haze starts up to the horizon, thickening with the flat ground's distance, so the
|
|
915
|
+
* ground meets the sky in the colour the sky starts with. It sits under the first 3D layer (or,
|
|
916
|
+
* without one, the first label layer); Tileflow's 3D buildings, trees and models haze themselves
|
|
917
|
+
* in their own shaders, and labels drawn above it stay clear. It shows only above 45° of pitch,
|
|
918
|
+
* costs one quad, and follows style replacements; the returned function removes it.
|
|
1401
919
|
*/
|
|
1402
|
-
|
|
1403
|
-
areTilesLoaded?: unknown;
|
|
1404
|
-
getCanvas?: unknown;
|
|
1405
|
-
getImage?: unknown;
|
|
1406
|
-
getLayer?: unknown;
|
|
1407
|
-
getStyle?: unknown;
|
|
1408
|
-
isStyleLoaded?: unknown;
|
|
1409
|
-
off(event: string, listener: (event?: unknown) => void): unknown;
|
|
1410
|
-
on(event: string, listener: (event?: unknown) => void): unknown;
|
|
1411
|
-
project?: unknown;
|
|
1412
|
-
redraw?: unknown;
|
|
1413
|
-
setLayoutProperty?: unknown;
|
|
1414
|
-
setLight?: unknown;
|
|
1415
|
-
setPaintProperty?: unknown;
|
|
1416
|
-
setSky?: unknown;
|
|
1417
|
-
unproject?: unknown;
|
|
1418
|
-
updateImage?: unknown;
|
|
1419
|
-
};
|
|
920
|
+
declare function attachTileflowSkyHaze(map: TileflowSkyHazeMap): () => void;
|
|
1420
921
|
|
|
1421
922
|
/** Structural MapLibre capabilities; importing this module never loads a renderer. */
|
|
1422
923
|
type TileflowAtmosphereMap = {
|
|
@@ -1437,13 +938,64 @@ type TileflowAtmosphereMap = {
|
|
|
1437
938
|
} | undefined;
|
|
1438
939
|
on(event: 'move' | 'resize' | 'style.load' | 'remove', listener: () => void): unknown;
|
|
1439
940
|
off(event: 'move' | 'resize' | 'style.load' | 'remove', listener: () => void): unknown;
|
|
1440
|
-
}
|
|
941
|
+
} & Partial<TileflowSkyMap> & Partial<TileflowSkyHazeMap>;
|
|
1441
942
|
/**
|
|
1442
|
-
* Render compiled globe atmosphere metadata
|
|
1443
|
-
* Follows style replacements and releases its canvas,
|
|
943
|
+
* Render compiled globe atmosphere metadata, and the stars and distance haze of a sky. Call after
|
|
944
|
+
* constructing a browser map. Follows style replacements and releases its canvas, layer,
|
|
945
|
+
* listeners, and pending frame on disposal.
|
|
1444
946
|
*/
|
|
1445
947
|
declare function attachTileflowAtmosphere(map: TileflowAtmosphereMap): () => void;
|
|
1446
948
|
|
|
949
|
+
/**
|
|
950
|
+
* The steepest camera pitch Tileflow supports, in degrees from looking straight down. Every
|
|
951
|
+
* portable view admits pitch 0–85, and Tileflow's maps raise MapLibre's own default of 60 to this,
|
|
952
|
+
* so a street-level view looks along the street to the sky. A map's `mapOptions.maxPitch` lowers it.
|
|
953
|
+
*/
|
|
954
|
+
declare const tileflowMaxPitch = 85;
|
|
955
|
+
|
|
956
|
+
declare const tileflowSkyMetadataKey = "tileflow:sky";
|
|
957
|
+
/** One theme's sky colours, as a time of day lends them to a sky that follows the sun. */
|
|
958
|
+
type TileflowSkyColours = Readonly<{
|
|
959
|
+
color: string;
|
|
960
|
+
horizonColor: string;
|
|
961
|
+
horizonBlend: number;
|
|
962
|
+
glowColor: string;
|
|
963
|
+
}>;
|
|
964
|
+
/** The skies of a theme's time-of-day family, from which a sky that follows the sun is mixed. */
|
|
965
|
+
type TileflowSkyTimesOfDay = Readonly<Record<'day' | 'dawn' | 'dusk' | 'night', TileflowSkyColours>>;
|
|
966
|
+
/**
|
|
967
|
+
* The versioned runtime payload: what the browser needs to draw the stars and the glow round the
|
|
968
|
+
* sun, and, for a theme in a time-of-day family, the family's skies, so that a sun an application
|
|
969
|
+
* places brings the sky of its hour.
|
|
970
|
+
*/
|
|
971
|
+
type TileflowSkyMetadata = Readonly<{
|
|
972
|
+
version: 1;
|
|
973
|
+
starIntensity: number;
|
|
974
|
+
glowColor: string;
|
|
975
|
+
timesOfDay?: TileflowSkyTimesOfDay;
|
|
976
|
+
}>;
|
|
977
|
+
/** Validate the runtime payload without loading authoring schemas. */
|
|
978
|
+
declare function readTileflowSky(value: unknown): TileflowSkyMetadata | undefined;
|
|
979
|
+
/**
|
|
980
|
+
* The sky of a sun at this height and direction, mixed from a time-of-day family's skies: the day
|
|
981
|
+
* sky above the golden hour, the dawn or dusk sky within two degrees of sunrise or sunset (dawn while the sun is in
|
|
982
|
+
* the eastern half of the sky), and the night sky once twilight ends. Every colour comes from the
|
|
983
|
+
* family's themes, so a monochrome or a client's own family keeps its palette.
|
|
984
|
+
*/
|
|
985
|
+
declare function tileflowSkyAtSun(times: TileflowSkyTimesOfDay, sun: Readonly<{
|
|
986
|
+
altitude: number;
|
|
987
|
+
azimuth: number;
|
|
988
|
+
}>): TileflowSkyColours;
|
|
989
|
+
|
|
990
|
+
/**
|
|
991
|
+
* The WebGL context a browser map asks for. Multisampling is on, so the thin edges of 3D models,
|
|
992
|
+
* buildings and trees resolve smoothly instead of breaking into stipple. Attributes the caller
|
|
993
|
+
* passes win, so `{antialias: false}` opts out.
|
|
994
|
+
*/
|
|
995
|
+
declare function tileflowCanvasContextAttributes<T extends object>(attributes?: T): T & {
|
|
996
|
+
antialias: boolean;
|
|
997
|
+
};
|
|
998
|
+
|
|
1447
999
|
/**
|
|
1448
1000
|
* Boundaries families. Each one has its own license, attribution, TileJSON path and style source
|
|
1449
1001
|
* ID; families are never merged.
|
|
@@ -1474,7 +1026,7 @@ type TileflowBoundaryValues = Readonly<{
|
|
|
1474
1026
|
rows: readonly TileflowBoundaryRow[];
|
|
1475
1027
|
}>;
|
|
1476
1028
|
|
|
1477
|
-
type FeatureTarget = {
|
|
1029
|
+
type FeatureTarget$1 = {
|
|
1478
1030
|
id?: number | string;
|
|
1479
1031
|
source: string;
|
|
1480
1032
|
sourceLayer?: string;
|
|
@@ -1487,8 +1039,8 @@ type TileflowFeatureStateMap = {
|
|
|
1487
1039
|
} | undefined;
|
|
1488
1040
|
off(type: 'styledata', listener: () => void): unknown;
|
|
1489
1041
|
on(type: 'styledata', listener: () => void): unknown;
|
|
1490
|
-
removeFeatureState(target: FeatureTarget, key?: string): void;
|
|
1491
|
-
setFeatureState(target: FeatureTarget & {
|
|
1042
|
+
removeFeatureState(target: FeatureTarget$1, key?: string): void;
|
|
1043
|
+
setFeatureState(target: FeatureTarget$1 & {
|
|
1492
1044
|
id: number | string;
|
|
1493
1045
|
}, state: Record<string, unknown>): void;
|
|
1494
1046
|
};
|
|
@@ -1618,213 +1170,6 @@ type TileflowLineProgressController = {
|
|
|
1618
1170
|
*/
|
|
1619
1171
|
declare function createTileflowLineProgress(map: TileflowLineProgressMap, options: TileflowLineProgressOptions): TileflowLineProgressController;
|
|
1620
1172
|
|
|
1621
|
-
/** Bounded, read-only mesh snapshot for developer tooling. Positions are x east, y north, z up. */
|
|
1622
|
-
type TileflowModelInspection = Readonly<{
|
|
1623
|
-
id: string;
|
|
1624
|
-
module: string;
|
|
1625
|
-
format: string;
|
|
1626
|
-
vertices: number;
|
|
1627
|
-
triangles: number;
|
|
1628
|
-
bytes: number;
|
|
1629
|
-
lods: number;
|
|
1630
|
-
instances?: number;
|
|
1631
|
-
positions: number[];
|
|
1632
|
-
indices: number[];
|
|
1633
|
-
colors?: string[];
|
|
1634
|
-
}>;
|
|
1635
|
-
|
|
1636
|
-
type TileflowTileAddress = Readonly<{
|
|
1637
|
-
z: number;
|
|
1638
|
-
x: number;
|
|
1639
|
-
y: number;
|
|
1640
|
-
}>;
|
|
1641
|
-
/** A decoded tile: its address and the chosen layers it holds. */
|
|
1642
|
-
type TileflowTile = TileflowTileAddress & Readonly<{
|
|
1643
|
-
layers: Readonly<Record<string, TileflowTileLayer>>;
|
|
1644
|
-
}>;
|
|
1645
|
-
/** Rewrites a tile request as a MapLibre map's `transformRequest` does. */
|
|
1646
|
-
type TileflowTileRequestTransform = (url: string, resourceType: 'Tile') => Promise<Readonly<{
|
|
1647
|
-
url: string;
|
|
1648
|
-
headers?: Readonly<Record<string, string>>;
|
|
1649
|
-
credentials?: RequestCredentials;
|
|
1650
|
-
}> | undefined> | Readonly<{
|
|
1651
|
-
url: string;
|
|
1652
|
-
headers?: Readonly<Record<string, string>>;
|
|
1653
|
-
credentials?: RequestCredentials;
|
|
1654
|
-
}> | undefined;
|
|
1655
|
-
type TileflowTileReaderOptions = Readonly<{
|
|
1656
|
-
/** The tile address with `{z}`, `{x}` and `{y}`, such as a MapLibre vector source's `tiles[0]`. */
|
|
1657
|
-
tiles: string;
|
|
1658
|
-
/** The lowest zoom the source has tiles for; defaults to 0. */
|
|
1659
|
-
minzoom?: number;
|
|
1660
|
-
/** The highest zoom the source has tiles for; deeper reads use its tiles. Defaults to 14. */
|
|
1661
|
-
maxzoom?: number;
|
|
1662
|
-
/** The layers to decode; defaults to every layer. */
|
|
1663
|
-
layers?: readonly string[];
|
|
1664
|
-
/** Decoded tiles kept for later reads, from 0 to 4096; defaults to 128. */
|
|
1665
|
-
cacheSize?: number;
|
|
1666
|
-
/** Requests in flight at once, from 1 to 32; defaults to 6. */
|
|
1667
|
-
concurrency?: number;
|
|
1668
|
-
/** The map's request rules, applied to every tile request. */
|
|
1669
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
1670
|
-
/**
|
|
1671
|
-
* Defaults to the global `fetch`, and to Core's PMTiles protocol for a source served from a
|
|
1672
|
-
* Tileflow PMTiles archive (`tileflow-pmtiles://`).
|
|
1673
|
-
*/
|
|
1674
|
-
fetch?: (url: string, init: RequestInit) => Promise<Response>;
|
|
1675
|
-
}>;
|
|
1676
|
-
type TileflowTileAreaRequest = Readonly<{
|
|
1677
|
-
/** `[west, south, east, north]` in degrees. */
|
|
1678
|
-
bounds: readonly [number, number, number, number];
|
|
1679
|
-
/** The zoom to read at, clamped to the source's zooms. */
|
|
1680
|
-
zoom: number;
|
|
1681
|
-
/** The most tiles the area may take; a larger area is refused. Defaults to 64. */
|
|
1682
|
-
maxTiles?: number;
|
|
1683
|
-
signal?: AbortSignal;
|
|
1684
|
-
}>;
|
|
1685
|
-
type TileflowTileReader = {
|
|
1686
|
-
/** A tile's chosen layers, or undefined when the source has no tile there (404 or 204). */
|
|
1687
|
-
readTile(address: TileflowTileAddress, options?: {
|
|
1688
|
-
signal?: AbortSignal;
|
|
1689
|
-
}): Promise<TileflowTile | undefined>;
|
|
1690
|
-
/** The tiles covering an area at a zoom, without the absent ones, nearest the centre first. */
|
|
1691
|
-
readArea(request: TileflowTileAreaRequest): Promise<TileflowTile[]>;
|
|
1692
|
-
/** Forgets every cached tile. */
|
|
1693
|
-
clear(): void;
|
|
1694
|
-
};
|
|
1695
|
-
/** The tiles at `zoom` covering `[west, south, east, north]`, nearest the centre first. */
|
|
1696
|
-
declare function tileflowTilesForBounds(bounds: readonly [number, number, number, number], zoom: number): TileflowTileAddress[];
|
|
1697
|
-
/** The longitude and latitude of a point in a tile, given in tile units of an `extent`. */
|
|
1698
|
-
declare function tileflowTilePointToLngLat(tile: TileflowTileAddress, x: number, y: number, extent?: number): [number, number];
|
|
1699
|
-
/**
|
|
1700
|
-
* Reads a vector source's tiles in an application: for example a MapLibre map's World source, with
|
|
1701
|
-
* `tiles`, `minzoom` and `maxzoom` taken from `map.getSource(id)`, and the map's `transformRequest`.
|
|
1702
|
-
*/
|
|
1703
|
-
declare function createTileflowTileReader(options: TileflowTileReaderOptions): TileflowTileReader;
|
|
1704
|
-
/** Structural MapLibre capability; importing this module never loads a renderer. */
|
|
1705
|
-
type TileflowTileSourceMap = {
|
|
1706
|
-
getSource(id: string): unknown;
|
|
1707
|
-
};
|
|
1708
|
-
/**
|
|
1709
|
-
* The tile address and zooms of a map's vector source once the map has loaded it, ready for
|
|
1710
|
-
* `createTileflowTileReader`; undefined while the source is not loaded or has no tile address.
|
|
1711
|
-
*/
|
|
1712
|
-
declare function readTileflowMapTileSource(map: TileflowTileSourceMap, sourceId: string): {
|
|
1713
|
-
tiles: string;
|
|
1714
|
-
minzoom: number;
|
|
1715
|
-
maxzoom: number;
|
|
1716
|
-
} | undefined;
|
|
1717
|
-
|
|
1718
|
-
type ShadowPoint = readonly number[];
|
|
1719
|
-
type ShadowBox = Readonly<{
|
|
1720
|
-
min: ShadowPoint;
|
|
1721
|
-
max: ShadowPoint;
|
|
1722
|
-
}>;
|
|
1723
|
-
type ShadowView = Readonly<{
|
|
1724
|
-
/** Visible receiver points, in the caster box's metre frame. All casters still draw. */
|
|
1725
|
-
receivers?: readonly ShadowPoint[];
|
|
1726
|
-
/** Snap to world-aligned texels; omit for an unsnapped mathematical projection. */
|
|
1727
|
-
resolution?: number;
|
|
1728
|
-
origin?: ShadowPoint;
|
|
1729
|
-
/** Metres per fixed world unit; keeps texel quantization independent of latitude scale. */
|
|
1730
|
-
gridScale?: number;
|
|
1731
|
-
}>;
|
|
1732
|
-
/**
|
|
1733
|
-
* The sun's orthographic view, in metres, with room for each caster's shadow to reach the ground.
|
|
1734
|
-
* Optional receivers concentrate XY resolution without dropping offscreen casters along a ray;
|
|
1735
|
-
* quantized extents and a world-anchored texel grid keep stationary shadows stable during pans.
|
|
1736
|
-
*/
|
|
1737
|
-
declare function tileflowSunLightMatrix(direction: readonly number[], box: ShadowBox, view?: ShadowView): {
|
|
1738
|
-
matrix: Float32Array;
|
|
1739
|
-
depth: number;
|
|
1740
|
-
extent: number;
|
|
1741
|
-
};
|
|
1742
|
-
|
|
1743
|
-
/** The MapLibre GL JS map capabilities the renderer uses. */
|
|
1744
|
-
type TileflowBuildings3DMap = {
|
|
1745
|
-
addLayer(layer: object, beforeId?: string): unknown;
|
|
1746
|
-
getCenter(): {
|
|
1747
|
-
lat: number;
|
|
1748
|
-
lng: number;
|
|
1749
|
-
};
|
|
1750
|
-
getBearing(): number;
|
|
1751
|
-
getCanvas?(): {
|
|
1752
|
-
clientHeight: number;
|
|
1753
|
-
};
|
|
1754
|
-
getVerticalFieldOfView?(): number;
|
|
1755
|
-
getLight?(): unknown;
|
|
1756
|
-
getLayer(id: string): unknown;
|
|
1757
|
-
getPaintProperty(layer: string, name: string): unknown;
|
|
1758
|
-
getPitch(): number;
|
|
1759
|
-
getSource(id: string): unknown;
|
|
1760
|
-
getStyle(): unknown;
|
|
1761
|
-
getZoom(): number;
|
|
1762
|
-
isStyleLoaded(): boolean | void;
|
|
1763
|
-
off(event: string, listener: () => void): unknown;
|
|
1764
|
-
on(event: string, listener: () => void): unknown;
|
|
1765
|
-
removeLayer(id: string): unknown;
|
|
1766
|
-
triggerRepaint(): unknown;
|
|
1767
|
-
};
|
|
1768
|
-
/** Where the renderer reads the sun and the map's design: a Tileflow theme controller. */
|
|
1769
|
-
type TileflowBuildings3DThemes = {
|
|
1770
|
-
getSun?(): TileflowSun;
|
|
1771
|
-
getThemeMetadata?(key: string): Readonly<{
|
|
1772
|
-
values: readonly unknown[];
|
|
1773
|
-
position: number;
|
|
1774
|
-
}>;
|
|
1775
|
-
};
|
|
1776
|
-
type TileflowBuildings3DOptions = Readonly<{
|
|
1777
|
-
map: TileflowBuildings3DMap;
|
|
1778
|
-
/** The theme controller, for the sun and the buildings' design in every theme. */
|
|
1779
|
-
controller?: TileflowBuildings3DThemes;
|
|
1780
|
-
/** The zoom where buildings start fading in, reaching full opacity 0.25 zoom later. Defaults to 15. */
|
|
1781
|
-
minzoom?: number;
|
|
1782
|
-
/** The most tiles raised round the camera, from 1 to 64; defaults to 25. */
|
|
1783
|
-
maxTiles?: number;
|
|
1784
|
-
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
1785
|
-
beforeId?: string;
|
|
1786
|
-
/** The map's request rules, for the tiles the renderer reads. */
|
|
1787
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
1788
|
-
}>;
|
|
1789
|
-
type TileflowBuildings3DChange = Readonly<{
|
|
1790
|
-
transition?: Readonly<{
|
|
1791
|
-
duration?: number;
|
|
1792
|
-
mode?: 'grow' | 'fade';
|
|
1793
|
-
}>;
|
|
1794
|
-
}>;
|
|
1795
|
-
type TileflowBuildings3D = {
|
|
1796
|
-
/** Read-only, bounded snapshots of resident prepared model meshes. */
|
|
1797
|
-
inspectModels(): TileflowModelInspection[];
|
|
1798
|
-
/** Shows buildings immediately; pass a transition duration to animate their rise. */
|
|
1799
|
-
show(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1800
|
-
/** Hides buildings immediately; pass a transition duration to animate their descent. */
|
|
1801
|
-
hide(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1802
|
-
/** Sets the height scale, from 0 (flat) to 1; animation requires a transition duration. */
|
|
1803
|
-
grow(scale: number, options?: TileflowBuildings3DChange): Promise<void>;
|
|
1804
|
-
/** The height scale shown now. */
|
|
1805
|
-
readonly scale: number;
|
|
1806
|
-
/**
|
|
1807
|
-
* Whether the map's style describes its 3D buildings (the buildings module's
|
|
1808
|
-
* `threeDimensional`), tiles raised, buildings and vertices, and the placed models standing, for
|
|
1809
|
-
* diagnostics.
|
|
1810
|
-
*/
|
|
1811
|
-
readonly stats: Readonly<{
|
|
1812
|
-
declared: boolean;
|
|
1813
|
-
tiles: number;
|
|
1814
|
-
buildings: number;
|
|
1815
|
-
vertices: number;
|
|
1816
|
-
models: number;
|
|
1817
|
-
}>;
|
|
1818
|
-
/** Takes the layer off the map and lets go of its buffers. */
|
|
1819
|
-
dispose(): void;
|
|
1820
|
-
};
|
|
1821
|
-
declare const tileflowBuildings3DLayerId = "tileflow-buildings-3d";
|
|
1822
|
-
/**
|
|
1823
|
-
* Creates the renderer, showing buildings automatically above zoom 15 unless hidden. It reads the source's
|
|
1824
|
-
* z15 tiles round the camera, the zoom at which World's buildings carry their heights.
|
|
1825
|
-
*/
|
|
1826
|
-
declare function createTileflowBuildings3D(options: TileflowBuildings3DOptions): TileflowBuildings3D;
|
|
1827
|
-
|
|
1828
1173
|
/** The renderer's tile units: MapLibre projects custom layers' tiles over 8192. */
|
|
1829
1174
|
declare const tileflowBuildingExtent = 8192;
|
|
1830
1175
|
/** Bytes per vertex; see `meshTileflowBuildings` for the layout. */
|
|
@@ -1892,76 +1237,6 @@ type TileflowBuildingMesh = Readonly<{
|
|
|
1892
1237
|
*/
|
|
1893
1238
|
declare function meshTileflowBuildings(layer: TileflowTileLayer, options: TileflowBuildingMeshOptions): TileflowBuildingMesh | undefined;
|
|
1894
1239
|
|
|
1895
|
-
/** The MapLibre GL JS map capabilities the street lights use. */
|
|
1896
|
-
type TileflowStreetLightsMap = {
|
|
1897
|
-
addLayer(layer: object, beforeId?: string): unknown;
|
|
1898
|
-
getBearing(): number;
|
|
1899
|
-
getCenter(): {
|
|
1900
|
-
lat: number;
|
|
1901
|
-
lng: number;
|
|
1902
|
-
};
|
|
1903
|
-
getLayer(id: string): unknown;
|
|
1904
|
-
getPitch(): number;
|
|
1905
|
-
getSource(id: string): unknown;
|
|
1906
|
-
getStyle(): unknown;
|
|
1907
|
-
getZoom(): number;
|
|
1908
|
-
isStyleLoaded(): boolean | void;
|
|
1909
|
-
off(event: string, listener: () => void): unknown;
|
|
1910
|
-
on(event: string, listener: () => void): unknown;
|
|
1911
|
-
removeLayer(id: string): unknown;
|
|
1912
|
-
triggerRepaint(): unknown;
|
|
1913
|
-
};
|
|
1914
|
-
type TileflowStreetLightsOptions = Readonly<{
|
|
1915
|
-
map: TileflowStreetLightsMap;
|
|
1916
|
-
/**
|
|
1917
|
-
* By default, only a map that enables roads.streetLights supplies lights. Set true to opt in
|
|
1918
|
-
* with the fallback design when metadata is absent, or false to keep every theme's lights off.
|
|
1919
|
-
*/
|
|
1920
|
-
enabled?: boolean;
|
|
1921
|
-
/**
|
|
1922
|
-
* The theme controller, whose sun switches the lights on and off and whose themes hold the map's
|
|
1923
|
-
* street lights (the roads module's `streetLights`).
|
|
1924
|
-
*/
|
|
1925
|
-
controller?: {
|
|
1926
|
-
getSun?(): TileflowSun;
|
|
1927
|
-
getThemeMetadata?(key: string): Readonly<{
|
|
1928
|
-
values: readonly unknown[];
|
|
1929
|
-
position: number;
|
|
1930
|
-
}>;
|
|
1931
|
-
};
|
|
1932
|
-
/** The zoom from which the lights shine. Defaults to 14. */
|
|
1933
|
-
minzoom?: number;
|
|
1934
|
-
/** The most tiles lit round the camera, from 1 to 64; defaults to 25. */
|
|
1935
|
-
maxTiles?: number;
|
|
1936
|
-
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
1937
|
-
beforeId?: string;
|
|
1938
|
-
/** The map's request rules, for the tiles the layer reads. */
|
|
1939
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
1940
|
-
}>;
|
|
1941
|
-
type TileflowStreetLights = {
|
|
1942
|
-
/** How far the lights have switched on, from 0 by day to 1 at night. */
|
|
1943
|
-
readonly on: number;
|
|
1944
|
-
/**
|
|
1945
|
-
* Whether the map's style describes its street lights, tiles lit, lamps, and how many of them the
|
|
1946
|
-
* data maps or the layer estimates.
|
|
1947
|
-
*/
|
|
1948
|
-
readonly stats: Readonly<{
|
|
1949
|
-
declared: boolean;
|
|
1950
|
-
tiles: number;
|
|
1951
|
-
lamps: number;
|
|
1952
|
-
mapped: number;
|
|
1953
|
-
estimated: number;
|
|
1954
|
-
}>;
|
|
1955
|
-
/** Takes the layer off the map and lets go of its buffers. */
|
|
1956
|
-
dispose(): void;
|
|
1957
|
-
};
|
|
1958
|
-
declare const tileflowStreetLightsLayerId = "tileflow-street-lights";
|
|
1959
|
-
/**
|
|
1960
|
-
* Creates the street lights and puts their layer on the map. They read the source's z15 tiles round
|
|
1961
|
-
* the camera once the controller's sun darkens the map, and shine from `minzoom`.
|
|
1962
|
-
*/
|
|
1963
|
-
declare function createTileflowStreetLights(options: TileflowStreetLightsOptions): TileflowStreetLights;
|
|
1964
|
-
|
|
1965
1240
|
/** Begin/end height fractions, begin/end multipliers and the base-10 curve exponent. */
|
|
1966
1241
|
type TileflowModelEmissionGradient = readonly [number, number, number, number, number];
|
|
1967
1242
|
type TileflowModelRoleLighting = Readonly<{
|
|
@@ -2026,6 +1301,15 @@ type TileflowBuildings3DDesign = Readonly<{
|
|
|
2026
1301
|
modelLighting?: Readonly<Partial<Record<TileflowModelLightingRole, TileflowModelRoleLighting>>>;
|
|
2027
1302
|
/** Invented night windows, lit by rooms: decoration, not data. */
|
|
2028
1303
|
windows: boolean;
|
|
1304
|
+
/**
|
|
1305
|
+
* The zoom bands, `[from, to]`, the buildings and the placed models and landmarks come in over:
|
|
1306
|
+
* across its band each fades in and rises from the ground. The renderer's defaults stand for a
|
|
1307
|
+
* band left out.
|
|
1308
|
+
*/
|
|
1309
|
+
entrance?: Readonly<{
|
|
1310
|
+
buildings?: readonly [number, number];
|
|
1311
|
+
models?: readonly [number, number];
|
|
1312
|
+
}>;
|
|
2029
1313
|
/** Shadows from the sun, and contact shadow at the foot of the walls. */
|
|
2030
1314
|
shadows: boolean;
|
|
2031
1315
|
occlusion: boolean;
|
|
@@ -2069,92 +1353,6 @@ declare function tileflowTeamModelUrl(model: string): string;
|
|
|
2069
1353
|
/** The Team model a placement's address is the placeholder of, if it is one. */
|
|
2070
1354
|
declare function readTileflowTeamModelName(url: string): string | undefined;
|
|
2071
1355
|
|
|
2072
|
-
/** The MapLibre GL JS map capabilities the trees use. */
|
|
2073
|
-
type TileflowTrees3DMap = {
|
|
2074
|
-
addLayer(layer: object, beforeId?: string): unknown;
|
|
2075
|
-
getBearing(): number;
|
|
2076
|
-
getCenter(): {
|
|
2077
|
-
lat: number;
|
|
2078
|
-
lng: number;
|
|
2079
|
-
};
|
|
2080
|
-
getLayer(id: string): unknown;
|
|
2081
|
-
getLayoutProperty?(layer: string, name: string): unknown;
|
|
2082
|
-
getPitch(): number;
|
|
2083
|
-
getSource(id: string): unknown;
|
|
2084
|
-
getStyle(): unknown;
|
|
2085
|
-
getZoom(): number;
|
|
2086
|
-
isStyleLoaded(): boolean | void;
|
|
2087
|
-
off(event: string, listener: () => void): unknown;
|
|
2088
|
-
on(event: string, listener: () => void): unknown;
|
|
2089
|
-
removeLayer(id: string): unknown;
|
|
2090
|
-
setLayoutProperty?(layer: string, name: string, value: unknown): unknown;
|
|
2091
|
-
triggerRepaint(): unknown;
|
|
2092
|
-
};
|
|
2093
|
-
/** Where the trees read the sun and the map's design: a Tileflow theme controller. */
|
|
2094
|
-
type TileflowTrees3DThemes = {
|
|
2095
|
-
getSun?(): TileflowSun;
|
|
2096
|
-
getThemeMetadata?(key: string): Readonly<{
|
|
2097
|
-
values: readonly unknown[];
|
|
2098
|
-
position: number;
|
|
2099
|
-
}>;
|
|
2100
|
-
};
|
|
2101
|
-
type TileflowTrees3DOptions = Readonly<{
|
|
2102
|
-
map: TileflowTrees3DMap;
|
|
2103
|
-
/** The theme controller, for the sun and the trees' colours in every theme. */
|
|
2104
|
-
controller?: TileflowTrees3DThemes;
|
|
2105
|
-
/** The vector source with the canopy points, when not the map's World source. */
|
|
2106
|
-
canopySource?: string;
|
|
2107
|
-
/** The zoom from which trees stand; they reach full opacity 0.25 zoom later. Defaults to 15. */
|
|
2108
|
-
minzoom?: number;
|
|
2109
|
-
/** The most tiles of trees round the camera, from 1 to 64; defaults to 25. */
|
|
2110
|
-
maxTiles?: number;
|
|
2111
|
-
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
2112
|
-
beforeId?: string;
|
|
2113
|
-
/** The map's request rules, for the tiles the layer reads. */
|
|
2114
|
-
transformRequest?: TileflowTileRequestTransform;
|
|
2115
|
-
/** Let a vegetation controller own flat-layer visibility. Defaults to true. */
|
|
2116
|
-
manageFlatLayers?: boolean;
|
|
2117
|
-
}>;
|
|
2118
|
-
type TileflowTrees3DChange = Readonly<{
|
|
2119
|
-
transition?: Readonly<{
|
|
2120
|
-
duration?: number;
|
|
2121
|
-
}>;
|
|
2122
|
-
}>;
|
|
2123
|
-
type TileflowTrees3D = {
|
|
2124
|
-
/** Read-only snapshots of the meshes used by the active vegetation palette. */
|
|
2125
|
-
inspectModels(): TileflowModelInspection[];
|
|
2126
|
-
/** Grows the trees out of the ground; resolves once they stand. */
|
|
2127
|
-
show(options?: TileflowTrees3DChange): Promise<void>;
|
|
2128
|
-
/** Sinks the trees back into the ground; resolves once they are gone. */
|
|
2129
|
-
hide(options?: TileflowTrees3DChange): Promise<void>;
|
|
2130
|
-
/** Eases the trees to `scale` of their size, from 0 (none) to 1. */
|
|
2131
|
-
grow(scale: number, options?: TileflowTrees3DChange): Promise<void>;
|
|
2132
|
-
/** The size scale shown now. */
|
|
2133
|
-
readonly scale: number;
|
|
2134
|
-
/**
|
|
2135
|
-
* Whether the map's style describes 3D trees (`vegetation({mode: '3d'})`), tiles of trees,
|
|
2136
|
-
* trees placed (mapped and from canopy points), pieces of hedge placed and trees drawn in the
|
|
2137
|
-
* last frame.
|
|
2138
|
-
*/
|
|
2139
|
-
readonly stats: Readonly<{
|
|
2140
|
-
declared: boolean;
|
|
2141
|
-
tiles: number;
|
|
2142
|
-
trees: number;
|
|
2143
|
-
mapped: number;
|
|
2144
|
-
canopy: number;
|
|
2145
|
-
hedges: number;
|
|
2146
|
-
drawn: number;
|
|
2147
|
-
}>;
|
|
2148
|
-
/** Takes the layer off the map and lets go of its buffers. */
|
|
2149
|
-
dispose(): void;
|
|
2150
|
-
};
|
|
2151
|
-
declare const tileflowTrees3DLayerId = "tileflow-trees-3d";
|
|
2152
|
-
/**
|
|
2153
|
-
* Creates the trees and puts their layer on the map, sunk in the ground until `show()`. They read
|
|
2154
|
-
* the source's z15 tiles round the camera, where World carries its trees and canopy points.
|
|
2155
|
-
*/
|
|
2156
|
-
declare function createTileflowTrees3D(options: TileflowTrees3DOptions): TileflowTrees3D;
|
|
2157
|
-
|
|
2158
1356
|
/** Bytes per lamp; see `placeTileflowStreetLights` for the layout. */
|
|
2159
1357
|
declare const tileflowStreetLightBytes = 12;
|
|
2160
1358
|
/**
|
|
@@ -2503,6 +1701,182 @@ declare const tileflowNoticeLimits: Readonly<{
|
|
|
2503
1701
|
/** Read bounded notices from style metadata; malformed entries are ignored, never rendered. */
|
|
2504
1702
|
declare function readTileflowNotices(metadata: unknown): readonly TileflowMapNotice[];
|
|
2505
1703
|
|
|
1704
|
+
type FeatureId = number | string;
|
|
1705
|
+
type FeatureTarget = {
|
|
1706
|
+
id: FeatureId;
|
|
1707
|
+
source: string;
|
|
1708
|
+
sourceLayer: string;
|
|
1709
|
+
};
|
|
1710
|
+
type TileflowNauticalLightsEvent = 'idle' | 'moveend' | 'remove' | 'sourcedata' | 'style.load' | 'styledata';
|
|
1711
|
+
/** Structural MapLibre capabilities; importing this module never loads a renderer. */
|
|
1712
|
+
type TileflowNauticalLightsMap = {
|
|
1713
|
+
getContainer(): HTMLElement;
|
|
1714
|
+
getLayer(id: string): {
|
|
1715
|
+
maxzoom?: number;
|
|
1716
|
+
minzoom?: number;
|
|
1717
|
+
} | undefined;
|
|
1718
|
+
getLayoutProperty(id: string, name: 'visibility'): unknown;
|
|
1719
|
+
getSource(id: string): unknown;
|
|
1720
|
+
getStyle(): {
|
|
1721
|
+
metadata?: unknown;
|
|
1722
|
+
} | undefined;
|
|
1723
|
+
getZoom(): number;
|
|
1724
|
+
off(event: TileflowNauticalLightsEvent, listener: (event?: {
|
|
1725
|
+
sourceId?: unknown;
|
|
1726
|
+
}) => void): unknown;
|
|
1727
|
+
on(event: TileflowNauticalLightsEvent, listener: (event?: {
|
|
1728
|
+
sourceId?: unknown;
|
|
1729
|
+
}) => void): unknown;
|
|
1730
|
+
queryRenderedFeatures(options: {
|
|
1731
|
+
layers: string[];
|
|
1732
|
+
}): readonly {
|
|
1733
|
+
id?: unknown;
|
|
1734
|
+
properties?: Record<string, unknown> | null;
|
|
1735
|
+
}[];
|
|
1736
|
+
removeFeatureState(target: FeatureTarget, key?: string): unknown;
|
|
1737
|
+
setFeatureState(target: FeatureTarget, state: Record<string, number>): unknown;
|
|
1738
|
+
};
|
|
1739
|
+
/**
|
|
1740
|
+
* Flash the Nautical lights of a compiled style in their rhythms. The style's
|
|
1741
|
+
* `tileflow:nautical-lights` metadata names the light layers; for each light drawn in them, the
|
|
1742
|
+
* helper derives its rhythm (`tileflowLightRhythm`) and writes the light's intensity and colour as
|
|
1743
|
+
* MapLibre feature state whenever its phase changes. Lights that are in the same phase change
|
|
1744
|
+
* together, and the helper wakes only for the next change.
|
|
1745
|
+
*
|
|
1746
|
+
* Nothing is written, and no timer runs, while the page is hidden, while no light layer is
|
|
1747
|
+
* visible at the current zoom, or when no drawn light has a rhythm. When the person viewing the
|
|
1748
|
+
* map prefers reduced motion, or on disposal or map `remove`, every light returns to steady.
|
|
1749
|
+
* Lights are identified by the feature ID their source promotes; the compiled Nautical source
|
|
1750
|
+
* promotes each light's unique `provenance`. A light without an ID stays steady.
|
|
1751
|
+
*/
|
|
1752
|
+
declare function attachTileflowNauticalLights(map: TileflowNauticalLightsMap): () => void;
|
|
1753
|
+
|
|
1754
|
+
/** Style metadata key that names the layers whose Nautical lights flash in their rhythm. */
|
|
1755
|
+
declare const tileflowNauticalLightsMetadataKey: "tileflow:nautical-lights";
|
|
1756
|
+
/**
|
|
1757
|
+
* MapLibre feature-state keys the light layers read. A runtime writes them per light feature; a
|
|
1758
|
+
* light without them shows steadily, exactly as a map that is not animated.
|
|
1759
|
+
*/
|
|
1760
|
+
declare const tileflowNauticalLightStates: Readonly<{
|
|
1761
|
+
/** Index of the colour shown, into the light's comma-separated `color` list. */
|
|
1762
|
+
colour: "tileflowLightColour";
|
|
1763
|
+
/** `1` while the light shines, `0` while it is eclipsed, in between for a fixed part. */
|
|
1764
|
+
intensity: "tileflowLightIntensity";
|
|
1765
|
+
}>;
|
|
1766
|
+
/** The light layers of a compiled style and the source features they draw. */
|
|
1767
|
+
type TileflowNauticalLights = Readonly<{
|
|
1768
|
+
layers: readonly string[];
|
|
1769
|
+
source: string;
|
|
1770
|
+
sourceLayer: string;
|
|
1771
|
+
version: 1;
|
|
1772
|
+
}>;
|
|
1773
|
+
/** Read the bounded light declaration of style metadata; a malformed one is ignored. */
|
|
1774
|
+
declare function readTileflowNauticalLights(metadata: unknown): TileflowNauticalLights | undefined;
|
|
1775
|
+
|
|
1776
|
+
/** One phase of a light's cycle. */
|
|
1777
|
+
type TileflowLightPhase = Readonly<{
|
|
1778
|
+
/** Index of the colour shown, into the light's comma-separated `color` list. */
|
|
1779
|
+
colour: number;
|
|
1780
|
+
/** Seconds, with millisecond precision. */
|
|
1781
|
+
duration: number;
|
|
1782
|
+
/**
|
|
1783
|
+
* `1` while the light shines, `0` while it is eclipsed, and
|
|
1784
|
+
* `tileflowLightRhythmConventions.fixedIntensity` for the steady part of a fixed-and-flashing light.
|
|
1785
|
+
*/
|
|
1786
|
+
intensity: number;
|
|
1787
|
+
}>;
|
|
1788
|
+
/** A light's repeating cycle. Lights with the same `key` flash identically. */
|
|
1789
|
+
type TileflowLightRhythm = Readonly<{
|
|
1790
|
+
/** A canonical description of the phases; equal rhythms have equal keys. */
|
|
1791
|
+
key: string;
|
|
1792
|
+
/** Seconds, the sum of the phase durations. */
|
|
1793
|
+
period: number;
|
|
1794
|
+
phases: readonly TileflowLightPhase[];
|
|
1795
|
+
}>;
|
|
1796
|
+
/** What the light shows at a moment, and for how many more seconds. */
|
|
1797
|
+
type TileflowLightState = Readonly<{
|
|
1798
|
+
colour: number;
|
|
1799
|
+
intensity: number;
|
|
1800
|
+
/** Seconds until the next phase begins; always positive. */
|
|
1801
|
+
remaining: number;
|
|
1802
|
+
}>;
|
|
1803
|
+
/** The `nautical-v1` light fields that define a rhythm; other properties are ignored. */
|
|
1804
|
+
type TileflowLightCharacteristic = Readonly<{
|
|
1805
|
+
character?: unknown;
|
|
1806
|
+
color?: unknown;
|
|
1807
|
+
group?: unknown;
|
|
1808
|
+
period_s?: unknown;
|
|
1809
|
+
sequence?: unknown;
|
|
1810
|
+
}>;
|
|
1811
|
+
/**
|
|
1812
|
+
* The conventions used when a light publishes no `sequence`. Durations are in seconds.
|
|
1813
|
+
*
|
|
1814
|
+
* - `Fl`: flashes of `min(flash, flashShare × period / flashes)`. Flashes of one group are
|
|
1815
|
+
* separated by an eclipse of at most twice the flash, groups of a composite group such as
|
|
1816
|
+
* `2+1` by twice that eclipse, and the remainder of the period is the final eclipse.
|
|
1817
|
+
* - `LFl`: the same layout with flashes of `longFlash`, or `flashShare × period / flashes` when
|
|
1818
|
+
* the period is too short for them.
|
|
1819
|
+
* - `Q`, `VQ`, `UQ`: one flash per `quickCycle` (60, 120 and 240 per minute), lit for
|
|
1820
|
+
* `quickDuty` of each cycle. Without a group they flash continuously; with a group of `n` they
|
|
1821
|
+
* flash `n` times, then stay eclipsed until the period ends.
|
|
1822
|
+
* - `IQ`, `IVQ`, `IUQ`: quick flashes for `interruptedShare` of the period, then an eclipse.
|
|
1823
|
+
* - `Iso`: light and eclipse of equal length.
|
|
1824
|
+
* - `Oc`: eclipses of `occultingShare × period / eclipses`, laid out like `Fl` with light and
|
|
1825
|
+
* eclipse exchanged, so the light is always longer than the eclipse.
|
|
1826
|
+
* - `Mo`: the Morse letters of `group`, with dots of `morseUnit` (shortened to fit the
|
|
1827
|
+
* period), dashes of three units, one unit between signals and three between letters; the
|
|
1828
|
+
* remainder of the period, or seven units without one, is the eclipse.
|
|
1829
|
+
* - `FFl`: a fixed light at `fixedIntensity` with full-intensity flashes laid out like `Fl`;
|
|
1830
|
+
* `F+LFl` does the same with long flashes.
|
|
1831
|
+
* - `Q+LFl`, `VQ+LFl`, `UQ+LFl`, `Fl+LFl`: the group of the first part (six quick flashes when
|
|
1832
|
+
* absent), then one long flash, then the eclipse.
|
|
1833
|
+
* - `Oc+Fl`: drawn as its occulting part.
|
|
1834
|
+
* - `Al.<character>`: the rhythm of that character, each lit phase taking the next colour of
|
|
1835
|
+
* `color`; `Al` alone shows each colour for an equal share of the period.
|
|
1836
|
+
* - Grouped `Q`/`VQ` and `Q+LFl`/`VQ+LFl` without a period use the cardinal-mark periods of
|
|
1837
|
+
* `cardinalPeriods`.
|
|
1838
|
+
*
|
|
1839
|
+
* `F`, an absent or unknown character, a missing period where one is needed, or a layout that
|
|
1840
|
+
* does not fit its period leaves the light steady.
|
|
1841
|
+
*/
|
|
1842
|
+
declare const tileflowLightRhythmConventions: Readonly<{
|
|
1843
|
+
cardinalPeriods: Readonly<{
|
|
1844
|
+
Q: Readonly<{
|
|
1845
|
+
3: 10;
|
|
1846
|
+
6: 15;
|
|
1847
|
+
9: 15;
|
|
1848
|
+
}>;
|
|
1849
|
+
'Q+LFl': 15;
|
|
1850
|
+
VQ: Readonly<{
|
|
1851
|
+
3: 5;
|
|
1852
|
+
6: 10;
|
|
1853
|
+
9: 10;
|
|
1854
|
+
}>;
|
|
1855
|
+
'VQ+LFl': 10;
|
|
1856
|
+
}>;
|
|
1857
|
+
fixedIntensity: 0.5;
|
|
1858
|
+
flash: 1;
|
|
1859
|
+
flashShare: 0.3;
|
|
1860
|
+
interruptedShare: 0.6;
|
|
1861
|
+
longFlash: 2;
|
|
1862
|
+
morseUnit: 0.5;
|
|
1863
|
+
occultingShare: 0.25;
|
|
1864
|
+
quickCycle: Readonly<{
|
|
1865
|
+
Q: 1;
|
|
1866
|
+
UQ: 0.25;
|
|
1867
|
+
VQ: 0.5;
|
|
1868
|
+
}>;
|
|
1869
|
+
quickDuty: 0.3;
|
|
1870
|
+
}>;
|
|
1871
|
+
/**
|
|
1872
|
+
* The rhythm of one light, or `undefined` when it shows steadily: a fixed light, or one without a
|
|
1873
|
+
* usable characteristic. `sequence` wins when it is well formed; otherwise the rhythm follows
|
|
1874
|
+
* `tileflowLightRhythmConventions`.
|
|
1875
|
+
*/
|
|
1876
|
+
declare function tileflowLightRhythm(light: TileflowLightCharacteristic): TileflowLightRhythm | undefined;
|
|
1877
|
+
/** What `rhythm` shows `seconds` after the shared epoch of every rhythm. */
|
|
1878
|
+
declare function tileflowLightStateAt(rhythm: TileflowLightRhythm, seconds: number): TileflowLightState;
|
|
1879
|
+
|
|
2506
1880
|
declare const tileflowMaplibreContourVersion: "0.1.0";
|
|
2507
1881
|
type TileflowContourProtocolRequest = Readonly<{
|
|
2508
1882
|
url: string;
|
|
@@ -2542,49 +1916,54 @@ declare const tileflowPmtilesProtocol: "tileflow-pmtiles";
|
|
|
2542
1916
|
/** Register only Tileflow's managed PMTiles namespace. Third-party `pmtiles://` remains untouched. */
|
|
2543
1917
|
declare function registerTileflowPmtilesProtocol(registry: TileflowPmtilesProtocolRegistry, options?: TileflowPmtilesProtocolRegistrationOptions): void;
|
|
2544
1918
|
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
type
|
|
2568
|
-
|
|
2569
|
-
|
|
1919
|
+
/** The style metadata through which a compiled map declares its 3D scene. */
|
|
1920
|
+
declare const tileflowMap3DMetadataKeys: readonly ["tileflow:buildings", "tileflow:vegetation", "tileflow:vegetation-display", "tileflow:street-lights"];
|
|
1921
|
+
/** Where the 3D scene reads the style: the map, and the theme controller when there is one. */
|
|
1922
|
+
type TileflowMap3DSource = Readonly<{
|
|
1923
|
+
map: {
|
|
1924
|
+
getStyle(): unknown;
|
|
1925
|
+
};
|
|
1926
|
+
controller?: {
|
|
1927
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
1928
|
+
values: readonly unknown[];
|
|
1929
|
+
position: number;
|
|
1930
|
+
}>;
|
|
1931
|
+
};
|
|
1932
|
+
}>;
|
|
1933
|
+
/**
|
|
1934
|
+
* The parts of a 3D scene the style on screen declares, as their metadata keys; during a theme
|
|
1935
|
+
* blend, those any blended theme declares.
|
|
1936
|
+
*/
|
|
1937
|
+
declare function tileflowMap3DDeclarations(source: TileflowMap3DSource): ReadonlySet<string>;
|
|
1938
|
+
/** Whether the style on screen declares any part of a 3D scene: buildings, trees or lights. */
|
|
1939
|
+
declare function tileflowMapDeclares3D(source: TileflowMap3DSource): boolean;
|
|
1940
|
+
/** Loads the 3D renderers: a dynamic import of the `@tileflow/core/3d` entry. */
|
|
1941
|
+
type TileflowMap3DLoader = () => Promise<{
|
|
1942
|
+
createTileflowMap3D(options: TileflowMap3DOptions): TileflowMap3D;
|
|
1943
|
+
}>;
|
|
1944
|
+
type AttachTileflowMap3DOptions = TileflowMap3DOptions & {
|
|
1945
|
+
map: TileflowMap3DOptions['map'] & {
|
|
1946
|
+
getStyle(): unknown;
|
|
2570
1947
|
};
|
|
2571
|
-
/**
|
|
2572
|
-
|
|
2573
|
-
/**
|
|
2574
|
-
|
|
2575
|
-
};
|
|
2576
|
-
type
|
|
2577
|
-
|
|
2578
|
-
|
|
1948
|
+
/** Loads the renderers the first time the map's style declares 3D. */
|
|
1949
|
+
load: TileflowMap3DLoader;
|
|
1950
|
+
/** Receives a failure to load or mount the renderers; the 2D map keeps working. */
|
|
1951
|
+
onError?: (error: unknown) => void;
|
|
1952
|
+
};
|
|
1953
|
+
type TileflowMap3DAttachment = {
|
|
1954
|
+
/** The mounted scene, once a style that declares 3D has loaded the renderers. */
|
|
1955
|
+
readonly scene: TileflowMap3D | undefined;
|
|
1956
|
+
/** `3d` shows the scene; `2d` hides it and draws `auto` vegetation flat. */
|
|
2579
1957
|
setViewMode(mode: TileflowViewMode): void;
|
|
2580
|
-
/**
|
|
2581
|
-
|
|
2582
|
-
readonly representation: TileflowVegetationRepresentation;
|
|
2583
|
-
readonly stats: TileflowTrees3D['stats'] | undefined;
|
|
1958
|
+
/** Overrides the map's vegetation visibility; undefined restores the authored default. */
|
|
1959
|
+
setVegetation(visible: boolean | undefined): void;
|
|
2584
1960
|
dispose(): void;
|
|
2585
1961
|
};
|
|
2586
|
-
/**
|
|
2587
|
-
|
|
1962
|
+
/**
|
|
1963
|
+
* Mounts the map's 3D scene when, and only when, its style declares one. Until then it loads
|
|
1964
|
+
* nothing, so a 2D map does not pay for the 3D renderers. Requested state applies on mount.
|
|
1965
|
+
*/
|
|
1966
|
+
declare function attachTileflowMap3D(options: AttachTileflowMap3DOptions): TileflowMap3DAttachment;
|
|
2588
1967
|
|
|
2589
1968
|
type TileflowMapReadinessState = 'error' | 'idle' | 'loading';
|
|
2590
1969
|
/** Read the browser preference without persisting or mutating user state. */
|
|
@@ -2823,4 +2202,4 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
|
|
|
2823
2202
|
worldRequestBridge?: TileflowWorldRequestBridge;
|
|
2824
2203
|
}): TileflowTransformRequest<TRequest, TResourceType>;
|
|
2825
2204
|
|
|
2826
|
-
export { type CreateBoundaryFeatureStateOptions, type TileflowAtmosphereMap, type TileflowBoundaryFeatureState, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildingModelPlacement, type
|
|
2205
|
+
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 TileflowLightCharacteristic, type TileflowLightPhase, type TileflowLightRhythm, type TileflowLightState, 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 TileflowNauticalLights, type TileflowNauticalLightsMap, 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 TileflowSkyColours, type TileflowSkyHazeMap, type TileflowSkyMap, type TileflowSkyMetadata, type TileflowSkyTimesOfDay, 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, attachTileflowNauticalLights, attachTileflowNotices, attachTileflowSky, attachTileflowSkyHaze, createBoundaryFeatureState, createTileflowDepthMarkers, createTileflowGroundLayers, createTileflowLineProgress, createTileflowSessionStarter, createTileflowThemeController, createTileflowTransformRequest, getTileflowSystemColorScheme, loadTileflowStyleFonts, meshTileflowBuildings, mixTileflowRouteInks, placeTileflowStreetLights, playTileflowShot, readTileflowBuildings3D, readTileflowNauticalLights, readTileflowNotices, readTileflowRouteInks, readTileflowSky, readTileflowStreetLights, readTileflowTeamModelName, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, subscribeTileflowSystemColorScheme, tileflowBuildingExtent, tileflowBuildingModelPlacementLimit, tileflowBuildingVertexBytes, tileflowBuildingsMetadataKey, tileflowCanvasContextAttributes, tileflowDefaultRouteInks, tileflowDepthMarkerPlacement, tileflowFairUseNoticeMessage, tileflowGroundBeforeId, tileflowLayerDomainMetadataKey, tileflowLightRhythm, tileflowLightRhythmConventions, tileflowLightStateAt, tileflowLineProgressGradient, tileflowMap3DDeclarations, tileflowMap3DMetadataKeys, tileflowMapDeclares3D, tileflowMaplibreContourVersion, tileflowMaxPitch, tileflowNauticalLightStates, tileflowNauticalLightsMetadataKey, tileflowNoticeLimits, tileflowNoticesMetadataKey, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, tileflowRouteMetadataKey, tileflowShotStateAt, tileflowSkyAtSun, tileflowSkyHazeLayerId, tileflowSkyLayerId, tileflowSkyMetadataKey, tileflowStreetLightBytes, tileflowStreetLightsMetadataKey, tileflowStyleRouteInks, tileflowSunLightMatrix, tileflowTeamModelUrl, validateTileflowBrowserThemeBlendSelection, validateTileflowEmphasis };
|