@tileflow/core 0.1.0-alpha.35 → 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 +16 -17
- package/dist/browser.d.ts +600 -427
- package/dist/browser.js +1633 -431
- package/dist/build.d.ts +3 -3
- package/dist/build.js +1734 -1093
- package/dist/config-reference.json +2901 -1906
- package/dist/{icon-composition-DSjIKmrK.d.ts → icon-composition-sN3JkXdb.d.ts} +291 -93
- package/dist/index.d.ts +201 -7
- package/dist/index.js +4691 -3509
- package/dist/{manifest-types-Bzxon3dx.d.ts → manifest-types-jrBdBrES.d.ts} +29 -8
- package/dist/manifest.d.ts +2 -2
- package/dist/native.js +57 -57
- package/dist/runtime.d.ts +1 -1
- package/dist/worker/buildings-3d-worker.global.js +1 -0
- package/docs/authoring-model.md +8 -3
- package/docs/boundary-areas-and-choropleths.md +217 -0
- package/docs/buildings-3d.md +102 -21
- package/docs/cartographic-defaults.md +142 -0
- package/docs/data-is-separate-from-design.md +54 -2
- package/docs/hosted-session-authorization.md +2 -4
- package/docs/map-and-terrain-examples.md +10 -3
- package/docs/street-lights.md +22 -6
- package/docs/sun-and-light.md +42 -2
- package/docs/themes-and-module-styles.md +66 -0
- package/docs/trees-3d.md +22 -9
- package/package.json +2 -2
package/dist/browser.d.ts
CHANGED
|
@@ -380,386 +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
|
-
/**
|
|
513
|
-
* How POI categories are placed against each other. `importance` places every category in one
|
|
514
|
-
* order, by World's ranks. `categories` gives each category its own layer and places the
|
|
515
|
-
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
516
|
-
*/
|
|
517
|
-
type TileflowPoiPlacementOrder = 'categories' | 'importance';
|
|
518
|
-
/**
|
|
519
|
-
* The appearance of one POI category. With the default `importance` order every category shares
|
|
520
|
-
* one placement layer, so categories may differ only in properties MapLibre evaluates per feature
|
|
521
|
-
* (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
|
|
522
|
-
* overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
|
|
523
|
-
*/
|
|
524
|
-
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
|
|
525
|
-
type TileflowPoiModuleConfig = {
|
|
526
|
-
type: 'poi';
|
|
527
|
-
categories?: readonly TileflowPoiCategory[];
|
|
528
|
-
color?: TileflowPoiColorMode;
|
|
529
|
-
/** One density for the whole module: World's ranks decide what each category shows. */
|
|
530
|
-
density?: TileflowPoiDensity;
|
|
531
|
-
icons?: boolean;
|
|
532
|
-
labels?: boolean;
|
|
533
|
-
minZoom?: number;
|
|
534
|
-
placement?: {
|
|
535
|
-
/**
|
|
536
|
-
* Places each pictogram with its name as one unit that needs room for both. Defaults to
|
|
537
|
-
* `false`.
|
|
538
|
-
*/
|
|
539
|
-
coupleIconAndLabel?: boolean;
|
|
540
|
-
iconPadding?: number;
|
|
541
|
-
/**
|
|
542
|
-
* World POI `type` values whose pictogram explains them. When pictograms and names are both
|
|
543
|
-
* drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
|
|
544
|
-
* Defaults to parking and public toilets.
|
|
545
|
-
*/
|
|
546
|
-
iconOnlyTypes?: readonly string[];
|
|
547
|
-
/** Defaults to `importance`. */
|
|
548
|
-
order?: TileflowPoiPlacementOrder;
|
|
549
|
-
/**
|
|
550
|
-
* With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
|
|
551
|
-
* before the map's road and place labels, and the others after them. A map that gives street
|
|
552
|
-
* names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
|
|
553
|
-
* way. Unset, every POI is placed at the module's own position.
|
|
554
|
-
*/
|
|
555
|
-
prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
556
|
-
textPadding?: number;
|
|
557
|
-
};
|
|
558
|
-
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
559
|
-
};
|
|
560
|
-
type MapLibreSprite = string | Array<{
|
|
561
|
-
id: string;
|
|
562
|
-
url: string;
|
|
563
|
-
}>;
|
|
564
|
-
type TileflowProjection = 'globe' | 'mercator';
|
|
565
|
-
type TileflowLight = {
|
|
566
|
-
anchor?: 'map' | 'viewport';
|
|
567
|
-
color?: TileflowColor;
|
|
568
|
-
intensity?: number;
|
|
569
|
-
position?: readonly [number, number, number];
|
|
570
|
-
};
|
|
571
|
-
type MapLibreStyle = {
|
|
572
|
-
sky?: Record<string, unknown>;
|
|
573
|
-
version: 8;
|
|
574
|
-
name: string;
|
|
575
|
-
glyphs?: string;
|
|
576
|
-
light?: TileflowLight;
|
|
577
|
-
projection?: {
|
|
578
|
-
type: TileflowProjection;
|
|
579
|
-
};
|
|
580
|
-
sprite?: MapLibreSprite;
|
|
581
|
-
sources: Record<string, Record<string, unknown>>;
|
|
582
|
-
layers: Array<Record<string, unknown>>;
|
|
583
|
-
terrain?: Record<string, unknown>;
|
|
584
|
-
metadata?: Record<string, unknown>;
|
|
585
|
-
};
|
|
586
|
-
|
|
587
|
-
declare const tileflowSunMetadataKey = "tileflow:sun";
|
|
588
|
-
/** A theme's sun and sky light with every value resolved; see `TileflowThemeSun`. */
|
|
589
|
-
type TileflowSunPreset = Readonly<{
|
|
590
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
591
|
-
azimuth: number;
|
|
592
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
593
|
-
altitude: number;
|
|
594
|
-
/** The direct light's colour. */
|
|
595
|
-
color: string;
|
|
596
|
-
/** The direct light's strength, from 0 to 1. */
|
|
597
|
-
intensity: number;
|
|
598
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
599
|
-
shadowIntensity: number;
|
|
600
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
601
|
-
ambient: Readonly<{
|
|
602
|
-
color: string;
|
|
603
|
-
intensity: number;
|
|
604
|
-
}>;
|
|
605
|
-
}>;
|
|
606
|
-
/** The sun as the map shows it, ready for an application's own layers. */
|
|
607
|
-
type TileflowSun = Readonly<{
|
|
608
|
-
/** Degrees clockwise from north, from 0 to 360. */
|
|
609
|
-
azimuth: number;
|
|
610
|
-
/** Degrees above the horizon, from -90 to 90. */
|
|
611
|
-
altitude: number;
|
|
612
|
-
/** A unit vector towards the sun: x east, y north, z up. */
|
|
613
|
-
direction: readonly [number, number, number];
|
|
614
|
-
/** The direct light's colour, as a CSS colour. */
|
|
615
|
-
color: string;
|
|
616
|
-
/** The direct light's colour as sRGB channels from 0 to 1. */
|
|
617
|
-
rgb: readonly [number, number, number];
|
|
618
|
-
/**
|
|
619
|
-
* The direct light's strength, from 0 to 1. It fades to 0 as the sun sets: a sun below the
|
|
620
|
-
* horizon lights nothing and casts no shadow.
|
|
621
|
-
*/
|
|
622
|
-
intensity: number;
|
|
623
|
-
/** How dark the shadows the sun casts fall, from 0 (none) to 1. */
|
|
624
|
-
shadowIntensity: number;
|
|
625
|
-
/** The light from the sky, which reaches every surface and fills the shadows. */
|
|
626
|
-
ambient: Readonly<{
|
|
627
|
-
color: string;
|
|
628
|
-
rgb: readonly [number, number, number];
|
|
629
|
-
intensity: number;
|
|
630
|
-
}>;
|
|
631
|
-
/**
|
|
632
|
-
* How bright flat, open ground is under this light, from 0 (dark) to 1: the sky's light plus the
|
|
633
|
-
* sun's at its height, each weighted by its colour's luminance. Use it to switch lamps or windows
|
|
634
|
-
* on as a scene darkens, whatever theme or sun lights it.
|
|
635
|
-
*/
|
|
636
|
-
brightness: number;
|
|
637
|
-
/** Where the direction comes from: the themes, angles, or a date and place. */
|
|
638
|
-
source: 'theme' | 'direction' | 'date';
|
|
639
|
-
}>;
|
|
640
|
-
/** The sun of a theme that leaves a value unset: high in the south-south-west, in white light. */
|
|
641
|
-
declare const tileflowDefaultSunPreset: TileflowSunPreset;
|
|
642
|
-
/**
|
|
643
|
-
* Where the sun stands for an instant and a place ([longitude, latitude] in degrees): its azimuth
|
|
644
|
-
* in degrees clockwise from north and its apparent altitude above the horizon, with atmospheric
|
|
645
|
-
* refraction. It follows NOAA's solar equations, accurate to about a hundredth of a degree for
|
|
646
|
-
* years 1800 to 2200.
|
|
647
|
-
*/
|
|
648
|
-
declare function tileflowSunPosition(date: Date | number, location: readonly [number, number]): Readonly<{
|
|
649
|
-
azimuth: number;
|
|
650
|
-
altitude: number;
|
|
651
|
-
}>;
|
|
652
|
-
/** A unit vector towards a direction in the sky: x east, y north, z up. */
|
|
653
|
-
declare function tileflowSunDirection(azimuth: number, altitude: number): readonly [number, number, number];
|
|
654
|
-
/**
|
|
655
|
-
* The sun as the map shows it: a preset's light from a direction. Direct light fades out over the
|
|
656
|
-
* sun's last degrees above the horizon and is gone below it.
|
|
657
|
-
*/
|
|
658
|
-
declare function resolveTileflowSun(preset: TileflowSunPreset, direction?: Readonly<{
|
|
659
|
-
azimuth: number;
|
|
660
|
-
altitude: number;
|
|
661
|
-
}>, source?: TileflowSun['source']): TileflowSun;
|
|
662
|
-
/**
|
|
663
|
-
* A preset `t` of the way from `from` to `to`: the azimuth turns the short way round, colours mix
|
|
664
|
-
* in OKLab, as theme blends mix paint colours, and numbers linearly.
|
|
665
|
-
*/
|
|
666
|
-
declare function mixTileflowSunPresets(from: TileflowSunPreset, to: TileflowSunPreset, t: number): TileflowSunPreset;
|
|
667
|
-
/** Reads the sun a compiled style publishes, or undefined when its metadata has none. */
|
|
668
|
-
declare function readTileflowSunPreset(metadata: unknown): TileflowSunPreset | undefined;
|
|
669
|
-
/**
|
|
670
|
-
* The sun of a compiled style: the one it publishes, else one read from its light (a style whose
|
|
671
|
-
* theme describes no sun lights its extrusions from `light.position`), else the default.
|
|
672
|
-
*/
|
|
673
|
-
declare function tileflowStyleSunPreset(style: {
|
|
674
|
-
light?: unknown;
|
|
675
|
-
metadata?: unknown;
|
|
676
|
-
} | undefined): TileflowSunPreset;
|
|
677
|
-
|
|
678
|
-
type TileflowThemeColorScheme = 'dark' | 'light';
|
|
679
|
-
|
|
680
|
-
declare const tileflowRouteMetadataKey = "tileflow:route";
|
|
681
|
-
/** The resolved inks of a route, from its outer glow to its bright core. */
|
|
682
|
-
type TileflowRouteInks = Readonly<{
|
|
683
|
-
/** The chosen route's line. */
|
|
684
|
-
line: string;
|
|
685
|
-
/** The edge on each side of the line, which sets it apart from the roads under it. */
|
|
686
|
-
casing: string;
|
|
687
|
-
/** A thin line along the middle of the route. */
|
|
688
|
-
core: string;
|
|
689
|
-
/** A soft halo around the route. */
|
|
690
|
-
glow: string;
|
|
691
|
-
/** Other routes offered beside the chosen one. */
|
|
692
|
-
alternative: string;
|
|
693
|
-
/** Opacity of the glow, from 0 (no glow) to 1. */
|
|
694
|
-
glowOpacity: number;
|
|
695
|
-
/** Opacity of the core, from 0 (no core) to 1. */
|
|
696
|
-
coreOpacity: number;
|
|
697
|
-
}>;
|
|
698
|
-
/** The inks of a theme that sets no route tokens: a blue that reads on either kind of map. */
|
|
699
|
-
declare const tileflowDefaultRouteInks: Readonly<Record<TileflowThemeColorScheme, TileflowRouteInks>>;
|
|
700
|
-
/**
|
|
701
|
-
* Reads the route inks a compiled style publishes, or undefined when its metadata has none (a
|
|
702
|
-
* style compiled before route inks, or not by Tileflow).
|
|
703
|
-
*/
|
|
704
|
-
declare function readTileflowRouteInks(metadata: unknown): TileflowRouteInks | undefined;
|
|
705
|
-
/**
|
|
706
|
-
* The route inks of a compiled style: those it publishes, or the defaults of its colour scheme
|
|
707
|
-
* (from its `tileflow:colorScheme` metadata, else `fallbackScheme`).
|
|
708
|
-
*/
|
|
709
|
-
declare function tileflowStyleRouteInks(style: {
|
|
710
|
-
metadata?: unknown;
|
|
711
|
-
} | undefined, fallbackScheme?: TileflowThemeColorScheme): TileflowRouteInks;
|
|
712
|
-
/**
|
|
713
|
-
* Inks between two themes' inks, `t` of the way from `from` to `to`: colours mix in OKLab, as theme
|
|
714
|
-
* blends mix paint colours, and opacities linearly.
|
|
715
|
-
*/
|
|
716
|
-
declare function mixTileflowRouteInks(from: TileflowRouteInks, to: TileflowRouteInks, t: number): TileflowRouteInks;
|
|
717
|
-
|
|
718
|
-
type TileflowRuntimeColorScheme = 'dark' | 'light';
|
|
719
|
-
|
|
720
|
-
type TileflowAnalytics = {
|
|
721
|
-
apiUrl?: string;
|
|
722
|
-
endpoint?: string;
|
|
723
|
-
enabled?: boolean;
|
|
724
|
-
mapId?: string;
|
|
725
|
-
metadata?: Record<string, unknown>;
|
|
726
|
-
projectId?: string;
|
|
727
|
-
sdkVersion?: string;
|
|
728
|
-
source?: string;
|
|
729
|
-
styleId?: string;
|
|
730
|
-
surfaceId?: string;
|
|
731
|
-
};
|
|
732
|
-
type TileflowSessionController = {
|
|
733
|
-
readonly sessionId: string;
|
|
734
|
-
resolveRequestUrl(url: string, analytics: TileflowAnalytics | undefined): Promise<string | undefined>;
|
|
735
|
-
};
|
|
736
|
-
type TileflowRuntimeStyle = {
|
|
737
|
-
analytics?: TileflowAnalytics;
|
|
738
|
-
colorScheme?: TileflowRuntimeColorScheme;
|
|
739
|
-
/** An explicit empty array means the manifest declares that no web fonts are required. */
|
|
740
|
-
fontFaces?: TileflowStyleFontFace[];
|
|
741
|
-
revision?: string;
|
|
742
|
-
style: MapLibreStyle | string;
|
|
743
|
-
theme?: string;
|
|
744
|
-
};
|
|
745
|
-
type TileflowStyleFontFace = {
|
|
746
|
-
family: string;
|
|
747
|
-
source: string;
|
|
748
|
-
style?: 'italic' | 'normal' | 'oblique';
|
|
749
|
-
weight?: '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
750
|
-
};
|
|
751
|
-
/**
|
|
752
|
-
* A continuous blend of named themes of one Tileflow map. `position` places the map between
|
|
753
|
-
* neighbouring themes: 0 is the first, 1 the second, and 1.25 a quarter of the way from the second
|
|
754
|
-
* to the third.
|
|
755
|
-
*/
|
|
756
|
-
type TileflowThemeBlendSelection = Readonly<{
|
|
757
|
-
/** From 0 to `themes.length - 1`. */
|
|
758
|
-
position: number;
|
|
759
|
-
/** Two to eight concrete theme names of the map, in blend order. */
|
|
760
|
-
themes: readonly string[];
|
|
761
|
-
}>;
|
|
762
|
-
|
|
763
383
|
type TileflowAddressesModuleOptions = {
|
|
764
384
|
/** Styling for OpenMapTiles point house-number labels. */
|
|
765
385
|
labels?: TileflowSymbolStyle;
|
|
@@ -794,19 +414,21 @@ type TileflowBuildingMode = '3d' | 'flat';
|
|
|
794
414
|
* building colour (its extrusion), else its roofs'.
|
|
795
415
|
*/
|
|
796
416
|
type TileflowBuildingsThreeDimensionalStyle = {
|
|
797
|
-
/** Use the
|
|
417
|
+
/** Use the scene sun (default), or the style's native extrusion light. */
|
|
798
418
|
lighting?: 'style' | 'sun';
|
|
799
419
|
/** Per-building brightness variation, from 0 to 1; defaults to 0 (authored colour). */
|
|
800
420
|
colorVariation?: TileflowThemeNumberValue;
|
|
801
421
|
/** How strongly roof outlines and outer corners catch the light, from 0 (default) to 1. */
|
|
802
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;
|
|
803
425
|
/** Their own colour, drawn unlit; without it they take the building's colour, lightened. */
|
|
804
426
|
edgeColor?: TileflowThemeColorValue;
|
|
805
427
|
/** How bright the buildings light the street at night, from 0 (none) to 2; defaults to 0. */
|
|
806
428
|
nightLight?: TileflowThemeNumberValue;
|
|
807
|
-
/** Contact shadow at the foot of the walls and in tight corners; defaults to
|
|
429
|
+
/** Contact shadow at the foot of the walls and in tight corners; defaults to true. */
|
|
808
430
|
occlusion?: boolean;
|
|
809
|
-
/** Shadows from the sun, on the buildings and the flat map; defaults to
|
|
431
|
+
/** Shadows from the sun, on the buildings and the flat map; defaults to true. */
|
|
810
432
|
shadows?: boolean;
|
|
811
433
|
/**
|
|
812
434
|
* Invented night windows, lit by rooms: decoration, not data. With World's `class`, none on sheds,
|
|
@@ -859,8 +481,24 @@ type TileflowBuildingsModuleConfig = TileflowBuildingsModuleOptions & {
|
|
|
859
481
|
|
|
860
482
|
type TileflowLanduseClass = 'cemetery' | 'civic' | 'commercial' | 'education' | 'government' | 'industrial' | 'medical' | 'military' | 'parking' | 'railway' | 'recreation' | 'residential';
|
|
861
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
|
+
};
|
|
862
495
|
type TileflowLandModuleOptions = {
|
|
863
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>>;
|
|
864
502
|
globalLandcover?: TileflowFillStyle;
|
|
865
503
|
landcover?: Partial<Record<TileflowLandcoverClass, TileflowAreaStyle>>;
|
|
866
504
|
landuse?: Partial<Record<TileflowLanduseClass, TileflowAreaStyle>>;
|
|
@@ -989,6 +627,10 @@ type TileflowTreeFields = Readonly<{
|
|
|
989
627
|
canopyCover: string;
|
|
990
628
|
/** A canopy point's measured canopy height, in metres. */
|
|
991
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;
|
|
992
634
|
}>;
|
|
993
635
|
type TileflowTreePlacementOptions = Readonly<{
|
|
994
636
|
/** The tile's address, for regions and for a stable look per tree. */
|
|
@@ -1016,6 +658,11 @@ type TileflowTreeLayers = Readonly<{
|
|
|
1016
658
|
trees?: TileflowTileLayer;
|
|
1017
659
|
/** Decorative canopy points in parks and gardens (World's `canopy`). */
|
|
1018
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;
|
|
1019
666
|
}>;
|
|
1020
667
|
/** Where some trees are in a placement, and how many of them have each rank or a lower one. */
|
|
1021
668
|
type TileflowTreeRange = Readonly<{
|
|
@@ -1034,7 +681,12 @@ type TileflowTreePlacement = Readonly<{
|
|
|
1034
681
|
/** `tileflowTreeBytes` bytes per tree, ordered by form, model, then rank; see the layout below. */
|
|
1035
682
|
trees: Uint8Array;
|
|
1036
683
|
forms: Readonly<Record<TileflowTreeForm, TileflowTreeFormRange>>;
|
|
1037
|
-
/**
|
|
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. */
|
|
1038
690
|
tallest: number;
|
|
1039
691
|
/** Trees from the data's trees and rows, and trees from canopy points. */
|
|
1040
692
|
mapped: number;
|
|
@@ -1059,19 +711,24 @@ declare function placeTileflowTrees(layers: TileflowTreeLayers, options: Tileflo
|
|
|
1059
711
|
declare const tileflowVegetationMetadataKey = "tileflow:vegetation";
|
|
1060
712
|
/** How a compiled map's 3D trees look and where their data is, resolved for one theme. */
|
|
1061
713
|
type TileflowVegetation3D = Readonly<{
|
|
1062
|
-
/** 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. */
|
|
1063
715
|
source: string;
|
|
1064
716
|
layers: Readonly<{
|
|
1065
717
|
tree: string;
|
|
1066
718
|
canopy?: string;
|
|
719
|
+
hedge?: string;
|
|
1067
720
|
}>;
|
|
1068
721
|
fields: TileflowTreeFields;
|
|
1069
|
-
/**
|
|
722
|
+
/**
|
|
723
|
+
* Sunlit colours: bark, the leaves of each kind of tree from darkest to lightest, and those of
|
|
724
|
+
* hedges.
|
|
725
|
+
*/
|
|
1070
726
|
colors: Readonly<{
|
|
1071
727
|
bark: string;
|
|
1072
728
|
broadleaf: readonly string[];
|
|
1073
729
|
conifer: readonly string[];
|
|
1074
730
|
palm: readonly string[];
|
|
731
|
+
hedge: readonly string[];
|
|
1075
732
|
}>;
|
|
1076
733
|
heightScale: number;
|
|
1077
734
|
crownScale: number;
|
|
@@ -1103,6 +760,13 @@ type TileflowVegetationThreeDimensionalStyle = {
|
|
|
1103
760
|
coniferColors?: readonly TileflowThemeColorValue[];
|
|
1104
761
|
/** Sunlit frond colours of palms, from darkest to lightest; the broadleaf colours by default. */
|
|
1105
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[];
|
|
1106
770
|
crownScale?: TileflowThemeNumberValue;
|
|
1107
771
|
heightScale?: TileflowThemeNumberValue;
|
|
1108
772
|
/**
|
|
@@ -1150,32 +814,269 @@ type TileflowVegetationModuleOptions = {
|
|
|
1150
814
|
visible?: boolean;
|
|
1151
815
|
threeDimensional?: TileflowVegetationThreeDimensionalStyle;
|
|
1152
816
|
};
|
|
1153
|
-
type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
1154
|
-
type: 'vegetation';
|
|
817
|
+
type TileflowVegetationModuleConfig = TileflowVegetationModuleOptions & {
|
|
818
|
+
type: 'vegetation';
|
|
819
|
+
};
|
|
820
|
+
|
|
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
|
+
};
|
|
832
|
+
type TileflowWaterModuleOptions = {
|
|
833
|
+
bathymetry?: TileflowFillStyle;
|
|
834
|
+
/** Contour lines when declared by Bathymetry; otherwise approximate polygon band edges. */
|
|
835
|
+
bathymetryContours?: TileflowLineStyle;
|
|
836
|
+
/** Contour-depth or legacy band-floor labels, not measured survey soundings. */
|
|
837
|
+
bathymetryLabels?: TileflowSymbolStyle;
|
|
838
|
+
/** Names from an explicitly declared seafloor_landform layer. */
|
|
839
|
+
bathymetryLandforms?: TileflowBathymetryNameStyle;
|
|
840
|
+
/** Names from an explicitly declared water_name layer. */
|
|
841
|
+
bathymetryWaterNames?: TileflowBathymetryNameStyle;
|
|
842
|
+
bodies?: TileflowAreaStyle;
|
|
843
|
+
intermittent?: {
|
|
844
|
+
bodies?: TileflowAreaStyle;
|
|
845
|
+
waterways?: TileflowLineStyle;
|
|
846
|
+
};
|
|
847
|
+
waterways?: Partial<Record<TileflowWaterwayClass, TileflowLineStyle>>;
|
|
848
|
+
};
|
|
849
|
+
type TileflowWaterModuleConfig = TileflowWaterModuleOptions & {
|
|
850
|
+
type: 'water';
|
|
851
|
+
};
|
|
852
|
+
|
|
853
|
+
type TileflowColor = `#${string}`;
|
|
854
|
+
type TileflowRoadDetail = 'none' | 'highways' | 'major' | 'streets' | 'all';
|
|
855
|
+
type TileflowRoadClass = 'motorway' | 'trunk' | 'primary' | 'secondary' | 'tertiary' | 'minor' | 'service' | 'track' | 'pathway' | 'footway' | 'cycleway' | 'steps' | 'pedestrian';
|
|
856
|
+
type TileflowRoadHierarchy = 'subtle' | 'clear' | 'strong';
|
|
857
|
+
type TileflowRoadWeight = 'thin' | 'regular' | 'bold';
|
|
858
|
+
type TileflowRoadOutline = 'none' | 'subtle' | 'strong';
|
|
859
|
+
type TileflowRoadStructure = 'bridge' | 'surface' | 'tunnel';
|
|
860
|
+
type TileflowRoadExtras = {
|
|
861
|
+
paths?: boolean;
|
|
862
|
+
};
|
|
863
|
+
type TileflowRoadLayerStyle = TileflowLineStackStyle & {
|
|
864
|
+
hatch?: TileflowLineHatchStyle;
|
|
865
|
+
};
|
|
866
|
+
type TileflowRoadTreatmentLineStyle = Pick<TileflowLinePaint, 'blur' | 'color' | 'dash' | 'gapWidth' | 'offset' | 'opacity' | 'width'>;
|
|
867
|
+
type TileflowRoadTreatmentLayerStyle = {
|
|
868
|
+
casing?: TileflowRoadTreatmentLineStyle;
|
|
869
|
+
fill?: TileflowRoadTreatmentLineStyle;
|
|
870
|
+
shadow?: TileflowRoadTreatmentLineStyle;
|
|
871
|
+
};
|
|
872
|
+
type TileflowRoadTreatmentStyle = Partial<Record<TileflowRoadStructure, TileflowRoadTreatmentLayerStyle>> & {
|
|
873
|
+
enabled?: boolean;
|
|
874
|
+
widthScale?: TileflowThemeNumberValue;
|
|
875
|
+
};
|
|
876
|
+
type TileflowRoadModifier = 'construction' | 'expressway' | 'indoor' | 'official' | 'ramp' | 'unpaved';
|
|
877
|
+
type TileflowRoadRestriction = 'access' | 'bicycle' | 'foot' | 'horse' | 'toll';
|
|
878
|
+
type TileflowMountainBikeScale = '0' | '0+' | '1' | '1+' | '2' | '2+' | '3' | '3+' | '4' | '5' | '6';
|
|
879
|
+
type TileflowRoadServiceType = 'alley' | 'crossover' | 'driveway' | 'parkingAisle' | 'yard';
|
|
880
|
+
type TileflowRoadClassStyle = Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>> & {
|
|
881
|
+
enabled?: boolean;
|
|
882
|
+
};
|
|
883
|
+
type TileflowRoadAreaStyle = {
|
|
884
|
+
pedestrian?: TileflowAreaStyle;
|
|
885
|
+
pier?: TileflowAreaStyle;
|
|
886
|
+
road?: TileflowAreaStyle;
|
|
887
|
+
};
|
|
888
|
+
type TileflowRoadCrossingStyle = Omit<TileflowIconStyle, 'image'> & Required<Pick<TileflowIconStyle, 'image'>>;
|
|
889
|
+
type TileflowRoadRoundaboutStyle = {
|
|
890
|
+
/** Extra casing width in pixels, split equally across both edges; defaults to the road border. */
|
|
891
|
+
borderWidth?: TileflowNumberStyleValue;
|
|
892
|
+
casing?: TileflowCircleStyle;
|
|
893
|
+
/** Road width in pixels when metric radii are absent; defaults to the effective surface fill width. */
|
|
894
|
+
fallbackWidth?: TileflowNumberStyleValue;
|
|
895
|
+
fill?: TileflowCircleStyle;
|
|
896
|
+
};
|
|
897
|
+
/**
|
|
898
|
+
* How Core's street lights renderer lights the map's streets at night, from the lamps and lit
|
|
899
|
+
* streets its data holds.
|
|
900
|
+
*/
|
|
901
|
+
type TileflowRoadStreetLightStyle = {
|
|
902
|
+
/** The light of lamps whose data gives no colour; a warm white by default. */
|
|
903
|
+
color?: TileflowThemeColorValue;
|
|
904
|
+
/** Whether the map has street lights; defaults to false. Set true to opt in. */
|
|
905
|
+
enabled?: boolean;
|
|
906
|
+
/**
|
|
907
|
+
* Where light is estimated where the data maps no lamps: `lit` (the default) along streets and
|
|
908
|
+
* pavements mapped as lit; `streets` also along streets the data says nothing about, in tiles
|
|
909
|
+
* that map few lamps, which invents light; `none` nowhere.
|
|
910
|
+
*/
|
|
911
|
+
estimate?: 'lit' | 'streets' | 'none';
|
|
912
|
+
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
913
|
+
intensity?: TileflowThemeNumberValue;
|
|
914
|
+
};
|
|
915
|
+
type TileflowRoadSidewalkStyle = {
|
|
916
|
+
outline?: TileflowLineStyle;
|
|
917
|
+
pattern?: TileflowFillStyle;
|
|
918
|
+
surface?: TileflowFillStyle;
|
|
919
|
+
};
|
|
920
|
+
type TileflowRoadsModuleConfig = {
|
|
921
|
+
type: 'roads';
|
|
922
|
+
areas?: TileflowRoadAreaStyle;
|
|
923
|
+
classes?: Partial<Record<TileflowRoadClass, TileflowRoadClassStyle>>;
|
|
924
|
+
crossings?: TileflowRoadCrossingStyle;
|
|
925
|
+
detail?: TileflowRoadDetail;
|
|
926
|
+
extras?: TileflowRoadExtras;
|
|
927
|
+
hierarchy?: TileflowRoadHierarchy;
|
|
928
|
+
modifiers?: Partial<Record<TileflowRoadModifier, TileflowRoadTreatmentStyle>>;
|
|
929
|
+
mountainBike?: Partial<Record<TileflowMountainBikeScale, TileflowRoadTreatmentStyle>>;
|
|
930
|
+
oneWayMarkers?: boolean;
|
|
931
|
+
outline?: TileflowRoadOutline;
|
|
932
|
+
/** Draw ramp fills below receiving roads by default; `by-class` keeps their class's order. */
|
|
933
|
+
rampOrder?: 'below-roads' | 'by-class';
|
|
934
|
+
restrictions?: Partial<Record<TileflowRoadRestriction, TileflowRoadTreatmentStyle>>;
|
|
935
|
+
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
936
|
+
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
937
|
+
sidewalks?: TileflowRoadSidewalkStyle;
|
|
938
|
+
streetLights?: TileflowRoadStreetLightStyle;
|
|
939
|
+
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
940
|
+
weight?: TileflowRoadWeight;
|
|
941
|
+
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
942
|
+
};
|
|
943
|
+
type TileflowLabelDetail = 'none' | 'major' | 'all';
|
|
944
|
+
type TileflowAerodromeCodeDetail = 'none' | 'iata' | 'all';
|
|
945
|
+
type TileflowRoadLabelDetail = TileflowRoadDetail;
|
|
946
|
+
type TileflowLabelLanguage = 'auto' | 'local' | 'en' | (string & {});
|
|
947
|
+
type TileflowPlaceLabelClass = 'city' | 'continent' | 'country' | 'neighborhood' | 'other' | 'state' | 'town' | 'village';
|
|
948
|
+
type TileflowWaterLabelClass = 'line' | 'ocean' | 'other' | 'waterway';
|
|
949
|
+
type TileflowRoadShieldDetail = 'none' | 'major' | 'all';
|
|
950
|
+
type TileflowLabelCollisionPriority = 'balanced' | 'navigation';
|
|
951
|
+
type TileflowRoadShieldStyles = {
|
|
952
|
+
default?: TileflowSymbolStyle;
|
|
953
|
+
detail?: TileflowSymbolStyle;
|
|
954
|
+
kinds?: Record<string, {
|
|
955
|
+
image: TileflowThemeImageValue;
|
|
956
|
+
}>;
|
|
957
|
+
overview?: TileflowSymbolStyle;
|
|
958
|
+
textColors?: Record<string, {
|
|
959
|
+
color: TileflowThemeColorValue;
|
|
960
|
+
}>;
|
|
961
|
+
};
|
|
962
|
+
type TileflowLabelStyles = {
|
|
963
|
+
aerodrome?: TileflowSymbolStyle;
|
|
964
|
+
junctions?: TileflowSymbolStyle;
|
|
965
|
+
places?: Partial<Record<TileflowPlaceLabelClass, TileflowSymbolStyle>>;
|
|
966
|
+
roads?: Partial<Record<TileflowRoadClass, TileflowSymbolStyle>>;
|
|
967
|
+
shields?: TileflowRoadShieldStyles;
|
|
968
|
+
water?: Partial<Record<TileflowWaterLabelClass, TileflowSymbolStyle>>;
|
|
969
|
+
};
|
|
970
|
+
type TileflowLabelsModuleConfig = {
|
|
971
|
+
type: 'labels';
|
|
972
|
+
aerodromeCodes?: TileflowAerodromeCodeDetail;
|
|
973
|
+
collisionPriority?: TileflowLabelCollisionPriority;
|
|
974
|
+
junctions?: boolean;
|
|
975
|
+
language?: TileflowLabelLanguage;
|
|
976
|
+
places?: TileflowLabelDetail;
|
|
977
|
+
roadClasses?: readonly TileflowRoadClass[];
|
|
978
|
+
/**
|
|
979
|
+
* Where street names draw. `foreground` (the default) keeps them above buildings and
|
|
980
|
+
* vegetation. `ground` places them below buildings, with map-aligned text by default.
|
|
981
|
+
* Ground names retain their road-class collision order, but foreground symbols are offered
|
|
982
|
+
* first by the renderer; `collisionPriority` cannot make ground names outrank those symbols.
|
|
983
|
+
* Shields and junction numbers keep their foreground placement.
|
|
984
|
+
*/
|
|
985
|
+
roadPlacement?: 'ground' | 'foreground';
|
|
986
|
+
roads?: TileflowRoadLabelDetail;
|
|
987
|
+
shields?: TileflowRoadShieldDetail;
|
|
988
|
+
styles?: TileflowLabelStyles;
|
|
989
|
+
water?: TileflowLabelDetail;
|
|
990
|
+
};
|
|
991
|
+
/** Closed editorial vocabulary emitted by Tileflow World's canonical POI projection. */
|
|
992
|
+
declare const tileflowPoiCategories: readonly ["arts-entertainment", "education", "food-drink", "landmark", "lodging", "medical", "park-nature", "public-services", "religion", "retail", "sport-leisure", "transport", "visitor-amenity"];
|
|
993
|
+
type TileflowPoiCategory = (typeof tileflowPoiCategories)[number];
|
|
994
|
+
type TileflowPoiDensity = 1 | 2 | 3 | 4 | 5;
|
|
995
|
+
type TileflowPoiColorMode = 'uniform' | 'category';
|
|
996
|
+
/**
|
|
997
|
+
* How POI categories are placed against each other. `importance` places every category in one
|
|
998
|
+
* order, by World's ranks. `categories` gives each category its own layer and places the
|
|
999
|
+
* categories in the order they are listed, the first on top; ranks order each category only.
|
|
1000
|
+
*/
|
|
1001
|
+
type TileflowPoiPlacementOrder = 'categories' | 'importance';
|
|
1002
|
+
/**
|
|
1003
|
+
* The appearance of one POI category. With the default `importance` order every category shares
|
|
1004
|
+
* one placement layer, so categories may differ only in properties MapLibre evaluates per feature
|
|
1005
|
+
* (image, size, colors, font, offsets); layer-wide properties such as zoom ranges, padding,
|
|
1006
|
+
* overlap or `optional` must match, or the module uses `placement.order: 'categories'`.
|
|
1007
|
+
*/
|
|
1008
|
+
type TileflowPoiCategoryStyle = Omit<TileflowMarkerSymbolStyle, 'priority'>;
|
|
1009
|
+
type TileflowPoiModuleConfig = {
|
|
1010
|
+
type: 'poi';
|
|
1011
|
+
categories?: readonly TileflowPoiCategory[];
|
|
1012
|
+
color?: TileflowPoiColorMode;
|
|
1013
|
+
/** One density for the whole module: World's ranks decide what each category shows. */
|
|
1014
|
+
density?: TileflowPoiDensity;
|
|
1015
|
+
icons?: boolean;
|
|
1016
|
+
labels?: boolean;
|
|
1017
|
+
minZoom?: number;
|
|
1018
|
+
placement?: {
|
|
1019
|
+
/**
|
|
1020
|
+
* Places each pictogram with its name as one unit that needs room for both. Defaults to
|
|
1021
|
+
* `false`.
|
|
1022
|
+
*/
|
|
1023
|
+
coupleIconAndLabel?: boolean;
|
|
1024
|
+
iconPadding?: number;
|
|
1025
|
+
/**
|
|
1026
|
+
* World POI `type` values whose pictogram explains them. When pictograms and names are both
|
|
1027
|
+
* drawn, every other POI needs a name, and these types are drawn as a pictogram alone.
|
|
1028
|
+
* Defaults to parking and public toilets.
|
|
1029
|
+
*/
|
|
1030
|
+
iconOnlyTypes?: readonly string[];
|
|
1031
|
+
/** Defaults to `importance`. */
|
|
1032
|
+
order?: TileflowPoiPlacementOrder;
|
|
1033
|
+
/**
|
|
1034
|
+
* With the `importance` order, POIs whose World `filter_rank` is at most this value are placed
|
|
1035
|
+
* before the map's road and place labels, and the others after them. A map that gives street
|
|
1036
|
+
* names priority over POIs (labels `collisionPriority: 'navigation'`) keeps its landmarks this
|
|
1037
|
+
* way. Unset, every POI is placed at the module's own position.
|
|
1038
|
+
*/
|
|
1039
|
+
prominentRank?: 0 | 1 | 2 | 3 | 4 | 5;
|
|
1040
|
+
textPadding?: number;
|
|
1041
|
+
};
|
|
1042
|
+
styles?: Partial<Record<TileflowPoiCategory, TileflowPoiCategoryStyle>>;
|
|
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];
|
|
1155
1054
|
};
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
/** Names from an explicitly declared seafloor_landform layer. */
|
|
1165
|
-
bathymetryLandforms?: TileflowSymbolStyle;
|
|
1166
|
-
/** Names from an explicitly declared water_name layer. */
|
|
1167
|
-
bathymetryWaterNames?: TileflowSymbolStyle;
|
|
1168
|
-
bodies?: TileflowAreaStyle;
|
|
1169
|
-
intermittent?: {
|
|
1170
|
-
bodies?: TileflowAreaStyle;
|
|
1171
|
-
waterways?: TileflowLineStyle;
|
|
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;
|
|
1172
1063
|
};
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
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>;
|
|
1177
1069
|
};
|
|
1178
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
|
+
|
|
1179
1080
|
type TileflowSemanticModules = {
|
|
1180
1081
|
addresses?: TileflowAddressesModuleConfig;
|
|
1181
1082
|
aeroways?: TileflowAerowaysModuleConfig;
|
|
@@ -1193,14 +1094,181 @@ type TileflowSemanticModules = {
|
|
|
1193
1094
|
};
|
|
1194
1095
|
type TileflowSemanticModuleName = keyof TileflowSemanticModules;
|
|
1195
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;
|
|
1196
1152
|
/**
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
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.
|
|
1200
1157
|
*/
|
|
1201
|
-
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;
|
|
1202
1187
|
|
|
1203
|
-
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
|
+
}>;
|
|
1204
1272
|
|
|
1205
1273
|
/**
|
|
1206
1274
|
* Map emphasis lets an application's own content read first: chosen modules of the map recede
|
|
@@ -1286,6 +1354,79 @@ type TileflowAtmosphereMap = {
|
|
|
1286
1354
|
*/
|
|
1287
1355
|
declare function attachTileflowAtmosphere(map: TileflowAtmosphereMap): () => void;
|
|
1288
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
|
+
|
|
1289
1430
|
/** The drawn stretch of a line and its highlights, as shares of the line's length from its start. */
|
|
1290
1431
|
type TileflowLineProgressState = Readonly<{
|
|
1291
1432
|
/** Where the drawn stretch starts, from 0 (the default) to 1. */
|
|
@@ -1484,16 +1625,26 @@ declare function readTileflowMapTileSource(map: TileflowTileSourceMap, sourceId:
|
|
|
1484
1625
|
maxzoom: number;
|
|
1485
1626
|
} | undefined;
|
|
1486
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
|
+
}>;
|
|
1487
1642
|
/**
|
|
1488
|
-
* The sun's view
|
|
1489
|
-
*
|
|
1490
|
-
*
|
|
1491
|
-
* 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.
|
|
1492
1646
|
*/
|
|
1493
|
-
declare function tileflowSunLightMatrix(direction: readonly number[], box:
|
|
1494
|
-
min: readonly number[];
|
|
1495
|
-
max: readonly number[];
|
|
1496
|
-
}>): {
|
|
1647
|
+
declare function tileflowSunLightMatrix(direction: readonly number[], box: ShadowBox, view?: ShadowView): {
|
|
1497
1648
|
matrix: Float32Array;
|
|
1498
1649
|
depth: number;
|
|
1499
1650
|
extent: number;
|
|
@@ -1532,7 +1683,7 @@ type TileflowBuildings3DOptions = Readonly<{
|
|
|
1532
1683
|
map: TileflowBuildings3DMap;
|
|
1533
1684
|
/** The theme controller, for the sun and the buildings' design in every theme. */
|
|
1534
1685
|
controller?: TileflowBuildings3DThemes;
|
|
1535
|
-
/** The zoom
|
|
1686
|
+
/** The zoom where buildings start fading in, reaching full opacity 0.25 zoom later. Defaults to 15. */
|
|
1536
1687
|
minzoom?: number;
|
|
1537
1688
|
/** The most tiles raised round the camera, from 1 to 64; defaults to 25. */
|
|
1538
1689
|
maxTiles?: number;
|
|
@@ -1575,7 +1726,7 @@ type TileflowBuildings3D = {
|
|
|
1575
1726
|
};
|
|
1576
1727
|
declare const tileflowBuildings3DLayerId = "tileflow-buildings-3d";
|
|
1577
1728
|
/**
|
|
1578
|
-
* Creates the renderer
|
|
1729
|
+
* Creates the renderer, showing buildings automatically above zoom 15 unless hidden. It reads the source's
|
|
1579
1730
|
* z15 tiles round the camera, the zoom at which World's buildings carry their heights.
|
|
1580
1731
|
*/
|
|
1581
1732
|
declare function createTileflowBuildings3D(options: TileflowBuildings3DOptions): TileflowBuildings3D;
|
|
@@ -1589,6 +1740,10 @@ type TileflowBuildingMeshOptions = Readonly<{
|
|
|
1589
1740
|
tileMetres: number;
|
|
1590
1741
|
/** Height used where a building has none, in metres; defaults to 5, World's own fallback. */
|
|
1591
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;
|
|
1592
1747
|
/**
|
|
1593
1748
|
* The tile's places (World's `poi` layer), for the night use of buildings when the tile's
|
|
1594
1749
|
* buildings do not carry World's `night_use`: a place inside a building, or on its facade, gives
|
|
@@ -1602,8 +1757,17 @@ type TileflowBuildingMeshOptions = Readonly<{
|
|
|
1602
1757
|
*/
|
|
1603
1758
|
masks?: readonly (readonly number[])[];
|
|
1604
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
|
+
};
|
|
1605
1768
|
/** One tile's buildings, ready to upload. */
|
|
1606
1769
|
type TileflowBuildingMesh = Readonly<{
|
|
1770
|
+
groups?: readonly BuildingMeshGroup[];
|
|
1607
1771
|
vertices: Uint8Array;
|
|
1608
1772
|
indices: Uint32Array;
|
|
1609
1773
|
/** The first wall index: roofs come before it, walls from it. */
|
|
@@ -1655,6 +1819,11 @@ type TileflowStreetLightsMap = {
|
|
|
1655
1819
|
};
|
|
1656
1820
|
type TileflowStreetLightsOptions = Readonly<{
|
|
1657
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;
|
|
1658
1827
|
/**
|
|
1659
1828
|
* The theme controller, whose sun switches the lights on and off and whose themes hold the map's
|
|
1660
1829
|
* street lights (the roads module's `streetLights`).
|
|
@@ -1726,7 +1895,9 @@ type TileflowBuildings3DDesign = Readonly<{
|
|
|
1726
1895
|
color: string | readonly unknown[];
|
|
1727
1896
|
/** How strongly roof outlines and outer corners catch the light, from 0 to 1. */
|
|
1728
1897
|
edges: number;
|
|
1729
|
-
/**
|
|
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. */
|
|
1730
1901
|
lighting: 'style' | 'sun';
|
|
1731
1902
|
/** Per-building brightness variation, from 0 to 1; 0 preserves the authored colour. */
|
|
1732
1903
|
colorVariation: number;
|
|
@@ -1807,7 +1978,7 @@ type TileflowTrees3DOptions = Readonly<{
|
|
|
1807
1978
|
controller?: TileflowTrees3DThemes;
|
|
1808
1979
|
/** The vector source with the canopy points, when not the map's World source. */
|
|
1809
1980
|
canopySource?: string;
|
|
1810
|
-
/** 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. */
|
|
1811
1982
|
minzoom?: number;
|
|
1812
1983
|
/** The most tiles of trees round the camera, from 1 to 64; defaults to 25. */
|
|
1813
1984
|
maxTiles?: number;
|
|
@@ -1836,7 +2007,8 @@ type TileflowTrees3D = {
|
|
|
1836
2007
|
readonly scale: number;
|
|
1837
2008
|
/**
|
|
1838
2009
|
* Whether the map's style describes 3D trees (`vegetation({mode: '3d'})`), tiles of trees,
|
|
1839
|
-
* 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.
|
|
1840
2012
|
*/
|
|
1841
2013
|
readonly stats: Readonly<{
|
|
1842
2014
|
declared: boolean;
|
|
@@ -1844,6 +2016,7 @@ type TileflowTrees3D = {
|
|
|
1844
2016
|
trees: number;
|
|
1845
2017
|
mapped: number;
|
|
1846
2018
|
canopy: number;
|
|
2019
|
+
hedges: number;
|
|
1847
2020
|
drawn: number;
|
|
1848
2021
|
}>;
|
|
1849
2022
|
/** Takes the layer off the map and lets go of its buffers. */
|
|
@@ -2476,4 +2649,4 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
|
|
|
2476
2649
|
worldRequestBridge?: TileflowWorldRequestBridge;
|
|
2477
2650
|
}): TileflowTransformRequest<TRequest, TResourceType>;
|
|
2478
2651
|
|
|
2479
|
-
export { type TileflowAtmosphereMap, 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 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, 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 };
|
|
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 };
|