@tileflow/core 0.1.0-alpha.34 → 0.1.0-alpha.36
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 +24 -23
- package/THIRD_PARTY_NOTICES.md +100 -6
- package/dist/browser.d.ts +758 -388
- package/dist/browser.js +4598 -1169
- package/dist/build.d.ts +9 -5
- package/dist/build.js +2892 -1410
- package/dist/capture.js +1 -0
- package/dist/config-reference.json +3780 -2153
- package/dist/{icon-composition-DqoZWQuz.d.ts → icon-composition-sN3JkXdb.d.ts} +380 -96
- package/dist/index.d.ts +426 -13
- package/dist/index.js +4999 -1841
- package/dist/{manifest-types-hmzy2bBX.d.ts → manifest-types-jrBdBrES.d.ts} +71 -9
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.js +80 -2
- package/dist/native-profile.js +1 -0
- package/dist/native.d.ts +13 -3
- package/dist/native.js +714 -318
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.js +124 -6
- package/dist/worker/buildings-3d-worker.global.js +1 -0
- package/docs/authoring-model.md +12 -3
- package/docs/boundary-areas-and-choropleths.md +217 -0
- package/docs/buildings-3d.md +264 -34
- package/docs/cartographic-defaults.md +142 -0
- package/docs/compiled-style-performance.md +14 -3
- package/docs/data-is-separate-from-design.md +191 -7
- package/docs/hosted-session-authorization.md +2 -4
- package/docs/map-and-terrain-examples.md +10 -3
- package/docs/native-artifact-profile.md +5 -0
- package/docs/native-resource-urls.md +5 -3
- package/docs/street-lights.md +22 -6
- package/docs/sun-and-light.md +42 -2
- package/docs/theme-transitions-and-blends.md +50 -0
- package/docs/themes-and-module-styles.md +66 -0
- package/docs/trees-3d.md +85 -13
- package/package.json +5 -4
package/dist/browser.d.ts
CHANGED
|
@@ -380,357 +380,6 @@ type TileflowMarkerSymbolStyle = TileflowSymbolStyle & {
|
|
|
380
380
|
marker?: TileflowCircleStyle;
|
|
381
381
|
};
|
|
382
382
|
|
|
383
|
-
type TileflowColor = `#${string}`;
|
|
384
|
-
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
385
|
-
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
386
|
-
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
387
|
-
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
388
|
-
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
389
|
-
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
390
|
-
type TileflowRoadExtras = {
|
|
391
|
-
paths?: boolean;
|
|
392
|
-
};
|
|
393
|
-
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
394
|
-
hatch?: TileflowLineHatchStyle;
|
|
395
|
-
};
|
|
396
|
-
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
397
|
-
type TileflowRoadTreatmentLayerStyle = {
|
|
398
|
-
casing?: TileflowRoadTreatmentLineStyle;
|
|
399
|
-
fill?: TileflowRoadTreatmentLineStyle;
|
|
400
|
-
shadow?: TileflowRoadTreatmentLineStyle;
|
|
401
|
-
};
|
|
402
|
-
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
403
|
-
enabled?: boolean;
|
|
404
|
-
widthScale?: TileflowThemeNumberValue;
|
|
405
|
-
};
|
|
406
|
-
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
407
|
-
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
408
|
-
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
409
|
-
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
410
|
-
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
411
|
-
enabled?: boolean;
|
|
412
|
-
};
|
|
413
|
-
type TileflowRoadAreaStyle = {
|
|
414
|
-
pedestrian?: TileflowAreaStyle;
|
|
415
|
-
pier?: TileflowAreaStyle;
|
|
416
|
-
road?: TileflowAreaStyle;
|
|
417
|
-
};
|
|
418
|
-
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
419
|
-
type TileflowRoadRoundaboutStyle = {
|
|
420
|
-
casing?: TileflowCircleStyle;
|
|
421
|
-
fill?: TileflowCircleStyle;
|
|
422
|
-
};
|
|
423
|
-
/**
|
|
424
|
-
* How Core's street lights renderer lights the map's streets at night, from the lamps and lit
|
|
425
|
-
* streets its data holds.
|
|
426
|
-
*/
|
|
427
|
-
type TileflowRoadStreetLightStyle = {
|
|
428
|
-
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
429
|
-
color?: TileflowThemeColorValue;
|
|
430
|
-
/** Whether the map has street lights; defaults to true where the data binds street furniture. */
|
|
431
|
-
enabled?: boolean;
|
|
432
|
-
/**
|
|
433
|
-
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
434
|
-
* pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
|
|
435
|
-
* that map few lamps, which invents light; `none` nowhere.
|
|
436
|
-
*/
|
|
437
|
-
estimate?: 'lit' | 'streets' | 'none';
|
|
438
|
-
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
439
|
-
intensity?: TileflowThemeNumberValue;
|
|
440
|
-
};
|
|
441
|
-
type TileflowRoadSidewalkStyle = {
|
|
442
|
-
outline?: TileflowLineStyle;
|
|
443
|
-
pattern?: TileflowFillStyle;
|
|
444
|
-
surface?: TileflowFillStyle;
|
|
445
|
-
};
|
|
446
|
-
type TileflowRoadsModuleConfig = {
|
|
447
|
-
type: 'roads';
|
|
448
|
-
areas?: TileflowRoadAreaStyle;
|
|
449
|
-
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
450
|
-
crossings?: TileflowRoadCrossingStyle;
|
|
451
|
-
detail?: TileflowRoadDetail;
|
|
452
|
-
extras?: TileflowRoadExtras;
|
|
453
|
-
hierarchy?: TileflowRoadHierarchy;
|
|
454
|
-
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
455
|
-
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
456
|
-
oneWayMarkers?: boolean;
|
|
457
|
-
outline?: TileflowRoadOutline;
|
|
458
|
-
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
459
|
-
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
460
|
-
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
461
|
-
sidewalks?: TileflowRoadSidewalkStyle;
|
|
462
|
-
streetLights?: TileflowRoadStreetLightStyle;
|
|
463
|
-
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
464
|
-
weight?: TileflowRoadWeight;
|
|
465
|
-
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
466
|
-
};
|
|
467
|
-
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
468
|
-
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
469
|
-
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
470
|
-
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
471
|
-
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
472
|
-
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
473
|
-
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
474
|
-
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
475
|
-
type TileflowRoadShieldStyles = {
|
|
476
|
-
default?: TileflowSymbolStyle;
|
|
477
|
-
detail?: TileflowSymbolStyle;
|
|
478
|
-
kinds?: Record<string, {
|
|
479
|
-
image: TileflowThemeImageValue;
|
|
480
|
-
}>;
|
|
481
|
-
overview?: TileflowSymbolStyle;
|
|
482
|
-
textColors?: Record<string, {
|
|
483
|
-
color: TileflowThemeColorValue;
|
|
484
|
-
}>;
|
|
485
|
-
};
|
|
486
|
-
type TileflowLabelStyles = {
|
|
487
|
-
aerodrome?: TileflowSymbolStyle;
|
|
488
|
-
junctions?: TileflowSymbolStyle;
|
|
489
|
-
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
490
|
-
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
491
|
-
shields?: TileflowRoadShieldStyles;
|
|
492
|
-
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
493
|
-
};
|
|
494
|
-
type TileflowLabelsModuleConfig = {
|
|
495
|
-
type: 'labels';
|
|
496
|
-
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
497
|
-
collisionPriority?: TileflowLabelCollisionPriority;
|
|
498
|
-
junctions?: boolean;
|
|
499
|
-
language?: TileflowLabelLanguage;
|
|
500
|
-
places?: TileflowLabelDetail;
|
|
501
|
-
roadClasses?: readonly TileflowRoadClass[];
|
|
502
|
-
roads?: TileflowRoadLabelDetail;
|
|
503
|
-
shields?: TileflowRoadShieldDetail;
|
|
504
|
-
styles?: TileflowLabelStyles;
|
|
505
|
-
water?: TileflowLabelDetail;
|
|
506
|
-
};
|
|
507
|
-
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
508
|
-
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
509
|
-
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
510
|
-
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
511
|
-
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
512
|
-
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'> & {
|
|
513
|
-
/** Optional category-local cap within the module's canonical density tiers. */
|
|
514
|
-
density?: TileflowPoiDensity;
|
|
515
|
-
};
|
|
516
|
-
type TileflowPoiModuleConfig = {
|
|
517
|
-
type: 'poi';
|
|
518
|
-
categories?: readonly TileflowPoiCategory[];
|
|
519
|
-
color?: TileflowPoiColorMode;
|
|
520
|
-
density?: TileflowPoiDensity;
|
|
521
|
-
icons?: boolean;
|
|
522
|
-
labels?: boolean;
|
|
523
|
-
minZoom?: number;
|
|
524
|
-
placement?: {
|
|
525
|
-
coupleIconAndLabel?: boolean;
|
|
526
|
-
iconPadding?: number;
|
|
527
|
-
textPadding?: number;
|
|
528
|
-
};
|
|
529
|
-
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
530
|
-
};
|
|
531
|
-
type MapLibreSprite = string | Array<{
|
|
532
|
-
id: string;
|
|
533
|
-
url: string;
|
|
534
|
-
}>;
|
|
535
|
-
type TileflowProjection = 'globe' | 'mercator';
|
|
536
|
-
type TileflowLight = {
|
|
537
|
-
anchor?: 'map' | 'viewport';
|
|
538
|
-
color?: TileflowColor;
|
|
539
|
-
intensity?: number;
|
|
540
|
-
position?: readonly [number, number, number];
|
|
541
|
-
};
|
|
542
|
-
type MapLibreStyle = {
|
|
543
|
-
sky?: Record<string, unknown>;
|
|
544
|
-
version: 8;
|
|
545
|
-
name: string;
|
|
546
|
-
glyphs?: string;
|
|
547
|
-
light?: TileflowLight;
|
|
548
|
-
projection?: {
|
|
549
|
-
type: TileflowProjection;
|
|
550
|
-
};
|
|
551
|
-
sprite?: MapLibreSprite;
|
|
552
|
-
sources: Record<string, Record<string, unknown>>;
|
|
553
|
-
layers: Array<Record<string, unknown>>;
|
|
554
|
-
terrain?: Record<string, unknown>;
|
|
555
|
-
metadata?: Record<string, unknown>;
|
|
556
|
-
};
|
|
557
|
-
|
|
558
|
-
declare const tileflowSunMetadataKey = "tileflow:sun";
|
|
559
|
-
/** A theme's sun and sky light with every value resolved; see `TileflowThemeSun`. */
|
|
560
|
-
type TileflowSunPreset = Readonly<{
|
|
561
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
562
|
-
azimuth: number;
|
|
563
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
564
|
-
altitude: number;
|
|
565
|
-
/** The direct light's colour. */
|
|
566
|
-
color: string;
|
|
567
|
-
/** The direct light's strength, from 0 to 1. */
|
|
568
|
-
intensity: number;
|
|
569
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
570
|
-
shadowIntensity: number;
|
|
571
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
572
|
-
ambient: Readonly<{
|
|
573
|
-
color: string;
|
|
574
|
-
intensity: number;
|
|
575
|
-
}>;
|
|
576
|
-
}>;
|
|
577
|
-
/** The sun as the map shows it, ready for an application's own layers. */
|
|
578
|
-
type TileflowSun = Readonly<{
|
|
579
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
580
|
-
azimuth: number;
|
|
581
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
582
|
-
altitude: number;
|
|
583
|
-
/** A unit vector towards the sun: x east, y north, z up. */
|
|
584
|
-
direction: readonly [number, number, number];
|
|
585
|
-
/** The direct light's colour, as a CSS colour. */
|
|
586
|
-
color: string;
|
|
587
|
-
/** The direct light's colour as sRGB channels from 0 to 1. */
|
|
588
|
-
rgb: readonly [number, number, number];
|
|
589
|
-
/**
|
|
590
|
-
* The direct light's strength, from 0 to 1. It fades to 0 as the sun sets: a sun below the
|
|
591
|
-
* horizon lights nothing and casts no shadow.
|
|
592
|
-
*/
|
|
593
|
-
intensity: number;
|
|
594
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
595
|
-
shadowIntensity: number;
|
|
596
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
597
|
-
ambient: Readonly<{
|
|
598
|
-
color: string;
|
|
599
|
-
rgb: readonly [number, number, number];
|
|
600
|
-
intensity: number;
|
|
601
|
-
}>;
|
|
602
|
-
/**
|
|
603
|
-
* How bright flat, open ground is under this light, from 0 (dark) to 1: the sky's light plus the
|
|
604
|
-
* sun's at its height, each weighted by its colour's luminance. Use it to switch lamps or windows
|
|
605
|
-
* on as a scene darkens, whatever theme or sun lights it.
|
|
606
|
-
*/
|
|
607
|
-
brightness: number;
|
|
608
|
-
/** Where the direction comes from: the themes, angles, or a date and place. */
|
|
609
|
-
source: 'theme' | 'direction' | 'date';
|
|
610
|
-
}>;
|
|
611
|
-
/** The sun of a theme that leaves a value unset: high in the south-south-west, in white light. */
|
|
612
|
-
declare const tileflowDefaultSunPreset: TileflowSunPreset;
|
|
613
|
-
/**
|
|
614
|
-
* Where the sun stands for an instant and a place ([longitude, latitude] in degrees): its azimuth
|
|
615
|
-
* in degrees clockwise from north and its apparent altitude above the horizon, with atmospheric
|
|
616
|
-
* refraction. It follows NOAA's solar equations, accurate to about a hundredth of a degree for
|
|
617
|
-
* years 1800 to 2200.
|
|
618
|
-
*/
|
|
619
|
-
declare function tileflowSunPosition(date: Date | number, location: readonly [number, number]): Readonly<{
|
|
620
|
-
azimuth: number;
|
|
621
|
-
altitude: number;
|
|
622
|
-
}>;
|
|
623
|
-
/** A unit vector towards a direction in the sky: x east, y north, z up. */
|
|
624
|
-
declare function tileflowSunDirection(azimuth: number, altitude: number): readonly [number, number, number];
|
|
625
|
-
/**
|
|
626
|
-
* The sun as the map shows it: a preset's light from a direction. Direct light fades out over the
|
|
627
|
-
* sun's last degrees above the horizon and is gone below it.
|
|
628
|
-
*/
|
|
629
|
-
declare function resolveTileflowSun(preset: TileflowSunPreset, direction?: Readonly<{
|
|
630
|
-
azimuth: number;
|
|
631
|
-
altitude: number;
|
|
632
|
-
}>, source?: TileflowSun['source']): TileflowSun;
|
|
633
|
-
/**
|
|
634
|
-
* A preset `t` of the way from `from` to `to`: the azimuth turns the short way round, colours mix
|
|
635
|
-
* in OKLab, as theme blends mix paint colours, and numbers linearly.
|
|
636
|
-
*/
|
|
637
|
-
declare function mixTileflowSunPresets(from: TileflowSunPreset, to: TileflowSunPreset, t: number): TileflowSunPreset;
|
|
638
|
-
/** Reads the sun a compiled style publishes, or undefined when its metadata has none. */
|
|
639
|
-
declare function readTileflowSunPreset(metadata: unknown): TileflowSunPreset | undefined;
|
|
640
|
-
/**
|
|
641
|
-
* The sun of a compiled style: the one it publishes, else one read from its light (a style whose
|
|
642
|
-
* theme describes no sun lights its extrusions from `light.position`), else the default.
|
|
643
|
-
*/
|
|
644
|
-
declare function tileflowStyleSunPreset(style: {
|
|
645
|
-
light?: unknown;
|
|
646
|
-
metadata?: unknown;
|
|
647
|
-
} | undefined): TileflowSunPreset;
|
|
648
|
-
|
|
649
|
-
type TileflowThemeColorScheme = 'dark' | 'light';
|
|
650
|
-
|
|
651
|
-
declare const tileflowRouteMetadataKey = "tileflow:route";
|
|
652
|
-
/** The resolved inks of a route, from its outer glow to its bright core. */
|
|
653
|
-
type TileflowRouteInks = Readonly<{
|
|
654
|
-
/** The chosen route's line. */
|
|
655
|
-
line: string;
|
|
656
|
-
/** The edge on each side of the line, which sets it apart from the roads under it. */
|
|
657
|
-
casing: string;
|
|
658
|
-
/** A thin line along the middle of the route. */
|
|
659
|
-
core: string;
|
|
660
|
-
/** A soft halo around the route. */
|
|
661
|
-
glow: string;
|
|
662
|
-
/** Other routes offered beside the chosen one. */
|
|
663
|
-
alternative: string;
|
|
664
|
-
/** Opacity of the glow, from 0 (no glow) to 1. */
|
|
665
|
-
glowOpacity: number;
|
|
666
|
-
/** Opacity of the core, from 0 (no core) to 1. */
|
|
667
|
-
coreOpacity: number;
|
|
668
|
-
}>;
|
|
669
|
-
/** The inks of a theme that sets no route tokens: a blue that reads on either kind of map. */
|
|
670
|
-
declare const tileflowDefaultRouteInks: Readonly<Record<TileflowThemeColorScheme, TileflowRouteInks>>;
|
|
671
|
-
/**
|
|
672
|
-
* Reads the route inks a compiled style publishes, or undefined when its metadata has none (a
|
|
673
|
-
* style compiled before route inks, or not by Tileflow).
|
|
674
|
-
*/
|
|
675
|
-
declare function readTileflowRouteInks(metadata: unknown): TileflowRouteInks | undefined;
|
|
676
|
-
/**
|
|
677
|
-
* The route inks of a compiled style: those it publishes, or the defaults of its colour scheme
|
|
678
|
-
* (from its `tileflow:colorScheme` metadata, else `fallbackScheme`).
|
|
679
|
-
*/
|
|
680
|
-
declare function tileflowStyleRouteInks(style: {
|
|
681
|
-
metadata?: unknown;
|
|
682
|
-
} | undefined, fallbackScheme?: TileflowThemeColorScheme): TileflowRouteInks;
|
|
683
|
-
/**
|
|
684
|
-
* Inks between two themes' inks, `t` of the way from `from` to `to`: colours mix in OKLab, as theme
|
|
685
|
-
* blends mix paint colours, and opacities linearly.
|
|
686
|
-
*/
|
|
687
|
-
declare function mixTileflowRouteInks(from: TileflowRouteInks, to: TileflowRouteInks, t: number): TileflowRouteInks;
|
|
688
|
-
|
|
689
|
-
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
690
|
-
|
|
691
|
-
type TileflowAnalytics = {
|
|
692
|
-
apiUrl?: string;
|
|
693
|
-
endpoint?: string;
|
|
694
|
-
enabled?: boolean;
|
|
695
|
-
mapId?: string;
|
|
696
|
-
metadata?: Record<string, unknown>;
|
|
697
|
-
projectId?: string;
|
|
698
|
-
sdkVersion?: string;
|
|
699
|
-
source?: string;
|
|
700
|
-
styleId?: string;
|
|
701
|
-
surfaceId?: string;
|
|
702
|
-
};
|
|
703
|
-
type TileflowSessionController = {
|
|
704
|
-
readonly sessionId: string;
|
|
705
|
-
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
706
|
-
};
|
|
707
|
-
type TileflowRuntimeStyle = {
|
|
708
|
-
analytics?: TileflowAnalytics;
|
|
709
|
-
colorScheme?: TileflowRuntimeColorScheme;
|
|
710
|
-
/** An explicit empty array means the manifest declares that no web fonts are required. */
|
|
711
|
-
fontFaces?: TileflowStyleFontFace[];
|
|
712
|
-
revision?: string;
|
|
713
|
-
style: MapLibreStyle | string;
|
|
714
|
-
theme?: string;
|
|
715
|
-
};
|
|
716
|
-
type TileflowStyleFontFace = {
|
|
717
|
-
family: string;
|
|
718
|
-
source: string;
|
|
719
|
-
style?: 'italic' | 'normal' | 'oblique';
|
|
720
|
-
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
721
|
-
};
|
|
722
|
-
/**
|
|
723
|
-
* A continuous blend of named themes of one Tileflow map. `position` places the map between
|
|
724
|
-
* neighbouring themes: 0 is the first, 1 the second, and 1.25 a quarter of the way from the second
|
|
725
|
-
* to the third.
|
|
726
|
-
*/
|
|
727
|
-
type TileflowThemeBlendSelection = Readonly<{
|
|
728
|
-
/** From 0 to `themes.length - 1`. */
|
|
729
|
-
position: number;
|
|
730
|
-
/** Two to eight concrete theme names of the map, in blend order. */
|
|
731
|
-
themes: readonly string[];
|
|
732
|
-
}>;
|
|
733
|
-
|
|
734
383
|
type TileflowAddressesModuleOptions = {
|
|
735
384
|
/** Styling for OpenMapTiles point house-number labels. */
|
|
736
385
|
labels?: TileflowSymbolStyle;
|
|
@@ -765,18 +414,59 @@ type TileflowBuildingMode = '3d' | 'flat';
|
|
|
765
414
|
* building colour (its extrusion), else its roofs'.
|
|
766
415
|
*/
|
|
767
416
|
type TileflowBuildingsThreeDimensionalStyle = {
|
|
768
|
-
/**
|
|
417
|
+
/** Use the scene sun (default), or the style's native extrusion light. */
|
|
418
|
+
lighting?: 'style' | 'sun';
|
|
419
|
+
/** Per-building brightness variation, from 0 to 1; defaults to 0 (authored colour). */
|
|
420
|
+
colorVariation?: TileflowThemeNumberValue;
|
|
421
|
+
/** How strongly roof outlines and outer corners catch the light, from 0 (default) to 1. */
|
|
769
422
|
edges?: TileflowThemeNumberValue;
|
|
423
|
+
/** Radius in metres for softened exterior corners and roof lighting, from 0 to 1; defaults to 0.8. */
|
|
424
|
+
edgeRadius?: number;
|
|
770
425
|
/** Their own colour, drawn unlit; without it they take the building's colour, lightened. */
|
|
771
426
|
edgeColor?: TileflowThemeColorValue;
|
|
772
|
-
/** How bright the buildings light the street at night, from 0 (none) to 2; defaults to
|
|
427
|
+
/** How bright the buildings light the street at night, from 0 (none) to 2; defaults to 0. */
|
|
773
428
|
nightLight?: TileflowThemeNumberValue;
|
|
774
429
|
/** Contact shadow at the foot of the walls and in tight corners; defaults to true. */
|
|
775
430
|
occlusion?: boolean;
|
|
776
431
|
/** Shadows from the sun, on the buildings and the flat map; defaults to true. */
|
|
777
432
|
shadows?: boolean;
|
|
778
|
-
/**
|
|
433
|
+
/**
|
|
434
|
+
* Invented night windows, lit by rooms: decoration, not data. With World's `class`, none on sheds,
|
|
435
|
+
* barns, factories and churches, and homes lit apart from offices. Defaults to false.
|
|
436
|
+
*/
|
|
779
437
|
windows?: boolean;
|
|
438
|
+
/**
|
|
439
|
+
* Building models the map places in its city, from the glTF binaries in its `models`
|
|
440
|
+
* directories. Each stands in for the buildings under its footprint.
|
|
441
|
+
*/
|
|
442
|
+
models?: readonly TileflowBuildingModelPlacementConfig[];
|
|
443
|
+
/** The colours of the models' parts; a part without one takes it from the building colour. */
|
|
444
|
+
modelColors?: Partial<Record<TileflowBuildingModelPart, TileflowThemeColorValue>>;
|
|
445
|
+
/**
|
|
446
|
+
* Tileflow's landmarks, such as the Eiffel Tower, drawn as models in place of the buildings
|
|
447
|
+
* under them. On by default with Tileflow World data; `false` switches them off, and `url` names
|
|
448
|
+
* the TileJSON of another landmarks tileset. The map's own `models` come first: a landmark with
|
|
449
|
+
* the same id as one, or whose footprint meets one's, is not drawn.
|
|
450
|
+
*/
|
|
451
|
+
landmarks?: boolean | {
|
|
452
|
+
url: string;
|
|
453
|
+
};
|
|
454
|
+
};
|
|
455
|
+
/** The parts of a building model, as its materials name them. */
|
|
456
|
+
type TileflowBuildingModelPart = 'surface' | 'secondary' | 'glass' | 'accent' | 'roof';
|
|
457
|
+
/** Where a building model stands. */
|
|
458
|
+
type TileflowBuildingModelPlacementConfig = {
|
|
459
|
+
/** The model's id: the name of its `.glb` file in the map's `models` directories. */
|
|
460
|
+
model: string;
|
|
461
|
+
/**
|
|
462
|
+
* The HTTPS address of the model's prepared file when it is served elsewhere, such as a model
|
|
463
|
+
* Tileflow hosts for its own maps; the map then needs no `.glb` of its own for it.
|
|
464
|
+
*/
|
|
465
|
+
url?: string;
|
|
466
|
+
/** Longitude and latitude of the model's origin, where it stands on the ground. */
|
|
467
|
+
at: readonly [number, number];
|
|
468
|
+
/** Degrees clockwise from north that the model's own north (its +y) is turned to; defaults to 0. */
|
|
469
|
+
heading?: number;
|
|
780
470
|
};
|
|
781
471
|
type TileflowBuildingsModuleOptions = {
|
|
782
472
|
businessCorridor?: TileflowAreaStyle;
|
|
@@ -791,8 +481,24 @@ type TileflowBuildingsModuleConfig = TileflowBuildingsModuleOptions & {
|
|
|
791
481
|
|
|
792
482
|
type TileflowLanduseClass = 'cemetery' | 'civic' | 'commercial' | 'education' | 'government' | 'industrial' | 'medical' | 'military' | 'parking' | 'railway' | 'recreation' | 'residential';
|
|
793
483
|
type TileflowLandcoverClass = 'farmland' | 'flowerbed' | 'grass' | 'ice' | 'meadow' | 'protected' | 'recreationGround' | 'rock' | 'sand' | 'scrub' | 'urbanPark' | 'villageGreen' | 'wetland' | 'wood';
|
|
484
|
+
/** The barriers of the data's barrier layer (World's `traffic_control`) the land module draws. */
|
|
485
|
+
type TileflowBarrierClass = 'fence' | 'hedge' | 'wall';
|
|
486
|
+
/**
|
|
487
|
+
* A barrier's line, a shadow line drawn under it (usually offset with `translate`), and the fill of
|
|
488
|
+
* those mapped as areas, such as broad hedges.
|
|
489
|
+
*/
|
|
490
|
+
type TileflowBarrierStyle = {
|
|
491
|
+
area?: TileflowFillStyle;
|
|
492
|
+
shadow?: TileflowLineStyle;
|
|
493
|
+
line?: TileflowLineStyle;
|
|
494
|
+
};
|
|
794
495
|
type TileflowLandModuleOptions = {
|
|
795
496
|
background?: TileflowBackgroundStyle;
|
|
497
|
+
/**
|
|
498
|
+
* Hedges, fences and walls, drawn at the top of the land band with hedges uppermost. A barrier
|
|
499
|
+
* without a style is not drawn, and neither is any when the data has no barrier layer.
|
|
500
|
+
*/
|
|
501
|
+
barriers?: Partial<Record<TileflowBarrierClass, TileflowBarrierStyle>>;
|
|
796
502
|
globalLandcover?: TileflowFillStyle;
|
|
797
503
|
landcover?: Partial<Record<TileflowLandcoverClass, TileflowAreaStyle>>;
|
|
798
504
|
landuse?: Partial<Record<TileflowLanduseClass, TileflowAreaStyle>>;
|
|
@@ -921,6 +627,10 @@ type TileflowTreeFields = Readonly<{
|
|
|
921
627
|
canopyCover: string;
|
|
922
628
|
/** A canopy point's measured canopy height, in metres. */
|
|
923
629
|
canopyHeight: string;
|
|
630
|
+
/** The kind of barrier in the hedge layer: hedges are `hedge`. */
|
|
631
|
+
subclass: string;
|
|
632
|
+
/** A hedge's kind: `hedge_bank` when it stands on an earth bank. */
|
|
633
|
+
hedge: string;
|
|
924
634
|
}>;
|
|
925
635
|
type TileflowTreePlacementOptions = Readonly<{
|
|
926
636
|
/** The tile's address, for regions and for a stable look per tree. */
|
|
@@ -948,6 +658,11 @@ type TileflowTreeLayers = Readonly<{
|
|
|
948
658
|
trees?: TileflowTileLayer;
|
|
949
659
|
/** Decorative canopy points in parks and gardens (World's `canopy`). */
|
|
950
660
|
canopy?: TileflowTileLayer;
|
|
661
|
+
/**
|
|
662
|
+
* World's `traffic_control`: its hedges, lines and areas of `subclass=hedge`, stand as clipped
|
|
663
|
+
* pieces along each line and round each area. Other barriers are left out.
|
|
664
|
+
*/
|
|
665
|
+
hedges?: TileflowTileLayer;
|
|
951
666
|
}>;
|
|
952
667
|
/** Where some trees are in a placement, and how many of them have each rank or a lower one. */
|
|
953
668
|
type TileflowTreeRange = Readonly<{
|
|
@@ -966,7 +681,12 @@ type TileflowTreePlacement = Readonly<{
|
|
|
966
681
|
/** `tileflowTreeBytes` bytes per tree, ordered by form, model, then rank; see the layout below. */
|
|
967
682
|
trees: Uint8Array;
|
|
968
683
|
forms: Readonly<Record<TileflowTreeForm, TileflowTreeFormRange>>;
|
|
969
|
-
/**
|
|
684
|
+
/**
|
|
685
|
+
* `tileflowTreeBytes` bytes per piece of hedge, as a tree's: its middle, its height, its length
|
|
686
|
+
* as the crown, and its turn along the hedge.
|
|
687
|
+
*/
|
|
688
|
+
hedges: Uint8Array;
|
|
689
|
+
/** The tallest tree or hedge, in metres. */
|
|
970
690
|
tallest: number;
|
|
971
691
|
/** Trees from the data's trees and rows, and trees from canopy points. */
|
|
972
692
|
mapped: number;
|
|
@@ -991,19 +711,24 @@ declare function placeTileflowTrees(layers: TileflowTreeLayers, options: Tileflo
|
|
|
991
711
|
declare const tileflowVegetationMetadataKey = "tileflow:vegetation";
|
|
992
712
|
/** How a compiled map's 3D trees look and where their data is, resolved for one theme. */
|
|
993
713
|
type TileflowVegetation3D = Readonly<{
|
|
994
|
-
/** The vector source and its layers with the trees
|
|
714
|
+
/** The vector source and its layers with the trees, the canopy points and the hedges. */
|
|
995
715
|
source: string;
|
|
996
716
|
layers: Readonly<{
|
|
997
717
|
tree: string;
|
|
998
718
|
canopy?: string;
|
|
719
|
+
hedge?: string;
|
|
999
720
|
}>;
|
|
1000
721
|
fields: TileflowTreeFields;
|
|
1001
|
-
/**
|
|
722
|
+
/**
|
|
723
|
+
* Sunlit colours: bark, the leaves of each kind of tree from darkest to lightest, and those of
|
|
724
|
+
* hedges.
|
|
725
|
+
*/
|
|
1002
726
|
colors: Readonly<{
|
|
1003
727
|
bark: string;
|
|
1004
728
|
broadleaf: readonly string[];
|
|
1005
729
|
conifer: readonly string[];
|
|
1006
730
|
palm: readonly string[];
|
|
731
|
+
hedge: readonly string[];
|
|
1007
732
|
}>;
|
|
1008
733
|
heightScale: number;
|
|
1009
734
|
crownScale: number;
|
|
@@ -1026,7 +751,7 @@ type TileflowVegetation3D = Readonly<{
|
|
|
1026
751
|
*/
|
|
1027
752
|
declare function readTileflowVegetation3D(metadata: unknown): TileflowVegetation3D | undefined;
|
|
1028
753
|
|
|
1029
|
-
type TileflowVegetationMode = '3d' | 'flat';
|
|
754
|
+
type TileflowVegetationMode = '3d' | 'flat' | 'auto';
|
|
1030
755
|
type TileflowVegetationThreeDimensionalStyle = {
|
|
1031
756
|
barkColor?: TileflowThemeColorValue;
|
|
1032
757
|
/** Sunlit leaf colours of broadleaf trees, from darkest to lightest; up to four are used. */
|
|
@@ -1035,6 +760,13 @@ type TileflowVegetationThreeDimensionalStyle = {
|
|
|
1035
760
|
coniferColors?: readonly TileflowThemeColorValue[];
|
|
1036
761
|
/** Sunlit frond colours of palms, from darkest to lightest; the broadleaf colours by default. */
|
|
1037
762
|
palmColors?: readonly TileflowThemeColorValue[];
|
|
763
|
+
/**
|
|
764
|
+
* Whether the data's hedges stand as clipped green walls beside the trees, at their height or
|
|
765
|
+
* 1.3 m, a metre higher on an earth bank. Defaults to true where the data has hedges.
|
|
766
|
+
*/
|
|
767
|
+
hedges?: boolean;
|
|
768
|
+
/** Sunlit colours of hedges, from darkest to lightest; the two darkest broadleaf colours by default. */
|
|
769
|
+
hedgeColors?: readonly TileflowThemeColorValue[];
|
|
1038
770
|
crownScale?: TileflowThemeNumberValue;
|
|
1039
771
|
heightScale?: TileflowThemeNumberValue;
|
|
1040
772
|
/**
|
|
@@ -1074,7 +806,12 @@ type TileflowVegetationThreeDimensionalStyle = {
|
|
|
1074
806
|
};
|
|
1075
807
|
type TileflowVegetationModuleOptions = {
|
|
1076
808
|
flat?: TileflowCircleStyle;
|
|
809
|
+
/** `3d` uses models at every pitch; `auto` follows the runtime's explicit 2D/3D view mode. */
|
|
1077
810
|
mode?: TileflowVegetationMode;
|
|
811
|
+
/** Representation when a renderer cannot draw models. Defaults to `flat`. */
|
|
812
|
+
fallback?: 'flat' | 'none';
|
|
813
|
+
/** Initial visibility; a runtime control may override it. Defaults to true. */
|
|
814
|
+
visible?: boolean;
|
|
1078
815
|
threeDimensional?: TileflowVegetationThreeDimensionalStyle;
|
|
1079
816
|
};
|
|
1080
817
|
type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
@@ -1082,12 +819,26 @@ type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
|
1082
819
|
};
|
|
1083
820
|
|
|
1084
821
|
type TileflowWaterwayClass = 'canal' | 'other' | 'river' | 'stream';
|
|
822
|
+
/** Explicit placement for every geometry family in a declared Bathymetry name layer. */
|
|
823
|
+
type TileflowBathymetryNamePlacement = {
|
|
824
|
+
point: 'point';
|
|
825
|
+
line: TileflowSymbolPlacement;
|
|
826
|
+
polygon: TileflowSymbolPlacement;
|
|
827
|
+
};
|
|
828
|
+
type TileflowBathymetryNameStyle = TileflowSymbolStyle & {
|
|
829
|
+
/** Overrides scalar placement for these names; omission preserves scalar placement. */
|
|
830
|
+
placementByGeometry?: TileflowBathymetryNamePlacement;
|
|
831
|
+
};
|
|
1085
832
|
type TileflowWaterModuleOptions = {
|
|
1086
833
|
bathymetry?: TileflowFillStyle;
|
|
1087
|
-
/**
|
|
834
|
+
/** Contour lines when declared by Bathymetry; otherwise approximate polygon band edges. */
|
|
1088
835
|
bathymetryContours?: TileflowLineStyle;
|
|
1089
|
-
/**
|
|
836
|
+
/** Contour-depth or legacy band-floor labels, not measured survey soundings. */
|
|
1090
837
|
bathymetryLabels?: TileflowSymbolStyle;
|
|
838
|
+
/** Names from an explicitly declared seafloor_landform layer. */
|
|
839
|
+
bathymetryLandforms?: TileflowBathymetryNameStyle;
|
|
840
|
+
/** Names from an explicitly declared water_name layer. */
|
|
841
|
+
bathymetryWaterNames?: TileflowBathymetryNameStyle;
|
|
1091
842
|
bodies?: TileflowAreaStyle;
|
|
1092
843
|
intermittent?: {
|
|
1093
844
|
bodies?: TileflowAreaStyle;
|
|
@@ -1095,10 +846,237 @@ type TileflowWaterModuleOptions = {
|
|
|
1095
846
|
};
|
|
1096
847
|
waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
|
|
1097
848
|
};
|
|
1098
|
-
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
1099
|
-
type: 'water';
|
|
849
|
+
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
850
|
+
type: 'water';
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
type TileflowColor = `#${string}`;
|
|
854
|
+
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
855
|
+
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
856
|
+
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
857
|
+
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
858
|
+
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
859
|
+
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
860
|
+
type TileflowRoadExtras = {
|
|
861
|
+
paths?: boolean;
|
|
862
|
+
};
|
|
863
|
+
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
864
|
+
hatch?: TileflowLineHatchStyle;
|
|
865
|
+
};
|
|
866
|
+
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
867
|
+
type TileflowRoadTreatmentLayerStyle = {
|
|
868
|
+
casing?: TileflowRoadTreatmentLineStyle;
|
|
869
|
+
fill?: TileflowRoadTreatmentLineStyle;
|
|
870
|
+
shadow?: TileflowRoadTreatmentLineStyle;
|
|
871
|
+
};
|
|
872
|
+
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
873
|
+
enabled?: boolean;
|
|
874
|
+
widthScale?: TileflowThemeNumberValue;
|
|
875
|
+
};
|
|
876
|
+
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
877
|
+
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
878
|
+
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
879
|
+
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
880
|
+
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
881
|
+
enabled?: boolean;
|
|
882
|
+
};
|
|
883
|
+
type TileflowRoadAreaStyle = {
|
|
884
|
+
pedestrian?: TileflowAreaStyle;
|
|
885
|
+
pier?: TileflowAreaStyle;
|
|
886
|
+
road?: TileflowAreaStyle;
|
|
887
|
+
};
|
|
888
|
+
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
889
|
+
type TileflowRoadRoundaboutStyle = {
|
|
890
|
+
/** Extra casing width in pixels, split equally across both edges; defaults to the road border. */
|
|
891
|
+
borderWidth?: TileflowNumberStyleValue;
|
|
892
|
+
casing?: TileflowCircleStyle;
|
|
893
|
+
/** Road width in pixels when metric radii are absent; defaults to the effective surface fill width. */
|
|
894
|
+
fallbackWidth?: TileflowNumberStyleValue;
|
|
895
|
+
fill?: TileflowCircleStyle;
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* How Core's street lights renderer lights the map's streets at night, from the lamps and lit
|
|
899
|
+
* streets its data holds.
|
|
900
|
+
*/
|
|
901
|
+
type TileflowRoadStreetLightStyle = {
|
|
902
|
+
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
903
|
+
color?: TileflowThemeColorValue;
|
|
904
|
+
/** Whether the map has street lights; defaults to false. Set true to opt in. */
|
|
905
|
+
enabled?: boolean;
|
|
906
|
+
/**
|
|
907
|
+
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
908
|
+
* pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
|
|
909
|
+
* that map few lamps, which invents light; `none` nowhere.
|
|
910
|
+
*/
|
|
911
|
+
estimate?: 'lit' | 'streets' | 'none';
|
|
912
|
+
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
913
|
+
intensity?: TileflowThemeNumberValue;
|
|
914
|
+
};
|
|
915
|
+
type TileflowRoadSidewalkStyle = {
|
|
916
|
+
outline?: TileflowLineStyle;
|
|
917
|
+
pattern?: TileflowFillStyle;
|
|
918
|
+
surface?: TileflowFillStyle;
|
|
919
|
+
};
|
|
920
|
+
type TileflowRoadsModuleConfig = {
|
|
921
|
+
type: 'roads';
|
|
922
|
+
areas?: TileflowRoadAreaStyle;
|
|
923
|
+
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
924
|
+
crossings?: TileflowRoadCrossingStyle;
|
|
925
|
+
detail?: TileflowRoadDetail;
|
|
926
|
+
extras?: TileflowRoadExtras;
|
|
927
|
+
hierarchy?: TileflowRoadHierarchy;
|
|
928
|
+
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
929
|
+
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
930
|
+
oneWayMarkers?: boolean;
|
|
931
|
+
outline?: TileflowRoadOutline;
|
|
932
|
+
/** Draw ramp fills below receiving roads by default; `by-class` keeps their class's order. */
|
|
933
|
+
rampOrder?: 'below-roads' | 'by-class';
|
|
934
|
+
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
935
|
+
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
936
|
+
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
937
|
+
sidewalks?: TileflowRoadSidewalkStyle;
|
|
938
|
+
streetLights?: TileflowRoadStreetLightStyle;
|
|
939
|
+
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
940
|
+
weight?: TileflowRoadWeight;
|
|
941
|
+
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
942
|
+
};
|
|
943
|
+
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
944
|
+
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
945
|
+
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
946
|
+
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
947
|
+
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
948
|
+
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
949
|
+
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
950
|
+
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
951
|
+
type TileflowRoadShieldStyles = {
|
|
952
|
+
default?: TileflowSymbolStyle;
|
|
953
|
+
detail?: TileflowSymbolStyle;
|
|
954
|
+
kinds?: Record<string, {
|
|
955
|
+
image: TileflowThemeImageValue;
|
|
956
|
+
}>;
|
|
957
|
+
overview?: TileflowSymbolStyle;
|
|
958
|
+
textColors?: Record<string, {
|
|
959
|
+
color: TileflowThemeColorValue;
|
|
960
|
+
}>;
|
|
961
|
+
};
|
|
962
|
+
type TileflowLabelStyles = {
|
|
963
|
+
aerodrome?: TileflowSymbolStyle;
|
|
964
|
+
junctions?: TileflowSymbolStyle;
|
|
965
|
+
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
966
|
+
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
967
|
+
shields?: TileflowRoadShieldStyles;
|
|
968
|
+
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
969
|
+
};
|
|
970
|
+
type TileflowLabelsModuleConfig = {
|
|
971
|
+
type: 'labels';
|
|
972
|
+
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
973
|
+
collisionPriority?: TileflowLabelCollisionPriority;
|
|
974
|
+
junctions?: boolean;
|
|
975
|
+
language?: TileflowLabelLanguage;
|
|
976
|
+
places?: TileflowLabelDetail;
|
|
977
|
+
roadClasses?: readonly TileflowRoadClass[];
|
|
978
|
+
/**
|
|
979
|
+
* Where street names draw. `foreground` (the default) keeps them above buildings and
|
|
980
|
+
* vegetation. `ground` places them below buildings, with map-aligned text by default.
|
|
981
|
+
* Ground names retain their road-class collision order, but foreground symbols are offered
|
|
982
|
+
* first by the renderer; `collisionPriority` cannot make ground names outrank those symbols.
|
|
983
|
+
* Shields and junction numbers keep their foreground placement.
|
|
984
|
+
*/
|
|
985
|
+
roadPlacement?: 'ground' | 'foreground';
|
|
986
|
+
roads?: TileflowRoadLabelDetail;
|
|
987
|
+
shields?: TileflowRoadShieldDetail;
|
|
988
|
+
styles?: TileflowLabelStyles;
|
|
989
|
+
water?: TileflowLabelDetail;
|
|
990
|
+
};
|
|
991
|
+
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
992
|
+
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
993
|
+
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
994
|
+
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
995
|
+
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
996
|
+
/**
|
|
997
|
+
* How POI categories are placed against each other. `importance` places every category in one
|
|
998
|
+
* order, by World's ranks. `categories` gives each category its own layer and places the
|
|
999
|
+
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
1000
|
+
*/
|
|
1001
|
+
type TileflowPoiPlacementOrder = 'categories' | 'importance';
|
|
1002
|
+
/**
|
|
1003
|
+
* The appearance of one POI category. With the default `importance` order every category shares
|
|
1004
|
+
* one placement layer, so categories may differ only in properties MapLibre evaluates per feature
|
|
1005
|
+
* (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
|
|
1006
|
+
* overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
|
|
1007
|
+
*/
|
|
1008
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
|
|
1009
|
+
type TileflowPoiModuleConfig = {
|
|
1010
|
+
type: 'poi';
|
|
1011
|
+
categories?: readonly TileflowPoiCategory[];
|
|
1012
|
+
color?: TileflowPoiColorMode;
|
|
1013
|
+
/** One density for the whole module: World's ranks decide what each category shows. */
|
|
1014
|
+
density?: TileflowPoiDensity;
|
|
1015
|
+
icons?: boolean;
|
|
1016
|
+
labels?: boolean;
|
|
1017
|
+
minZoom?: number;
|
|
1018
|
+
placement?: {
|
|
1019
|
+
/**
|
|
1020
|
+
* Places each pictogram with its name as one unit that needs room for both. Defaults to
|
|
1021
|
+
* `false`.
|
|
1022
|
+
*/
|
|
1023
|
+
coupleIconAndLabel?: boolean;
|
|
1024
|
+
iconPadding?: number;
|
|
1025
|
+
/**
|
|
1026
|
+
* World POI `type` values whose pictogram explains them. When pictograms and names are both
|
|
1027
|
+
* drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
|
|
1028
|
+
* Defaults to parking and public toilets.
|
|
1029
|
+
*/
|
|
1030
|
+
iconOnlyTypes?: readonly string[];
|
|
1031
|
+
/** Defaults to `importance`. */
|
|
1032
|
+
order?: TileflowPoiPlacementOrder;
|
|
1033
|
+
/**
|
|
1034
|
+
* With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
|
|
1035
|
+
* before the map's road and place labels, and the others after them. A map that gives street
|
|
1036
|
+
* names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
|
|
1037
|
+
* way. Unset, every POI is placed at the module's own position.
|
|
1038
|
+
*/
|
|
1039
|
+
prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
1040
|
+
textPadding?: number;
|
|
1041
|
+
};
|
|
1042
|
+
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
1043
|
+
};
|
|
1044
|
+
type MapLibreSprite = string | Array<{
|
|
1045
|
+
id: string;
|
|
1046
|
+
url: string;
|
|
1047
|
+
}>;
|
|
1048
|
+
type TileflowProjection = 'globe' | 'mercator';
|
|
1049
|
+
type TileflowLight = {
|
|
1050
|
+
anchor?: 'map' | 'viewport';
|
|
1051
|
+
color?: TileflowColor;
|
|
1052
|
+
intensity?: number;
|
|
1053
|
+
position?: readonly [number, number, number];
|
|
1054
|
+
};
|
|
1055
|
+
type MapLibreStyle = {
|
|
1056
|
+
sky?: Record<string, unknown>;
|
|
1057
|
+
version: 8;
|
|
1058
|
+
name: string;
|
|
1059
|
+
glyphs?: string;
|
|
1060
|
+
light?: TileflowLight;
|
|
1061
|
+
projection?: {
|
|
1062
|
+
type: TileflowProjection;
|
|
1063
|
+
};
|
|
1064
|
+
sprite?: MapLibreSprite;
|
|
1065
|
+
sources: Record<string, Record<string, unknown>>;
|
|
1066
|
+
layers: Array<Record<string, unknown>>;
|
|
1067
|
+
terrain?: Record<string, unknown>;
|
|
1068
|
+
metadata?: Record<string, unknown>;
|
|
1100
1069
|
};
|
|
1101
1070
|
|
|
1071
|
+
/**
|
|
1072
|
+
* Layer metadata naming the semantic module that owns a compiled layer, such as `roads` or `water`.
|
|
1073
|
+
* Runtime features that address a module, such as map emphasis, read it instead of physical layer
|
|
1074
|
+
* IDs. Layers that a theme blend splits or copies keep it.
|
|
1075
|
+
*/
|
|
1076
|
+
declare const tileflowLayerDomainMetadataKey: "tileflow:domain";
|
|
1077
|
+
|
|
1078
|
+
type TileflowLayerDomain = TileflowSemanticModuleName | 'terrain';
|
|
1079
|
+
|
|
1102
1080
|
type TileflowSemanticModules = {
|
|
1103
1081
|
addresses?: TileflowAddressesModuleConfig;
|
|
1104
1082
|
aeroways?: TileflowAerowaysModuleConfig;
|
|
@@ -1116,14 +1094,181 @@ type TileflowSemanticModules = {
|
|
|
1116
1094
|
};
|
|
1117
1095
|
type TileflowSemanticModuleName = keyof TileflowSemanticModules;
|
|
1118
1096
|
|
|
1097
|
+
declare const tileflowSunMetadataKey = "tileflow:sun";
|
|
1098
|
+
/** A theme's sun and sky light with every value resolved; see `TileflowThemeSun`. */
|
|
1099
|
+
type TileflowSunPreset = Readonly<{
|
|
1100
|
+
/** Degrees clockwise from north, from 0 to 360. */
|
|
1101
|
+
azimuth: number;
|
|
1102
|
+
/** Degrees above the horizon, from -90 to 90. */
|
|
1103
|
+
altitude: number;
|
|
1104
|
+
/** The direct light's colour. */
|
|
1105
|
+
color: string;
|
|
1106
|
+
/** The direct light's strength, from 0 to 1. */
|
|
1107
|
+
intensity: number;
|
|
1108
|
+
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
1109
|
+
shadowIntensity: number;
|
|
1110
|
+
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
1111
|
+
ambient: Readonly<{
|
|
1112
|
+
color: string;
|
|
1113
|
+
intensity: number;
|
|
1114
|
+
}>;
|
|
1115
|
+
}>;
|
|
1116
|
+
/** The sun as the map shows it, ready for an application's own layers. */
|
|
1117
|
+
type TileflowSun = Readonly<{
|
|
1118
|
+
/** Degrees clockwise from north, from 0 to 360. */
|
|
1119
|
+
azimuth: number;
|
|
1120
|
+
/** Degrees above the horizon, from -90 to 90. */
|
|
1121
|
+
altitude: number;
|
|
1122
|
+
/** A unit vector towards the sun: x east, y north, z up. */
|
|
1123
|
+
direction: readonly [number, number, number];
|
|
1124
|
+
/** The direct light's colour, as a CSS colour. */
|
|
1125
|
+
color: string;
|
|
1126
|
+
/** The direct light's colour as sRGB channels from 0 to 1. */
|
|
1127
|
+
rgb: readonly [number, number, number];
|
|
1128
|
+
/**
|
|
1129
|
+
* The direct light's strength, from 0 to 1. It fades to 0 as the sun sets: a sun below the
|
|
1130
|
+
* horizon lights nothing and casts no shadow.
|
|
1131
|
+
*/
|
|
1132
|
+
intensity: number;
|
|
1133
|
+
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
1134
|
+
shadowIntensity: number;
|
|
1135
|
+
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
1136
|
+
ambient: Readonly<{
|
|
1137
|
+
color: string;
|
|
1138
|
+
rgb: readonly [number, number, number];
|
|
1139
|
+
intensity: number;
|
|
1140
|
+
}>;
|
|
1141
|
+
/**
|
|
1142
|
+
* How bright flat, open ground is under this light, from 0 (dark) to 1: the sky's light plus the
|
|
1143
|
+
* sun's at its height, each weighted by its colour's luminance. Use it to switch lamps or windows
|
|
1144
|
+
* on as a scene darkens, whatever theme or sun lights it.
|
|
1145
|
+
*/
|
|
1146
|
+
brightness: number;
|
|
1147
|
+
/** Where the direction comes from: the themes, angles, or a date and place. */
|
|
1148
|
+
source: 'theme' | 'direction' | 'date';
|
|
1149
|
+
}>;
|
|
1150
|
+
/** Unset sun values: high in the south-south-west, with soft white daylight and ambient fill. */
|
|
1151
|
+
declare const tileflowDefaultSunPreset: TileflowSunPreset;
|
|
1119
1152
|
/**
|
|
1120
|
-
*
|
|
1121
|
-
*
|
|
1122
|
-
*
|
|
1153
|
+
* Where the sun stands for an instant and a place ([longitude, latitude] in degrees): its azimuth
|
|
1154
|
+
* in degrees clockwise from north and its apparent altitude above the horizon, with atmospheric
|
|
1155
|
+
* refraction. It follows NOAA's solar equations, accurate to about a hundredth of a degree for
|
|
1156
|
+
* years 1800 to 2200.
|
|
1123
1157
|
*/
|
|
1124
|
-
declare
|
|
1158
|
+
declare function tileflowSunPosition(date: Date | number, location: readonly [number, number]): Readonly<{
|
|
1159
|
+
azimuth: number;
|
|
1160
|
+
altitude: number;
|
|
1161
|
+
}>;
|
|
1162
|
+
/** A unit vector towards a direction in the sky: x east, y north, z up. */
|
|
1163
|
+
declare function tileflowSunDirection(azimuth: number, altitude: number): readonly [number, number, number];
|
|
1164
|
+
/**
|
|
1165
|
+
* The sun as the map shows it: a preset's light from a direction. Direct light fades out over the
|
|
1166
|
+
* sun's last degrees above the horizon and is gone below it.
|
|
1167
|
+
*/
|
|
1168
|
+
declare function resolveTileflowSun(preset: TileflowSunPreset, direction?: Readonly<{
|
|
1169
|
+
azimuth: number;
|
|
1170
|
+
altitude: number;
|
|
1171
|
+
}>, source?: TileflowSun['source']): TileflowSun;
|
|
1172
|
+
/**
|
|
1173
|
+
* A preset `t` of the way from `from` to `to`: the azimuth turns the short way round, colours mix
|
|
1174
|
+
* in OKLab, as theme blends mix paint colours, and numbers linearly.
|
|
1175
|
+
*/
|
|
1176
|
+
declare function mixTileflowSunPresets(from: TileflowSunPreset, to: TileflowSunPreset, t: number): TileflowSunPreset;
|
|
1177
|
+
/** Reads the sun a compiled style publishes, or undefined when its metadata has none. */
|
|
1178
|
+
declare function readTileflowSunPreset(metadata: unknown): TileflowSunPreset | undefined;
|
|
1179
|
+
/**
|
|
1180
|
+
* The sun of a compiled style: the one it publishes, else one read from its light (a style whose
|
|
1181
|
+
* theme describes no sun lights its extrusions from `light.position`), else the default.
|
|
1182
|
+
*/
|
|
1183
|
+
declare function tileflowStyleSunPreset(style: {
|
|
1184
|
+
light?: unknown;
|
|
1185
|
+
metadata?: unknown;
|
|
1186
|
+
} | undefined): TileflowSunPreset;
|
|
1125
1187
|
|
|
1126
|
-
type
|
|
1188
|
+
type TileflowThemeColorScheme = 'dark' | 'light';
|
|
1189
|
+
|
|
1190
|
+
declare const tileflowRouteMetadataKey = "tileflow:route";
|
|
1191
|
+
/** The resolved inks of a route, from its outer glow to its bright core. */
|
|
1192
|
+
type TileflowRouteInks = Readonly<{
|
|
1193
|
+
/** The chosen route's line. */
|
|
1194
|
+
line: string;
|
|
1195
|
+
/** The edge on each side of the line, which sets it apart from the roads under it. */
|
|
1196
|
+
casing: string;
|
|
1197
|
+
/** A thin line along the middle of the route. */
|
|
1198
|
+
core: string;
|
|
1199
|
+
/** A soft halo around the route. */
|
|
1200
|
+
glow: string;
|
|
1201
|
+
/** Other routes offered beside the chosen one. */
|
|
1202
|
+
alternative: string;
|
|
1203
|
+
/** Opacity of the glow, from 0 (no glow) to 1. */
|
|
1204
|
+
glowOpacity: number;
|
|
1205
|
+
/** Opacity of the core, from 0 (no core) to 1. */
|
|
1206
|
+
coreOpacity: number;
|
|
1207
|
+
}>;
|
|
1208
|
+
/** The inks of a theme that sets no route tokens: a blue that reads on either kind of map. */
|
|
1209
|
+
declare const tileflowDefaultRouteInks: Readonly<Record<TileflowThemeColorScheme, TileflowRouteInks>>;
|
|
1210
|
+
/**
|
|
1211
|
+
* Reads the route inks a compiled style publishes, or undefined when its metadata has none (a
|
|
1212
|
+
* style compiled before route inks, or not by Tileflow).
|
|
1213
|
+
*/
|
|
1214
|
+
declare function readTileflowRouteInks(metadata: unknown): TileflowRouteInks | undefined;
|
|
1215
|
+
/**
|
|
1216
|
+
* The route inks of a compiled style: those it publishes, or the defaults of its colour scheme
|
|
1217
|
+
* (from its `tileflow:colorScheme` metadata, else `fallbackScheme`).
|
|
1218
|
+
*/
|
|
1219
|
+
declare function tileflowStyleRouteInks(style: {
|
|
1220
|
+
metadata?: unknown;
|
|
1221
|
+
} | undefined, fallbackScheme?: TileflowThemeColorScheme): TileflowRouteInks;
|
|
1222
|
+
/**
|
|
1223
|
+
* Inks between two themes' inks, `t` of the way from `from` to `to`: colours mix in OKLab, as theme
|
|
1224
|
+
* blends mix paint colours, and opacities linearly.
|
|
1225
|
+
*/
|
|
1226
|
+
declare function mixTileflowRouteInks(from: TileflowRouteInks, to: TileflowRouteInks, t: number): TileflowRouteInks;
|
|
1227
|
+
|
|
1228
|
+
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
1229
|
+
|
|
1230
|
+
type TileflowAnalytics = {
|
|
1231
|
+
apiUrl?: string;
|
|
1232
|
+
endpoint?: string;
|
|
1233
|
+
enabled?: boolean;
|
|
1234
|
+
mapId?: string;
|
|
1235
|
+
metadata?: Record<string, unknown>;
|
|
1236
|
+
projectId?: string;
|
|
1237
|
+
sdkVersion?: string;
|
|
1238
|
+
source?: string;
|
|
1239
|
+
styleId?: string;
|
|
1240
|
+
surfaceId?: string;
|
|
1241
|
+
};
|
|
1242
|
+
type TileflowSessionController = {
|
|
1243
|
+
readonly sessionId: string;
|
|
1244
|
+
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
1245
|
+
};
|
|
1246
|
+
type TileflowRuntimeStyle = {
|
|
1247
|
+
analytics?: TileflowAnalytics;
|
|
1248
|
+
colorScheme?: TileflowRuntimeColorScheme;
|
|
1249
|
+
/** An explicit empty array means the manifest declares that no web fonts are required. */
|
|
1250
|
+
fontFaces?: TileflowStyleFontFace[];
|
|
1251
|
+
revision?: string;
|
|
1252
|
+
style: MapLibreStyle | string;
|
|
1253
|
+
theme?: string;
|
|
1254
|
+
};
|
|
1255
|
+
type TileflowStyleFontFace = {
|
|
1256
|
+
family: string;
|
|
1257
|
+
source: string;
|
|
1258
|
+
style?: 'italic' | 'normal' | 'oblique';
|
|
1259
|
+
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
1260
|
+
};
|
|
1261
|
+
/**
|
|
1262
|
+
* A continuous blend of named themes of one Tileflow map. `position` places the map between
|
|
1263
|
+
* neighbouring themes: 0 is the first, 1 the second, and 1.25 a quarter of the way from the second
|
|
1264
|
+
* to the third.
|
|
1265
|
+
*/
|
|
1266
|
+
type TileflowThemeBlendSelection = Readonly<{
|
|
1267
|
+
/** From 0 to `themes.length - 1`. */
|
|
1268
|
+
position: number;
|
|
1269
|
+
/** Two to eight concrete theme names of the map, in blend order. */
|
|
1270
|
+
themes: readonly string[];
|
|
1271
|
+
}>;
|
|
1127
1272
|
|
|
1128
1273
|
/**
|
|
1129
1274
|
* Map emphasis lets an application's own content read first: chosen modules of the map recede
|
|
@@ -1209,6 +1354,79 @@ type TileflowAtmosphereMap = {
|
|
|
1209
1354
|
*/
|
|
1210
1355
|
declare function attachTileflowAtmosphere(map: TileflowAtmosphereMap): () => void;
|
|
1211
1356
|
|
|
1357
|
+
/**
|
|
1358
|
+
* Boundaries families. Each one has its own license, attribution, TileJSON path and style source
|
|
1359
|
+
* ID; families are never merged.
|
|
1360
|
+
*/
|
|
1361
|
+
declare const tileflowBoundaryFamilies: Readonly<{
|
|
1362
|
+
boundaries: Readonly<{
|
|
1363
|
+
attribution: "© OpenStreetMap contributors";
|
|
1364
|
+
license: "ODbL-1.0";
|
|
1365
|
+
path: "/tiles/boundaries/tiles.json";
|
|
1366
|
+
sourceId: "tileflow-boundaries";
|
|
1367
|
+
}>;
|
|
1368
|
+
}>;
|
|
1369
|
+
type TileflowBoundaryFamily = keyof typeof tileflowBoundaryFamilies;
|
|
1370
|
+
|
|
1371
|
+
/** A value a choropleth can colour: a number for scales, a string for categories. */
|
|
1372
|
+
type TileflowBoundaryValue = number | string;
|
|
1373
|
+
/** One row of an application's data, keyed by a registry ID or an official code. */
|
|
1374
|
+
type TileflowBoundaryRow = Readonly<{
|
|
1375
|
+
key: number | string;
|
|
1376
|
+
/** `null` leaves the area without a value. */
|
|
1377
|
+
value: TileflowBoundaryValue | null;
|
|
1378
|
+
}>;
|
|
1379
|
+
/** Keys present on every `boundary_area` polygon, usable without the lookup table. */
|
|
1380
|
+
type TileflowBoundaryFeatureKey = 'id' | 'iso_3166_1' | 'ref';
|
|
1381
|
+
/** Rows joined to areas by one polygon key. */
|
|
1382
|
+
type TileflowBoundaryValues = Readonly<{
|
|
1383
|
+
joinBy: TileflowBoundaryFeatureKey;
|
|
1384
|
+
rows: readonly TileflowBoundaryRow[];
|
|
1385
|
+
}>;
|
|
1386
|
+
|
|
1387
|
+
type FeatureTarget = {
|
|
1388
|
+
id?: number | string;
|
|
1389
|
+
source: string;
|
|
1390
|
+
sourceLayer?: string;
|
|
1391
|
+
};
|
|
1392
|
+
/** The part of a MapLibre map the controller uses. */
|
|
1393
|
+
type TileflowFeatureStateMap = {
|
|
1394
|
+
getSource(id: string): unknown;
|
|
1395
|
+
getStyle?(): {
|
|
1396
|
+
sources?: Record<string, unknown>;
|
|
1397
|
+
} | undefined;
|
|
1398
|
+
off(type: 'styledata', listener: () => void): unknown;
|
|
1399
|
+
on(type: 'styledata', listener: () => void): unknown;
|
|
1400
|
+
removeFeatureState(target: FeatureTarget, key?: string): void;
|
|
1401
|
+
setFeatureState(target: FeatureTarget & {
|
|
1402
|
+
id: number | string;
|
|
1403
|
+
}, state: Record<string, unknown>): void;
|
|
1404
|
+
};
|
|
1405
|
+
type CreateBoundaryFeatureStateOptions = Readonly<{
|
|
1406
|
+
/** Defaults to `boundaries`. */
|
|
1407
|
+
family?: TileflowBoundaryFamily;
|
|
1408
|
+
/** Also set the values on `boundary_label` points, for labels styled by value. */
|
|
1409
|
+
labels?: boolean;
|
|
1410
|
+
/** Feature-state key; it must match the choropleth's `state`. Defaults to `value`. */
|
|
1411
|
+
state?: string;
|
|
1412
|
+
}>;
|
|
1413
|
+
type TileflowBoundaryFeatureState = Readonly<{
|
|
1414
|
+
/** Remove every value this controller set. */
|
|
1415
|
+
clear: () => void;
|
|
1416
|
+
/** Remove the values and stop following style reloads. */
|
|
1417
|
+
dispose: () => void;
|
|
1418
|
+
/**
|
|
1419
|
+
* Replace the values. Rows must be keyed by the source's feature ID: `id` by default, or `ref`
|
|
1420
|
+
* when the map declares `promoteId: 'ref'`. Rows with a `null` value are removed.
|
|
1421
|
+
*/
|
|
1422
|
+
set: (values: TileflowBoundaryValues) => void;
|
|
1423
|
+
}>;
|
|
1424
|
+
/**
|
|
1425
|
+
* Keep Boundaries feature-state in sync with application rows. Values survive a style reload: the
|
|
1426
|
+
* controller sets them again once the source is back.
|
|
1427
|
+
*/
|
|
1428
|
+
declare function createBoundaryFeatureState(map: TileflowFeatureStateMap, options?: CreateBoundaryFeatureStateOptions): TileflowBoundaryFeatureState;
|
|
1429
|
+
|
|
1212
1430
|
/** The drawn stretch of a line and its highlights, as shares of the line's length from its start. */
|
|
1213
1431
|
type TileflowLineProgressState = Readonly<{
|
|
1214
1432
|
/** Where the drawn stretch starts, from 0 (the default) to 1. */
|
|
@@ -1310,6 +1528,21 @@ type TileflowLineProgressController = {
|
|
|
1310
1528
|
*/
|
|
1311
1529
|
declare function createTileflowLineProgress(map: TileflowLineProgressMap, options: TileflowLineProgressOptions): TileflowLineProgressController;
|
|
1312
1530
|
|
|
1531
|
+
/** Bounded, read-only mesh snapshot for developer tooling. Positions are x east, y north, z up. */
|
|
1532
|
+
type TileflowModelInspection = Readonly<{
|
|
1533
|
+
id: string;
|
|
1534
|
+
module: string;
|
|
1535
|
+
format: string;
|
|
1536
|
+
vertices: number;
|
|
1537
|
+
triangles: number;
|
|
1538
|
+
bytes: number;
|
|
1539
|
+
lods: number;
|
|
1540
|
+
instances?: number;
|
|
1541
|
+
positions: number[];
|
|
1542
|
+
indices: number[];
|
|
1543
|
+
colors?: string[];
|
|
1544
|
+
}>;
|
|
1545
|
+
|
|
1313
1546
|
type TileflowTileAddress = Readonly<{
|
|
1314
1547
|
z: number;
|
|
1315
1548
|
x: number;
|
|
@@ -1320,7 +1553,11 @@ type TileflowTile = TileflowTileAddress & Readonly<{
|
|
|
1320
1553
|
layers: Readonly<Record<string, TileflowTileLayer>>;
|
|
1321
1554
|
}>;
|
|
1322
1555
|
/** Rewrites a tile request as a MapLibre map's `transformRequest` does. */
|
|
1323
|
-
type TileflowTileRequestTransform = (url: string, resourceType: 'Tile') => Readonly<{
|
|
1556
|
+
type TileflowTileRequestTransform = (url: string, resourceType: 'Tile') => Promise<Readonly<{
|
|
1557
|
+
url: string;
|
|
1558
|
+
headers?: Readonly<Record<string, string>>;
|
|
1559
|
+
credentials?: RequestCredentials;
|
|
1560
|
+
}> | undefined> | Readonly<{
|
|
1324
1561
|
url: string;
|
|
1325
1562
|
headers?: Readonly<Record<string, string>>;
|
|
1326
1563
|
credentials?: RequestCredentials;
|
|
@@ -1388,16 +1625,26 @@ declare function readTileflowMapTileSource(map: TileflowTileSourceMap, sourceId:
|
|
|
1388
1625
|
maxzoom: number;
|
|
1389
1626
|
} | undefined;
|
|
1390
1627
|
|
|
1628
|
+
type ShadowPoint = readonly number[];
|
|
1629
|
+
type ShadowBox = Readonly<{
|
|
1630
|
+
min: ShadowPoint;
|
|
1631
|
+
max: ShadowPoint;
|
|
1632
|
+
}>;
|
|
1633
|
+
type ShadowView = Readonly<{
|
|
1634
|
+
/** Visible receiver points, in the caster box's metre frame. All casters still draw. */
|
|
1635
|
+
receivers?: readonly ShadowPoint[];
|
|
1636
|
+
/** Snap to world-aligned texels; omit for an unsnapped mathematical projection. */
|
|
1637
|
+
resolution?: number;
|
|
1638
|
+
origin?: ShadowPoint;
|
|
1639
|
+
/** Metres per fixed world unit; keeps texel quantization independent of latitude scale. */
|
|
1640
|
+
gridScale?: number;
|
|
1641
|
+
}>;
|
|
1391
1642
|
/**
|
|
1392
|
-
* The sun's view
|
|
1393
|
-
*
|
|
1394
|
-
*
|
|
1395
|
-
* so shadows hold still while the camera moves.
|
|
1643
|
+
* The sun's orthographic view, in metres, with room for each caster's shadow to reach the ground.
|
|
1644
|
+
* Optional receivers concentrate XY resolution without dropping offscreen casters along a ray;
|
|
1645
|
+
* quantized extents and a world-anchored texel grid keep stationary shadows stable during pans.
|
|
1396
1646
|
*/
|
|
1397
|
-
declare function tileflowSunLightMatrix(direction: readonly number[], box:
|
|
1398
|
-
min: readonly number[];
|
|
1399
|
-
max: readonly number[];
|
|
1400
|
-
}>): {
|
|
1647
|
+
declare function tileflowSunLightMatrix(direction: readonly number[], box: ShadowBox, view?: ShadowView): {
|
|
1401
1648
|
matrix: Float32Array;
|
|
1402
1649
|
depth: number;
|
|
1403
1650
|
extent: number;
|
|
@@ -1411,6 +1658,7 @@ type TileflowBuildings3DMap = {
|
|
|
1411
1658
|
lng: number;
|
|
1412
1659
|
};
|
|
1413
1660
|
getBearing(): number;
|
|
1661
|
+
getLight?(): unknown;
|
|
1414
1662
|
getLayer(id: string): unknown;
|
|
1415
1663
|
getPaintProperty(layer: string, name: string): unknown;
|
|
1416
1664
|
getPitch(): number;
|
|
@@ -1435,7 +1683,7 @@ type TileflowBuildings3DOptions = Readonly<{
|
|
|
1435
1683
|
map: TileflowBuildings3DMap;
|
|
1436
1684
|
/** The theme controller, for the sun and the buildings' design in every theme. */
|
|
1437
1685
|
controller?: TileflowBuildings3DThemes;
|
|
1438
|
-
/** The zoom
|
|
1686
|
+
/** The zoom where buildings start fading in, reaching full opacity 0.25 zoom later. Defaults to 15. */
|
|
1439
1687
|
minzoom?: number;
|
|
1440
1688
|
/** The most tiles raised round the camera, from 1 to 64; defaults to 25. */
|
|
1441
1689
|
maxTiles?: number;
|
|
@@ -1447,33 +1695,38 @@ type TileflowBuildings3DOptions = Readonly<{
|
|
|
1447
1695
|
type TileflowBuildings3DChange = Readonly<{
|
|
1448
1696
|
transition?: Readonly<{
|
|
1449
1697
|
duration?: number;
|
|
1698
|
+
mode?: 'grow' | 'fade';
|
|
1450
1699
|
}>;
|
|
1451
1700
|
}>;
|
|
1452
1701
|
type TileflowBuildings3D = {
|
|
1453
|
-
/**
|
|
1702
|
+
/** Read-only, bounded snapshots of resident prepared model meshes. */
|
|
1703
|
+
inspectModels(): TileflowModelInspection[];
|
|
1704
|
+
/** Shows buildings immediately; pass a transition duration to animate their rise. */
|
|
1454
1705
|
show(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1455
|
-
/**
|
|
1706
|
+
/** Hides buildings immediately; pass a transition duration to animate their descent. */
|
|
1456
1707
|
hide(options?: TileflowBuildings3DChange): Promise<void>;
|
|
1457
|
-
/**
|
|
1708
|
+
/** Sets the height scale, from 0 (flat) to 1; animation requires a transition duration. */
|
|
1458
1709
|
grow(scale: number, options?: TileflowBuildings3DChange): Promise<void>;
|
|
1459
1710
|
/** The height scale shown now. */
|
|
1460
1711
|
readonly scale: number;
|
|
1461
1712
|
/**
|
|
1462
1713
|
* Whether the map's style describes its 3D buildings (the buildings module's
|
|
1463
|
-
* `threeDimensional`), tiles raised, buildings and vertices, for
|
|
1714
|
+
* `threeDimensional`), tiles raised, buildings and vertices, and the placed models standing, for
|
|
1715
|
+
* diagnostics.
|
|
1464
1716
|
*/
|
|
1465
1717
|
readonly stats: Readonly<{
|
|
1466
1718
|
declared: boolean;
|
|
1467
1719
|
tiles: number;
|
|
1468
1720
|
buildings: number;
|
|
1469
1721
|
vertices: number;
|
|
1722
|
+
models: number;
|
|
1470
1723
|
}>;
|
|
1471
1724
|
/** Takes the layer off the map and lets go of its buffers. */
|
|
1472
1725
|
dispose(): void;
|
|
1473
1726
|
};
|
|
1474
1727
|
declare const tileflowBuildings3DLayerId = "tileflow-buildings-3d";
|
|
1475
1728
|
/**
|
|
1476
|
-
* Creates the renderer
|
|
1729
|
+
* Creates the renderer, showing buildings automatically above zoom 15 unless hidden. It reads the source's
|
|
1477
1730
|
* z15 tiles round the camera, the zoom at which World's buildings carry their heights.
|
|
1478
1731
|
*/
|
|
1479
1732
|
declare function createTileflowBuildings3D(options: TileflowBuildings3DOptions): TileflowBuildings3D;
|
|
@@ -1487,15 +1740,34 @@ type TileflowBuildingMeshOptions = Readonly<{
|
|
|
1487
1740
|
tileMetres: number;
|
|
1488
1741
|
/** Height used where a building has none, in metres; defaults to 5, World's own fallback. */
|
|
1489
1742
|
defaultHeight?: number;
|
|
1743
|
+
/** Exterior corner radius in metres, up to 1; 0 leaves the footprint unchanged. */
|
|
1744
|
+
edgeRadius?: number;
|
|
1745
|
+
/** Maximum turn per rounded segment; defaults to 30 degrees for close views. */
|
|
1746
|
+
cornerAngle?: number;
|
|
1490
1747
|
/**
|
|
1491
1748
|
* The tile's places (World's `poi` layer), for the night use of buildings when the tile's
|
|
1492
1749
|
* buildings do not carry World's `night_use`: a place inside a building, or on its facade, gives
|
|
1493
1750
|
* the building its use.
|
|
1494
1751
|
*/
|
|
1495
1752
|
places?: TileflowTileLayer;
|
|
1753
|
+
/**
|
|
1754
|
+
* Footprints of the building models standing here, as rings of tile units (0 to 8192): a
|
|
1755
|
+
* building whose centre falls inside one, or that reaches more than half a metre into one, is not
|
|
1756
|
+
* raised, since the model stands in for it.
|
|
1757
|
+
*/
|
|
1758
|
+
masks?: readonly (readonly number[])[];
|
|
1496
1759
|
}>;
|
|
1760
|
+
type BuildingMeshGroup = {
|
|
1761
|
+
/** Conservative tile-space x/y bounds and maximum height in metres. */
|
|
1762
|
+
bounds: [number, number, number, number, number];
|
|
1763
|
+
roofsFrom: number;
|
|
1764
|
+
roofsCount: number;
|
|
1765
|
+
wallsFrom: number;
|
|
1766
|
+
wallsCount: number;
|
|
1767
|
+
};
|
|
1497
1768
|
/** One tile's buildings, ready to upload. */
|
|
1498
1769
|
type TileflowBuildingMesh = Readonly<{
|
|
1770
|
+
groups?: readonly BuildingMeshGroup[];
|
|
1499
1771
|
vertices: Uint8Array;
|
|
1500
1772
|
indices: Uint32Array;
|
|
1501
1773
|
/** The first wall index: roofs come before it, walls from it. */
|
|
@@ -1507,12 +1779,13 @@ type TileflowBuildingMesh = Readonly<{
|
|
|
1507
1779
|
}>;
|
|
1508
1780
|
/**
|
|
1509
1781
|
* Meshes the buildings of one decoded tile layer, or returns undefined when it has none. It reads
|
|
1510
|
-
* World's `render_height`, `render_min_height`, `hide_3d`, `building_tone` and `night_use`.
|
|
1782
|
+
* World's `render_height`, `render_min_height`, `hide_3d`, `building_tone`, `class` and `night_use`.
|
|
1783
|
+
* Vertex layout:
|
|
1511
1784
|
* 0 position in the tile, 0 to 8192 (uint16 ×2); 4 base and top in decimetres (uint16 ×2); 8 the
|
|
1512
1785
|
* wall's outward normal (int8 ×2, normalised); 10 raised to the top, part of a wall (uint8 ×2);
|
|
1513
1786
|
* 12 decimetres along the wall (uint16); 14 a per-building jitter and seed (uint8 ×2, normalised);
|
|
1514
|
-
* 16 the building's centre in the tile (uint16 ×2); 20 tone
|
|
1515
|
-
* entertainment, nightlife); 22 the wall's
|
|
1787
|
+
* 16 the building's centre in the tile (uint16 ×2); 20 tone plus four times its class group, and
|
|
1788
|
+
* night use (uint8 ×2: none, dining, entertainment, nightlife); 22 the wall's
|
|
1516
1789
|
* tight corners, bit 0 at its start and bit 1 at its end, and bit 2 when it faces a courtyard, and
|
|
1517
1790
|
* its length in metres up to 255
|
|
1518
1791
|
* (uint8 ×2); 24 the building's feature index (uint16); 26 on a roof, the vertex's corner of its
|
|
@@ -1546,6 +1819,11 @@ type TileflowStreetLightsMap = {
|
|
|
1546
1819
|
};
|
|
1547
1820
|
type TileflowStreetLightsOptions = Readonly<{
|
|
1548
1821
|
map: TileflowStreetLightsMap;
|
|
1822
|
+
/**
|
|
1823
|
+
* By default, only a map that enables roads.streetLights supplies lights. Set true to opt in
|
|
1824
|
+
* with the fallback design when metadata is absent, or false to keep every theme's lights off.
|
|
1825
|
+
*/
|
|
1826
|
+
enabled?: boolean;
|
|
1549
1827
|
/**
|
|
1550
1828
|
* The theme controller, whose sun switches the lights on and off and whose themes hold the map's
|
|
1551
1829
|
* street lights (the roads module's `streetLights`).
|
|
@@ -1590,6 +1868,16 @@ declare const tileflowStreetLightsLayerId = "tileflow-street-lights";
|
|
|
1590
1868
|
*/
|
|
1591
1869
|
declare function createTileflowStreetLights(options: TileflowStreetLightsOptions): TileflowStreetLights;
|
|
1592
1870
|
|
|
1871
|
+
/** The parts of a model, each coloured by the theme: the model's materials name them. */
|
|
1872
|
+
declare const tileflowModelParts: Readonly<{
|
|
1873
|
+
surface: 0;
|
|
1874
|
+
secondary: 1;
|
|
1875
|
+
glass: 2;
|
|
1876
|
+
accent: 3;
|
|
1877
|
+
roof: 4;
|
|
1878
|
+
}>;
|
|
1879
|
+
type TileflowModelPart = keyof typeof tileflowModelParts;
|
|
1880
|
+
|
|
1593
1881
|
/** The style metadata key under which a compiled map describes its 3D buildings. */
|
|
1594
1882
|
declare const tileflowBuildingsMetadataKey = "tileflow:buildings";
|
|
1595
1883
|
/** A compiled map's 3D buildings, resolved for one theme. */
|
|
@@ -1607,6 +1895,14 @@ type TileflowBuildings3DDesign = Readonly<{
|
|
|
1607
1895
|
color: string | readonly unknown[];
|
|
1608
1896
|
/** How strongly roof outlines and outer corners catch the light, from 0 to 1. */
|
|
1609
1897
|
edges: number;
|
|
1898
|
+
/** Exterior corner radius and roof lighting transition, in metres; 0 keeps sharp edges. */
|
|
1899
|
+
edgeRadius?: number;
|
|
1900
|
+
/** Scene sun lighting by default; `style` uses the native extrusion light. */
|
|
1901
|
+
lighting: 'style' | 'sun';
|
|
1902
|
+
/** Per-building brightness variation, from 0 to 1; 0 preserves the authored colour. */
|
|
1903
|
+
colorVariation: number;
|
|
1904
|
+
/** The authored extrusion's vertical wall gradient. */
|
|
1905
|
+
verticalGradient: boolean;
|
|
1610
1906
|
/** Their own colour, drawn unlit; without it they take the building's colour, lightened. */
|
|
1611
1907
|
edgeColor?: string;
|
|
1612
1908
|
/** How bright the buildings light the street at night, from 0 to 2. */
|
|
@@ -1616,12 +1912,36 @@ type TileflowBuildings3DDesign = Readonly<{
|
|
|
1616
1912
|
/** Shadows from the sun, and contact shadow at the foot of the walls. */
|
|
1617
1913
|
shadows: boolean;
|
|
1618
1914
|
occlusion: boolean;
|
|
1915
|
+
/** Building models the map places in its city, each replacing the buildings under it. */
|
|
1916
|
+
models?: readonly TileflowBuildingModelPlacement[];
|
|
1917
|
+
/** The colours of the models' parts; a part without one takes it from the building colour. */
|
|
1918
|
+
modelColors?: Readonly<Partial<Record<TileflowModelPart, string>>>;
|
|
1919
|
+
/**
|
|
1920
|
+
* Tileflow's landmarks, drawn as models in place of the buildings under them: the TileJSON of
|
|
1921
|
+
* their tileset. Without it, the map shows none.
|
|
1922
|
+
*/
|
|
1923
|
+
landmarks?: Readonly<{
|
|
1924
|
+
url: string;
|
|
1925
|
+
}>;
|
|
1926
|
+
}>;
|
|
1927
|
+
/** A building model standing in the map's city. */
|
|
1928
|
+
type TileflowBuildingModelPlacement = Readonly<{
|
|
1929
|
+
/** The model's id, its file's name in the map's `models` directories. */
|
|
1930
|
+
model: string;
|
|
1931
|
+
/** Where the prepared model file is served, absolute or relative to the page. */
|
|
1932
|
+
url: string;
|
|
1933
|
+
/** Longitude and latitude of the model's origin, where it stands on the ground. */
|
|
1934
|
+
at: readonly [number, number];
|
|
1935
|
+
/** Degrees clockwise from north that the model's own north is turned to. */
|
|
1936
|
+
heading: number;
|
|
1619
1937
|
}>;
|
|
1620
1938
|
/**
|
|
1621
1939
|
* Reads the 3D buildings a compiled style describes, or undefined when its metadata has none or a
|
|
1622
1940
|
* version or shape this Core does not know.
|
|
1623
1941
|
*/
|
|
1624
1942
|
declare function readTileflowBuildings3D(metadata: unknown): TileflowBuildings3DDesign | undefined;
|
|
1943
|
+
/** The most models one map places. */
|
|
1944
|
+
declare const tileflowBuildingModelPlacementLimit = 256;
|
|
1625
1945
|
|
|
1626
1946
|
/** The MapLibre GL JS map capabilities the trees use. */
|
|
1627
1947
|
type TileflowTrees3DMap = {
|
|
@@ -1658,7 +1978,7 @@ type TileflowTrees3DOptions = Readonly<{
|
|
|
1658
1978
|
controller?: TileflowTrees3DThemes;
|
|
1659
1979
|
/** The vector source with the canopy points, when not the map's World source. */
|
|
1660
1980
|
canopySource?: string;
|
|
1661
|
-
/** The zoom from which trees stand; they
|
|
1981
|
+
/** The zoom from which trees stand; they reach full opacity 0.25 zoom later. Defaults to 15. */
|
|
1662
1982
|
minzoom?: number;
|
|
1663
1983
|
/** The most tiles of trees round the camera, from 1 to 64; defaults to 25. */
|
|
1664
1984
|
maxTiles?: number;
|
|
@@ -1666,6 +1986,8 @@ type TileflowTrees3DOptions = Readonly<{
|
|
|
1666
1986
|
beforeId?: string;
|
|
1667
1987
|
/** The map's request rules, for the tiles the layer reads. */
|
|
1668
1988
|
transformRequest?: TileflowTileRequestTransform;
|
|
1989
|
+
/** Let a vegetation controller own flat-layer visibility. Defaults to true. */
|
|
1990
|
+
manageFlatLayers?: boolean;
|
|
1669
1991
|
}>;
|
|
1670
1992
|
type TileflowTrees3DChange = Readonly<{
|
|
1671
1993
|
transition?: Readonly<{
|
|
@@ -1673,6 +1995,8 @@ type TileflowTrees3DChange = Readonly<{
|
|
|
1673
1995
|
}>;
|
|
1674
1996
|
}>;
|
|
1675
1997
|
type TileflowTrees3D = {
|
|
1998
|
+
/** Read-only snapshots of the meshes used by the active vegetation palette. */
|
|
1999
|
+
inspectModels(): TileflowModelInspection[];
|
|
1676
2000
|
/** Grows the trees out of the ground; resolves once they stand. */
|
|
1677
2001
|
show(options?: TileflowTrees3DChange): Promise<void>;
|
|
1678
2002
|
/** Sinks the trees back into the ground; resolves once they are gone. */
|
|
@@ -1683,7 +2007,8 @@ type TileflowTrees3D = {
|
|
|
1683
2007
|
readonly scale: number;
|
|
1684
2008
|
/**
|
|
1685
2009
|
* Whether the map's style describes 3D trees (`vegetation({mode: '3d'})`), tiles of trees,
|
|
1686
|
-
* trees placed (mapped and from canopy points) and trees drawn in the
|
|
2010
|
+
* trees placed (mapped and from canopy points), pieces of hedge placed and trees drawn in the
|
|
2011
|
+
* last frame.
|
|
1687
2012
|
*/
|
|
1688
2013
|
readonly stats: Readonly<{
|
|
1689
2014
|
declared: boolean;
|
|
@@ -1691,6 +2016,7 @@ type TileflowTrees3D = {
|
|
|
1691
2016
|
trees: number;
|
|
1692
2017
|
mapped: number;
|
|
1693
2018
|
canopy: number;
|
|
2019
|
+
hedges: number;
|
|
1694
2020
|
drawn: number;
|
|
1695
2021
|
}>;
|
|
1696
2022
|
/** Takes the layer off the map and lets go of its buffers. */
|
|
@@ -2042,6 +2368,50 @@ declare const tileflowPmtilesProtocol: "tileflow-pmtiles";
|
|
|
2042
2368
|
/** Register only Tileflow's managed PMTiles namespace. Third-party `pmtiles://` remains untouched. */
|
|
2043
2369
|
declare function registerTileflowPmtilesProtocol(registry: TileflowPmtilesProtocolRegistry, options?: TileflowPmtilesProtocolRegistrationOptions): void;
|
|
2044
2370
|
|
|
2371
|
+
type TileflowViewMode = '2d' | '3d';
|
|
2372
|
+
type TileflowVegetationRepresentation = 'none' | 'flat' | '3d';
|
|
2373
|
+
declare const tileflowVegetationDisplayMetadataKey = "tileflow:vegetation-display";
|
|
2374
|
+
/** Display policy, separate from the models' design and the camera's pitch. */
|
|
2375
|
+
type TileflowVegetationDisplay = Readonly<{
|
|
2376
|
+
version: 1;
|
|
2377
|
+
mode: TileflowVegetationMode;
|
|
2378
|
+
fallback: 'flat' | 'none';
|
|
2379
|
+
visible: boolean;
|
|
2380
|
+
/** Authored visibility before the compiler applies the static fallback. */
|
|
2381
|
+
flatLayers: readonly Readonly<{
|
|
2382
|
+
id: string;
|
|
2383
|
+
visible: boolean;
|
|
2384
|
+
}>[];
|
|
2385
|
+
}>;
|
|
2386
|
+
declare function readTileflowVegetationDisplay(metadata: unknown): TileflowVegetationDisplay | undefined;
|
|
2387
|
+
declare function resolveTileflowVegetationRepresentation(policy: TileflowVegetationDisplay | undefined, options: {
|
|
2388
|
+
visible?: boolean | undefined;
|
|
2389
|
+
viewMode?: TileflowViewMode;
|
|
2390
|
+
supports3D: boolean;
|
|
2391
|
+
}): TileflowVegetationRepresentation;
|
|
2392
|
+
|
|
2393
|
+
type TileflowVegetationOptions = Omit<TileflowTrees3DOptions, 'manageFlatLayers' | 'map'> & {
|
|
2394
|
+
map: TileflowTrees3DOptions['map'] & {
|
|
2395
|
+
getCanvas?(): HTMLCanvasElement;
|
|
2396
|
+
};
|
|
2397
|
+
/** Overrides the map's visibility. Undefined restores the authored default. */
|
|
2398
|
+
visible?: boolean | undefined;
|
|
2399
|
+
/** Explicit application view mode, independent of pitch and building visibility. Defaults to 2d. */
|
|
2400
|
+
viewMode?: TileflowViewMode;
|
|
2401
|
+
};
|
|
2402
|
+
type TileflowVegetationController = {
|
|
2403
|
+
inspectModels: TileflowTrees3D['inspectModels'];
|
|
2404
|
+
setVisible(visible: boolean | undefined): void;
|
|
2405
|
+
setViewMode(mode: TileflowViewMode): void;
|
|
2406
|
+
/** Reapplies the policy after application layer controls change. */
|
|
2407
|
+
refresh(): void;
|
|
2408
|
+
readonly representation: TileflowVegetationRepresentation;
|
|
2409
|
+
readonly stats: TileflowTrees3D['stats'] | undefined;
|
|
2410
|
+
dispose(): void;
|
|
2411
|
+
};
|
|
2412
|
+
/** Mount once per map. OFF hides every representation; mode selects how enabled trees are drawn. */
|
|
2413
|
+
declare function createTileflowVegetation(options: TileflowVegetationOptions): TileflowVegetationController;
|
|
2414
|
+
|
|
2045
2415
|
type TileflowMapReadinessState = 'error' | 'idle' | 'loading';
|
|
2046
2416
|
/** Read the browser preference without persisting or mutating user state. */
|
|
2047
2417
|
declare function getTileflowSystemColorScheme(): TileflowRuntimeColorScheme;
|
|
@@ -2279,4 +2649,4 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
|
|
|
2279
2649
|
worldRequestBridge?: TileflowWorldRequestBridge;
|
|
2280
2650
|
}): TileflowTransformRequest<TRequest, TResourceType>;
|
|
2281
2651
|
|
|
2282
|
-
export { type TileflowAtmosphereMap, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildings3D, type TileflowBuildings3DChange, type TileflowBuildings3DDesign, type TileflowBuildings3DMap, type TileflowBuildings3DOptions, type TileflowBuildings3DThemes, 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 TileflowFrameScheduler, type TileflowGroundLayer, type TileflowGroundLayers, type TileflowGroundLayersMap, type TileflowGroundLayersOptions, type TileflowGroundOrderMap, type TileflowLineProgressAnimation, type TileflowLineProgressController, type TileflowLineProgressGradientOptions, type TileflowLineProgressLayer, type TileflowLineProgressMap, type TileflowLineProgressOptions, type TileflowLineProgressShown, type TileflowLineProgressState, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowRouteInks, type TileflowSessionSender, type TileflowSessionStarter, type TileflowShotCamera, type TileflowShotCue, type TileflowShotKeyframe, type TileflowShotMotion, type TileflowShotPlayback, type TileflowShotPlaybackOptions, type TileflowShotPlayerMap, type TileflowShotState, type TileflowStreetLightEstimate, type TileflowStreetLightLayers, type TileflowStreetLightPlacement, type TileflowStreetLightPlacementOptions, type TileflowStreetLights, type TileflowStreetLightsDesign, type TileflowStreetLightsMap, type TileflowStreetLightsOptions, type TileflowStyleFontLoadOptions, type TileflowStyleStateValue, type TileflowStyleSwitchMap, type TileflowSun, type TileflowSunPreset, type TileflowSunRequest, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTile, type TileflowTileAddress, type TileflowTileAreaRequest, type TileflowTileFeature, type TileflowTileGeometryType, type TileflowTileLayer, type TileflowTileReader, type TileflowTileReaderOptions, type TileflowTileRequestTransform, type TileflowTileSourceMap, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowTreeFields, type TileflowTreeForm, type TileflowTreeFormMix, type TileflowTreeFormRange, type TileflowTreeLayers, type TileflowTreePlacement, type TileflowTreePlacementOptions, type TileflowTreeRange, type TileflowTreeRegion, type TileflowTrees3D, type TileflowTrees3DChange, type TileflowTrees3DMap, type TileflowTrees3DOptions, type TileflowTrees3DThemes, type TileflowUserTransformRequest, type TileflowVectorTileDecodeOptions, type TileflowVegetation3D, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowBuildings3D, createTileflowDepthMarkers, createTileflowGroundLayers, createTileflowLineProgress, createTileflowSessionStarter, createTileflowStreetLights, createTileflowThemeController, createTileflowTileReader, createTileflowTransformRequest, createTileflowTrees3D, decodeTileflowVectorTile, getTileflowSystemColorScheme, loadTileflowStyleFonts, meshTileflowBuildings, mixTileflowRouteInks, mixTileflowSunPresets, placeTileflowStreetLights, placeTileflowTrees, playTileflowShot, readTileflowBuildings3D, readTileflowMapTileSource, readTileflowRouteInks, readTileflowStreetLights, readTileflowSunPreset, readTileflowVegetation3D, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, resolveTileflowSun, subscribeTileflowSystemColorScheme, tileflowBuildingExtent, tileflowBuildingVertexBytes, tileflowBuildings3DLayerId, tileflowBuildingsMetadataKey, tileflowDefaultRouteInks, tileflowDefaultSunPreset, tileflowDepthMarkerPlacement, tileflowFairUseNoticeMessage, tileflowGroundBeforeId, tileflowLayerDomainMetadataKey, tileflowLineProgressGradient, tileflowMaplibreContourVersion, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, tileflowRouteMetadataKey, tileflowShotStateAt, tileflowStreetLightBytes, tileflowStreetLightsLayerId, tileflowStreetLightsMetadataKey, tileflowStyleRouteInks, tileflowStyleSunPreset, tileflowSunDirection, tileflowSunLightMatrix, tileflowSunMetadataKey, tileflowSunPosition, tileflowTilePointToLngLat, tileflowTilesForBounds, tileflowTreeBytes, tileflowTreeFormOf, tileflowTreeForms, tileflowTrees3DLayerId, tileflowVegetationMetadataKey, validateTileflowBrowserThemeBlendSelection, validateTileflowEmphasis };
|
|
2652
|
+
export { type CreateBoundaryFeatureStateOptions, type TileflowAtmosphereMap, type TileflowBoundaryFeatureState, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildingModelPlacement, type TileflowBuildings3D, type TileflowBuildings3DChange, type TileflowBuildings3DDesign, type TileflowBuildings3DMap, type TileflowBuildings3DOptions, type TileflowBuildings3DThemes, type TileflowComposedRequest, type TileflowContourProtocolHandler, type TileflowContourProtocolRegistrationOptions, type TileflowContourProtocolRegistry, type TileflowContourProtocolRequest, type TileflowContourProtocolResponse, type TileflowDepthMarker, type TileflowDepthMarkerHandle, type TileflowDepthMarkerMap, type TileflowDepthMarkers, type TileflowDepthMarkersOptions, type TileflowDynamicImage, type TileflowDynamicImageContext, type TileflowDynamicImageHandle, type TileflowEmphasis, type TileflowEmphasisArea, type TileflowEmphasisModule, type TileflowFairUseNotice, type TileflowFairUseNoticeController, type TileflowFairUseNoticeState, type TileflowFeatureStateMap, type TileflowFrameScheduler, type TileflowGroundLayer, type TileflowGroundLayers, type TileflowGroundLayersMap, type TileflowGroundLayersOptions, type TileflowGroundOrderMap, type TileflowLineProgressAnimation, type TileflowLineProgressController, type TileflowLineProgressGradientOptions, type TileflowLineProgressLayer, type TileflowLineProgressMap, type TileflowLineProgressOptions, type TileflowLineProgressShown, type TileflowLineProgressState, type TileflowMapLifecycleAttachment, type TileflowMapLifecycleEvent, type TileflowMapLifecycleSubscriber, type TileflowMapReadinessState, type TileflowPmtilesProtocolHandler, type TileflowPmtilesProtocolRegistrationOptions, type TileflowPmtilesProtocolRegistry, type TileflowRouteInks, type TileflowSessionSender, type TileflowSessionStarter, type TileflowShotCamera, type TileflowShotCue, type TileflowShotKeyframe, type TileflowShotMotion, type TileflowShotPlayback, type TileflowShotPlaybackOptions, type TileflowShotPlayerMap, type TileflowShotState, type TileflowStreetLightEstimate, type TileflowStreetLightLayers, type TileflowStreetLightPlacement, type TileflowStreetLightPlacementOptions, type TileflowStreetLights, type TileflowStreetLightsDesign, type TileflowStreetLightsMap, type TileflowStreetLightsOptions, type TileflowStyleFontLoadOptions, type TileflowStyleStateValue, type TileflowStyleSwitchMap, type TileflowSun, type TileflowSunPreset, type TileflowSunRequest, type TileflowThemeBlendRequest, type TileflowThemeBlendState, type TileflowThemeChangeOptions, type TileflowThemeController, type TileflowThemeTransition, type TileflowThemeTransitionOptions, type TileflowThemeTransitionPhase, type TileflowThemeTransitionResult, type TileflowTile, type TileflowTileAddress, type TileflowTileAreaRequest, type TileflowTileFeature, type TileflowTileGeometryType, type TileflowTileLayer, type TileflowTileReader, type TileflowTileReaderOptions, type TileflowTileRequestTransform, type TileflowTileSourceMap, type TileflowTransformRequest, type TileflowTransformRequestParameters, type TileflowTreeFields, type TileflowTreeForm, type TileflowTreeFormMix, type TileflowTreeFormRange, type TileflowTreeLayers, type TileflowTreePlacement, type TileflowTreePlacementOptions, type TileflowTreeRange, type TileflowTreeRegion, type TileflowTrees3D, type TileflowTrees3DChange, type TileflowTrees3DMap, type TileflowTrees3DOptions, type TileflowTrees3DThemes, type TileflowUserTransformRequest, type TileflowVectorTileDecodeOptions, type TileflowVegetation3D, type TileflowVegetationController, type TileflowVegetationDisplay, type TileflowVegetationOptions, type TileflowVegetationRepresentation, type TileflowViewMode, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createBoundaryFeatureState, createTileflowBuildings3D, createTileflowDepthMarkers, createTileflowGroundLayers, createTileflowLineProgress, createTileflowSessionStarter, createTileflowStreetLights, createTileflowThemeController, createTileflowTileReader, createTileflowTransformRequest, createTileflowTrees3D, createTileflowVegetation, decodeTileflowVectorTile, getTileflowSystemColorScheme, loadTileflowStyleFonts, meshTileflowBuildings, mixTileflowRouteInks, mixTileflowSunPresets, placeTileflowStreetLights, placeTileflowTrees, playTileflowShot, readTileflowBuildings3D, readTileflowMapTileSource, readTileflowRouteInks, readTileflowStreetLights, readTileflowSunPreset, readTileflowVegetation3D, readTileflowVegetationDisplay, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, resolveTileflowSun, resolveTileflowVegetationRepresentation, subscribeTileflowSystemColorScheme, tileflowBuildingExtent, tileflowBuildingModelPlacementLimit, tileflowBuildingVertexBytes, tileflowBuildings3DLayerId, tileflowBuildingsMetadataKey, tileflowDefaultRouteInks, tileflowDefaultSunPreset, tileflowDepthMarkerPlacement, tileflowFairUseNoticeMessage, tileflowGroundBeforeId, tileflowLayerDomainMetadataKey, tileflowLineProgressGradient, tileflowMaplibreContourVersion, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, tileflowRouteMetadataKey, tileflowShotStateAt, tileflowStreetLightBytes, tileflowStreetLightsLayerId, tileflowStreetLightsMetadataKey, tileflowStyleRouteInks, tileflowStyleSunPreset, tileflowSunDirection, tileflowSunLightMatrix, tileflowSunMetadataKey, tileflowSunPosition, tileflowTilePointToLngLat, tileflowTilesForBounds, tileflowTreeBytes, tileflowTreeFormOf, tileflowTreeForms, tileflowTrees3DLayerId, tileflowVegetationDisplayMetadataKey, tileflowVegetationMetadataKey, validateTileflowBrowserThemeBlendSelection, validateTileflowEmphasis };
|