@tileflow/core 0.1.0-alpha.33 → 0.1.0-alpha.34
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 +3 -0
- package/dist/browser.d.ts +478 -150
- package/dist/browser.js +6810 -4170
- package/dist/build.d.ts +12 -4
- package/dist/build.js +609 -222
- package/dist/config-reference.json +2413 -829
- package/dist/{icon-composition-CSnN2-Xt.d.ts → icon-composition-DqoZWQuz.d.ts} +189 -2
- package/dist/index.d.ts +76 -5
- package/dist/index.js +945 -250
- package/dist/{manifest-types-E7m23eXL.d.ts → manifest-types-hmzy2bBX.d.ts} +20 -1
- package/dist/manifest.d.ts +2 -2
- package/dist/runtime.d.ts +1 -1
- package/docs/application-tile-reading.md +3 -0
- package/docs/authoring-model.md +2 -1
- package/docs/buildings-3d.md +66 -62
- package/docs/street-lights.md +32 -5
- package/docs/trees-3d.md +211 -0
- package/package.json +1 -1
package/dist/browser.d.ts
CHANGED
|
@@ -420,6 +420,24 @@ type TileflowRoadRoundaboutStyle = {
|
|
|
420
420
|
casing?: TileflowCircleStyle;
|
|
421
421
|
fill?: TileflowCircleStyle;
|
|
422
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
|
+
};
|
|
423
441
|
type TileflowRoadSidewalkStyle = {
|
|
424
442
|
outline?: TileflowLineStyle;
|
|
425
443
|
pattern?: TileflowFillStyle;
|
|
@@ -441,6 +459,7 @@ type TileflowRoadsModuleConfig = {
|
|
|
441
459
|
roundabouts?: TileflowRoadRoundaboutStyle;
|
|
442
460
|
serviceTypes?: Partial<Record<TileflowRoadServiceType, TileflowRoadTreatmentStyle>>;
|
|
443
461
|
sidewalks?: TileflowRoadSidewalkStyle;
|
|
462
|
+
streetLights?: TileflowRoadStreetLightStyle;
|
|
444
463
|
structures?: Partial<Record<TileflowRoadStructure, TileflowRoadLayerStyle>>;
|
|
445
464
|
weight?: TileflowRoadWeight;
|
|
446
465
|
widthScale?: Partial<Record<TileflowRoadClass, TileflowThemeNumberValue>>;
|
|
@@ -741,11 +760,30 @@ type TileflowBoundariesModuleConfig = TileflowBoundariesModuleOptions & {
|
|
|
741
760
|
};
|
|
742
761
|
|
|
743
762
|
type TileflowBuildingMode = '3d' | 'flat';
|
|
763
|
+
/**
|
|
764
|
+
* How Core's 3D buildings renderer draws the map's buildings. Their colour is the map's own 3D
|
|
765
|
+
* building colour (its extrusion), else its roofs'.
|
|
766
|
+
*/
|
|
767
|
+
type TileflowBuildingsThreeDimensionalStyle = {
|
|
768
|
+
/** How strongly roof outlines and outer corners catch the light, from 0 (none) to 1, the default. */
|
|
769
|
+
edges?: TileflowThemeNumberValue;
|
|
770
|
+
/** Their own colour, drawn unlit; without it they take the building's colour, lightened. */
|
|
771
|
+
edgeColor?: TileflowThemeColorValue;
|
|
772
|
+
/** How bright the buildings light the street at night, from 0 (none) to 2; defaults to 1. */
|
|
773
|
+
nightLight?: TileflowThemeNumberValue;
|
|
774
|
+
/** Contact shadow at the foot of the walls and in tight corners; defaults to true. */
|
|
775
|
+
occlusion?: boolean;
|
|
776
|
+
/** Shadows from the sun, on the buildings and the flat map; defaults to true. */
|
|
777
|
+
shadows?: boolean;
|
|
778
|
+
/** Invented night windows, lit by rooms: decoration, not data. Defaults to false. */
|
|
779
|
+
windows?: boolean;
|
|
780
|
+
};
|
|
744
781
|
type TileflowBuildingsModuleOptions = {
|
|
745
782
|
businessCorridor?: TileflowAreaStyle;
|
|
746
783
|
extrusion?: TileflowExtrusionStyle;
|
|
747
784
|
flat?: TileflowAreaStyle;
|
|
748
785
|
mode?: TileflowBuildingMode;
|
|
786
|
+
threeDimensional?: TileflowBuildingsThreeDimensionalStyle;
|
|
749
787
|
};
|
|
750
788
|
type TileflowBuildingsModuleConfig = TileflowBuildingsModuleOptions & {
|
|
751
789
|
type: 'buildings';
|
|
@@ -816,13 +854,223 @@ type TileflowTransitModuleConfig = TileflowTransitModuleOptions & {
|
|
|
816
854
|
type: 'transit';
|
|
817
855
|
};
|
|
818
856
|
|
|
857
|
+
/** A prepared model, near and optionally far, as the style's tree description carries it. */
|
|
858
|
+
type TileflowTreeModel = Readonly<{
|
|
859
|
+
near: string;
|
|
860
|
+
far?: string;
|
|
861
|
+
}>;
|
|
862
|
+
|
|
863
|
+
type TileflowTileGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
864
|
+
type TileflowTileFeature = Readonly<{
|
|
865
|
+
/** The feature's id in the tile, when it has one. */
|
|
866
|
+
id?: number;
|
|
867
|
+
type: TileflowTileGeometryType;
|
|
868
|
+
properties: Readonly<Record<string, string | number | boolean>>;
|
|
869
|
+
/**
|
|
870
|
+
* One flat `[x0, y0, x1, y1, …]` array per point set, line or ring, in tile units from 0 to the
|
|
871
|
+
* layer's extent (coordinates in a tile's buffer fall outside that range). Polygon rings follow
|
|
872
|
+
* the MVT winding: an exterior ring is clockwise in tile units, a hole anticlockwise.
|
|
873
|
+
*/
|
|
874
|
+
geometry: readonly (readonly number[])[];
|
|
875
|
+
}>;
|
|
876
|
+
type TileflowTileLayer = Readonly<{
|
|
877
|
+
/** Tile units across the tile, usually 4096. */
|
|
878
|
+
extent: number;
|
|
879
|
+
features: readonly TileflowTileFeature[];
|
|
880
|
+
}>;
|
|
881
|
+
type TileflowVectorTileDecodeOptions = Readonly<{
|
|
882
|
+
/** The layers to decode; others are skipped without decoding. Defaults to every layer. */
|
|
883
|
+
layers?: readonly string[];
|
|
884
|
+
}>;
|
|
885
|
+
/** Decodes a Mapbox Vector Tile's layers. Throws on bytes that are not a vector tile. */
|
|
886
|
+
declare function decodeTileflowVectorTile(bytes: Uint8Array, options?: TileflowVectorTileDecodeOptions): Readonly<Record<string, TileflowTileLayer>>;
|
|
887
|
+
|
|
888
|
+
/** The forms a 3D tree takes. */
|
|
889
|
+
declare const tileflowTreeForms: readonly ["round", "open", "tall", "conifer", "columnar", "palm"];
|
|
890
|
+
type TileflowTreeForm = (typeof tileflowTreeForms)[number];
|
|
891
|
+
/** How a tree's surfaces take the light: facets, a smooth round shape, or bands as drawn. */
|
|
892
|
+
declare const tileflowTreeFinishes: readonly ["faceted", "smooth", "toon"];
|
|
893
|
+
type TileflowTreeFinish = (typeof tileflowTreeFinishes)[number];
|
|
894
|
+
/** A form's own scales, on top of the map's, and the map's own models it draws. */
|
|
895
|
+
type TileflowTreeFormStyle = Readonly<{
|
|
896
|
+
heightScale?: number;
|
|
897
|
+
crownScale?: number;
|
|
898
|
+
/** Ids of the map's own models, one to four; each tree draws one by its stable seed. */
|
|
899
|
+
models?: readonly string[];
|
|
900
|
+
}>;
|
|
901
|
+
/** Relative weights of the forms given to trees whose data gives none. */
|
|
902
|
+
type TileflowTreeFormMix = Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
903
|
+
/** A region whose trees without a form in the data take their own mix. */
|
|
904
|
+
type TileflowTreeRegion = Readonly<{
|
|
905
|
+
/** `[west, south, east, north]` in degrees. */
|
|
906
|
+
bounds: readonly [number, number, number, number];
|
|
907
|
+
unknownForms: TileflowTreeFormMix;
|
|
908
|
+
}>;
|
|
909
|
+
/** The fields of the tree and canopy layers, as World names them. */
|
|
910
|
+
type TileflowTreeFields = Readonly<{
|
|
911
|
+
height: string;
|
|
912
|
+
diameterCrown: string;
|
|
913
|
+
circumference: string;
|
|
914
|
+
genus: string;
|
|
915
|
+
species: string;
|
|
916
|
+
leafType: string;
|
|
917
|
+
/** The tree's taxon at any rank, such as `Arecaceae` for palms or a genus or species. */
|
|
918
|
+
taxon: string;
|
|
919
|
+
canopyRank: string;
|
|
920
|
+
canopyClearance: string;
|
|
921
|
+
canopyCover: string;
|
|
922
|
+
/** A canopy point's measured canopy height, in metres. */
|
|
923
|
+
canopyHeight: string;
|
|
924
|
+
}>;
|
|
925
|
+
type TileflowTreePlacementOptions = Readonly<{
|
|
926
|
+
/** The tile's address, for regions and for a stable look per tree. */
|
|
927
|
+
tile: Readonly<{
|
|
928
|
+
x: number;
|
|
929
|
+
y: number;
|
|
930
|
+
z: number;
|
|
931
|
+
}>;
|
|
932
|
+
/** The tile's width in metres. */
|
|
933
|
+
tileMetres: number;
|
|
934
|
+
fields?: Partial<TileflowTreeFields>;
|
|
935
|
+
unknownForms?: TileflowTreeFormMix;
|
|
936
|
+
regions?: readonly TileflowTreeRegion[];
|
|
937
|
+
/** Metres between the trees of a row; defaults to 8. */
|
|
938
|
+
rowSpacing?: number;
|
|
939
|
+
/** How many models each form draws from, 1 to 4; each tree draws one by its seed. */
|
|
940
|
+
variants?: Readonly<Partial<Record<TileflowTreeForm, number>>>;
|
|
941
|
+
}>;
|
|
942
|
+
/** A tile's layers trees come from, as World names them. */
|
|
943
|
+
type TileflowTreeLayers = Readonly<{
|
|
944
|
+
/**
|
|
945
|
+
* World's `tree`: trees mapped one by one as points, and rows of trees as lines, planted every
|
|
946
|
+
* `rowSpacing` metres.
|
|
947
|
+
*/
|
|
948
|
+
trees?: TileflowTileLayer;
|
|
949
|
+
/** Decorative canopy points in parks and gardens (World's `canopy`). */
|
|
950
|
+
canopy?: TileflowTileLayer;
|
|
951
|
+
}>;
|
|
952
|
+
/** Where some trees are in a placement, and how many of them have each rank or a lower one. */
|
|
953
|
+
type TileflowTreeRange = Readonly<{
|
|
954
|
+
start: number;
|
|
955
|
+
count: number;
|
|
956
|
+
/** `upTo[r]`: trees of the range with a rank of `r` or lower, from 0 to 15. */
|
|
957
|
+
upTo: readonly number[];
|
|
958
|
+
}>;
|
|
959
|
+
/** Where a form's trees are in a placement, and those of each of its models in turn. */
|
|
960
|
+
type TileflowTreeFormRange = TileflowTreeRange & Readonly<{
|
|
961
|
+
/** One range per model the form draws from, in order; one when it draws Core's own tree. */
|
|
962
|
+
variants: readonly TileflowTreeRange[];
|
|
963
|
+
}>;
|
|
964
|
+
/** One tile's trees, ready to upload. */
|
|
965
|
+
type TileflowTreePlacement = Readonly<{
|
|
966
|
+
/** `tileflowTreeBytes` bytes per tree, ordered by form, model, then rank; see the layout below. */
|
|
967
|
+
trees: Uint8Array;
|
|
968
|
+
forms: Readonly<Record<TileflowTreeForm, TileflowTreeFormRange>>;
|
|
969
|
+
/** The tallest tree, in metres. */
|
|
970
|
+
tallest: number;
|
|
971
|
+
/** Trees from the data's trees and rows, and trees from canopy points. */
|
|
972
|
+
mapped: number;
|
|
973
|
+
canopy: number;
|
|
974
|
+
}>;
|
|
975
|
+
/**
|
|
976
|
+
* Bytes per tree: x and y in tile units of 8192 (uint16 each), height and crown diameter in
|
|
977
|
+
* decimetres (uint16 each), then one byte each for its turn (of a full turn), its shade among the
|
|
978
|
+
* theme's colours, its form, its rank (0–15, lower shows first), a seed, whether it stands for a
|
|
979
|
+
* canopy point (1) or a mapped tree (0), the model of its form it draws, and a byte of padding.
|
|
980
|
+
*/
|
|
981
|
+
declare const tileflowTreeBytes = 16;
|
|
982
|
+
/**
|
|
983
|
+
* The form a tree's data gives it, or undefined when its data says nothing about its form: a palm
|
|
984
|
+
* by `leaf_type` or genus, a column, a conifer by `leaf_type` or genus, or one of the broadleaf
|
|
985
|
+
* forms by genus. `broadleaf` means the data says broadleaved without a known genus.
|
|
986
|
+
*/
|
|
987
|
+
declare function tileflowTreeFormOf(properties: Readonly<Record<string, unknown>>, fields?: Partial<TileflowTreeFields>): TileflowTreeForm | 'broadleaf' | undefined;
|
|
988
|
+
/** Places a tile's trees. Points in the tile's buffer belong to the neighbouring tile. */
|
|
989
|
+
declare function placeTileflowTrees(layers: TileflowTreeLayers, options: TileflowTreePlacementOptions): TileflowTreePlacement;
|
|
990
|
+
/** The style metadata key under which a compiled map describes its 3D trees. */
|
|
991
|
+
declare const tileflowVegetationMetadataKey = "tileflow:vegetation";
|
|
992
|
+
/** How a compiled map's 3D trees look and where their data is, resolved for one theme. */
|
|
993
|
+
type TileflowVegetation3D = Readonly<{
|
|
994
|
+
/** The vector source and its layers with the trees and the canopy points. */
|
|
995
|
+
source: string;
|
|
996
|
+
layers: Readonly<{
|
|
997
|
+
tree: string;
|
|
998
|
+
canopy?: string;
|
|
999
|
+
}>;
|
|
1000
|
+
fields: TileflowTreeFields;
|
|
1001
|
+
/** Sunlit colours: bark, and the leaves of each kind of tree from darkest to lightest. */
|
|
1002
|
+
colors: Readonly<{
|
|
1003
|
+
bark: string;
|
|
1004
|
+
broadleaf: readonly string[];
|
|
1005
|
+
conifer: readonly string[];
|
|
1006
|
+
palm: readonly string[];
|
|
1007
|
+
}>;
|
|
1008
|
+
heightScale: number;
|
|
1009
|
+
crownScale: number;
|
|
1010
|
+
/** Each form's own scales and models. */
|
|
1011
|
+
forms: Readonly<Partial<Record<TileflowTreeForm, TileflowTreeFormStyle>>>;
|
|
1012
|
+
/** The map's own models its forms draw, by id, prepared from its `models` directories. */
|
|
1013
|
+
models: Readonly<Record<string, TileflowTreeModel>>;
|
|
1014
|
+
finish: TileflowTreeFinish;
|
|
1015
|
+
/** How strongly an outline rings each tree, from 0 (none) to 1, and its colour. */
|
|
1016
|
+
edges: number;
|
|
1017
|
+
edgeColor?: string;
|
|
1018
|
+
unknownForms: TileflowTreeFormMix;
|
|
1019
|
+
regions: readonly TileflowTreeRegion[];
|
|
1020
|
+
/** The style's layers that draw the trees flat, which the 3D trees stand in for while shown. */
|
|
1021
|
+
flatLayers: readonly string[];
|
|
1022
|
+
}>;
|
|
1023
|
+
/**
|
|
1024
|
+
* Reads the 3D trees a compiled style describes, or undefined when its metadata has none or holds
|
|
1025
|
+
* a version or shape this Core does not know.
|
|
1026
|
+
*/
|
|
1027
|
+
declare function readTileflowVegetation3D(metadata: unknown): TileflowVegetation3D | undefined;
|
|
1028
|
+
|
|
819
1029
|
type TileflowVegetationMode = '3d' | 'flat';
|
|
820
1030
|
type TileflowVegetationThreeDimensionalStyle = {
|
|
821
1031
|
barkColor?: TileflowThemeColorValue;
|
|
1032
|
+
/** Sunlit leaf colours of broadleaf trees, from darkest to lightest; up to four are used. */
|
|
822
1033
|
broadleafColors?: readonly TileflowThemeColorValue[];
|
|
1034
|
+
/** Sunlit needle colours of conifers and columns, from darkest to lightest. */
|
|
823
1035
|
coniferColors?: readonly TileflowThemeColorValue[];
|
|
1036
|
+
/** Sunlit frond colours of palms, from darkest to lightest; the broadleaf colours by default. */
|
|
1037
|
+
palmColors?: readonly TileflowThemeColorValue[];
|
|
824
1038
|
crownScale?: TileflowThemeNumberValue;
|
|
825
1039
|
heightScale?: TileflowThemeNumberValue;
|
|
1040
|
+
/**
|
|
1041
|
+
* How trees take the light: `faceted` (the default), low-poly facets softened towards a round
|
|
1042
|
+
* crown; `smooth`, round crowns; or `toon`, three bands of light and a crisp shadow, as a drawn
|
|
1043
|
+
* tree has them.
|
|
1044
|
+
*/
|
|
1045
|
+
finish?: TileflowTreeFinish;
|
|
1046
|
+
/** How strongly an outline rings each tree, from 0 (none, the default) to 1. */
|
|
1047
|
+
edges?: TileflowThemeNumberValue;
|
|
1048
|
+
/** The outline's colour; the crown's darkest colour, deepened, by default. */
|
|
1049
|
+
edgeColor?: TileflowThemeColorValue;
|
|
1050
|
+
/**
|
|
1051
|
+
* Each form's own scales, on top of `heightScale` and `crownScale`, such as taller palms, and the
|
|
1052
|
+
* map's own models it draws: ids of `.glb` files in the map's `models` directories, one to four,
|
|
1053
|
+
* each tree drawing one. A model's materials named `bark`, `leaves`, `fronds` or `stem` take
|
|
1054
|
+
* those parts' colours.
|
|
1055
|
+
*/
|
|
1056
|
+
forms?: Partial<Record<TileflowTreeForm, {
|
|
1057
|
+
heightScale?: TileflowThemeNumberValue;
|
|
1058
|
+
crownScale?: TileflowThemeNumberValue;
|
|
1059
|
+
models?: readonly string[];
|
|
1060
|
+
}>>;
|
|
1061
|
+
/**
|
|
1062
|
+
* The forms of trees whose data gives none, as relative weights: `round`, `open` and `tall`
|
|
1063
|
+
* (broadleaf), `conifer`, `columnar` and `palm`. Each tree draws one from a stable hash, so it
|
|
1064
|
+
* keeps its form everywhere. Defaults to the three broadleaf forms, evenly. A tree the data calls
|
|
1065
|
+
* broadleaved keeps to the broadleaf forms of the mix.
|
|
1066
|
+
*/
|
|
1067
|
+
unknownForms?: TileflowTreeFormMix;
|
|
1068
|
+
/**
|
|
1069
|
+
* Regions whose trees without a form in the data take their own mix, such as palms along a
|
|
1070
|
+
* subtropical coast. Bounds are `[west, south, east, north]` in degrees; the first region holding
|
|
1071
|
+
* a tree applies. At most 16.
|
|
1072
|
+
*/
|
|
1073
|
+
regions?: readonly TileflowTreeRegion[];
|
|
826
1074
|
};
|
|
827
1075
|
type TileflowVegetationModuleOptions = {
|
|
828
1076
|
flat?: TileflowCircleStyle;
|
|
@@ -1062,31 +1310,6 @@ type TileflowLineProgressController = {
|
|
|
1062
1310
|
*/
|
|
1063
1311
|
declare function createTileflowLineProgress(map: TileflowLineProgressMap, options: TileflowLineProgressOptions): TileflowLineProgressController;
|
|
1064
1312
|
|
|
1065
|
-
type TileflowTileGeometryType = 'Point' | 'LineString' | 'Polygon';
|
|
1066
|
-
type TileflowTileFeature = Readonly<{
|
|
1067
|
-
/** The feature's id in the tile, when it has one. */
|
|
1068
|
-
id?: number;
|
|
1069
|
-
type: TileflowTileGeometryType;
|
|
1070
|
-
properties: Readonly<Record<string, string | number | boolean>>;
|
|
1071
|
-
/**
|
|
1072
|
-
* One flat `[x0, y0, x1, y1, …]` array per point set, line or ring, in tile units from 0 to the
|
|
1073
|
-
* layer's extent (coordinates in a tile's buffer fall outside that range). Polygon rings follow
|
|
1074
|
-
* the MVT winding: an exterior ring is clockwise in tile units, a hole anticlockwise.
|
|
1075
|
-
*/
|
|
1076
|
-
geometry: readonly (readonly number[])[];
|
|
1077
|
-
}>;
|
|
1078
|
-
type TileflowTileLayer = Readonly<{
|
|
1079
|
-
/** Tile units across the tile, usually 4096. */
|
|
1080
|
-
extent: number;
|
|
1081
|
-
features: readonly TileflowTileFeature[];
|
|
1082
|
-
}>;
|
|
1083
|
-
type TileflowVectorTileDecodeOptions = Readonly<{
|
|
1084
|
-
/** The layers to decode; others are skipped without decoding. Defaults to every layer. */
|
|
1085
|
-
layers?: readonly string[];
|
|
1086
|
-
}>;
|
|
1087
|
-
/** Decodes a Mapbox Vector Tile's layers. Throws on bytes that are not a vector tile. */
|
|
1088
|
-
declare function decodeTileflowVectorTile(bytes: Uint8Array, options?: TileflowVectorTileDecodeOptions): Readonly<Record<string, TileflowTileLayer>>;
|
|
1089
|
-
|
|
1090
1313
|
type TileflowTileAddress = Readonly<{
|
|
1091
1314
|
z: number;
|
|
1092
1315
|
x: number;
|
|
@@ -1117,7 +1340,10 @@ type TileflowTileReaderOptions = Readonly<{
|
|
|
1117
1340
|
concurrency?: number;
|
|
1118
1341
|
/** The map's request rules, applied to every tile request. */
|
|
1119
1342
|
transformRequest?: TileflowTileRequestTransform;
|
|
1120
|
-
/**
|
|
1343
|
+
/**
|
|
1344
|
+
* Defaults to the global `fetch`, and to Core's PMTiles protocol for a source served from a
|
|
1345
|
+
* Tileflow PMTiles archive (`tileflow-pmtiles://`).
|
|
1346
|
+
*/
|
|
1121
1347
|
fetch?: (url: string, init: RequestInit) => Promise<Response>;
|
|
1122
1348
|
}>;
|
|
1123
1349
|
type TileflowTileAreaRequest = Readonly<{
|
|
@@ -1162,6 +1388,21 @@ declare function readTileflowMapTileSource(map: TileflowTileSourceMap, sourceId:
|
|
|
1162
1388
|
maxzoom: number;
|
|
1163
1389
|
} | undefined;
|
|
1164
1390
|
|
|
1391
|
+
/**
|
|
1392
|
+
* The sun's view of a box of buildings: an orthographic projection along `direction` (towards the
|
|
1393
|
+
* sun; x east, y north, z up, in metres) as a column-major matrix to clip space, with the metres its
|
|
1394
|
+
* depth runs over and the metres its wider side spans. It follows only the sun, never the camera,
|
|
1395
|
+
* so shadows hold still while the camera moves.
|
|
1396
|
+
*/
|
|
1397
|
+
declare function tileflowSunLightMatrix(direction: readonly number[], box: Readonly<{
|
|
1398
|
+
min: readonly number[];
|
|
1399
|
+
max: readonly number[];
|
|
1400
|
+
}>): {
|
|
1401
|
+
matrix: Float32Array;
|
|
1402
|
+
depth: number;
|
|
1403
|
+
extent: number;
|
|
1404
|
+
};
|
|
1405
|
+
|
|
1165
1406
|
/** The MapLibre GL JS map capabilities the renderer uses. */
|
|
1166
1407
|
type TileflowBuildings3DMap = {
|
|
1167
1408
|
addLayer(layer: object, beforeId?: string): unknown;
|
|
@@ -1182,64 +1423,18 @@ type TileflowBuildings3DMap = {
|
|
|
1182
1423
|
removeLayer(id: string): unknown;
|
|
1183
1424
|
triggerRepaint(): unknown;
|
|
1184
1425
|
};
|
|
1185
|
-
/** Where the renderer reads the sun and the
|
|
1426
|
+
/** Where the renderer reads the sun and the map's design: a Tileflow theme controller. */
|
|
1186
1427
|
type TileflowBuildings3DThemes = {
|
|
1187
|
-
getBlend?(): {
|
|
1188
|
-
position: number;
|
|
1189
|
-
themes: readonly string[];
|
|
1190
|
-
} | undefined;
|
|
1191
|
-
getCurrent?(): {
|
|
1192
|
-
theme?: string;
|
|
1193
|
-
};
|
|
1194
1428
|
getSun?(): TileflowSun;
|
|
1429
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
1430
|
+
values: readonly unknown[];
|
|
1431
|
+
position: number;
|
|
1432
|
+
}>;
|
|
1195
1433
|
};
|
|
1196
1434
|
type TileflowBuildings3DOptions = Readonly<{
|
|
1197
1435
|
map: TileflowBuildings3DMap;
|
|
1198
|
-
/** The theme controller, for the sun and
|
|
1436
|
+
/** The theme controller, for the sun and the buildings' design in every theme. */
|
|
1199
1437
|
controller?: TileflowBuildings3DThemes;
|
|
1200
|
-
/** The vector source to read; defaults to `tileflow`, a Tileflow map's World source. */
|
|
1201
|
-
source?: string;
|
|
1202
|
-
/** The source layer with the buildings; defaults to `building`. */
|
|
1203
|
-
sourceLayer?: string;
|
|
1204
|
-
/**
|
|
1205
|
-
* The source layer with the places, for the night use of buildings in tiles whose buildings do
|
|
1206
|
-
* not carry World's `night_use`; defaults to `poi`.
|
|
1207
|
-
*/
|
|
1208
|
-
placesLayer?: string;
|
|
1209
|
-
/**
|
|
1210
|
-
* A building's colour for a theme, from its feature properties, as a CSS colour. Each building
|
|
1211
|
-
* is coloured once per theme, and the renderer mixes the colours of the themes either side of
|
|
1212
|
-
* a blend's position. Without it, buildings take the theme's 3D building colour.
|
|
1213
|
-
*/
|
|
1214
|
-
color?: (properties: Readonly<Record<string, string | number | boolean>>, theme: string) => string;
|
|
1215
|
-
/** Shadows from the sun, on the buildings and the flat map; defaults to true. */
|
|
1216
|
-
shadows?: boolean;
|
|
1217
|
-
/** Contact shadow at the foot of the walls and in tight corners; defaults to true. */
|
|
1218
|
-
occlusion?: boolean;
|
|
1219
|
-
/**
|
|
1220
|
-
* How bright the buildings light the street at night, from 0 (none) to 2; defaults to 1, a quiet
|
|
1221
|
-
* light. Landmarks (World's `building_tone`) and towers are flood-lit at their foot, and buildings
|
|
1222
|
-
* with places busy at night (World's `night_use`) light their ground floor windows and the
|
|
1223
|
-
* pavement in front: bars and clubs in neon or a warm light, theatres and cinemas in white,
|
|
1224
|
-
* places to eat in amber.
|
|
1225
|
-
*/
|
|
1226
|
-
nightLight?: number;
|
|
1227
|
-
/**
|
|
1228
|
-
* How strongly roof outlines and buildings' outer corners catch the light, from 0 (none) to 1;
|
|
1229
|
-
* defaults to 1. They keep a constant width on screen, so where one building ends and the next
|
|
1230
|
-
* starts stays legible at any distance, at night most of all.
|
|
1231
|
-
*/
|
|
1232
|
-
edges?: number;
|
|
1233
|
-
/**
|
|
1234
|
-
* The colour of roof outlines and outer corners, as a CSS colour or per theme, drawn as it is,
|
|
1235
|
-
* unlit, at the full `edges` strength by day and night. The renderer asks for each theme's colour
|
|
1236
|
-
* once and mixes the colours of the themes either side of a blend's position; a theme without a
|
|
1237
|
-
* valid colour keeps the default. Without it, edges take the building's own colour, lightened as
|
|
1238
|
-
* if catching the light, half as strong by day as at night.
|
|
1239
|
-
*/
|
|
1240
|
-
edgeColor?: string | ((theme: string) => string);
|
|
1241
|
-
/** Invented night windows, lit by rooms; decoration, not data. Defaults to false. */
|
|
1242
|
-
windows?: boolean;
|
|
1243
1438
|
/** The zoom from which buildings stand; below it they sink into the flat map. Defaults to 14.5. */
|
|
1244
1439
|
minzoom?: number;
|
|
1245
1440
|
/** The most tiles raised round the camera, from 1 to 64; defaults to 25. */
|
|
@@ -1263,8 +1458,12 @@ type TileflowBuildings3D = {
|
|
|
1263
1458
|
grow(scale: number, options?: TileflowBuildings3DChange): Promise<void>;
|
|
1264
1459
|
/** The height scale shown now. */
|
|
1265
1460
|
readonly scale: number;
|
|
1266
|
-
/**
|
|
1461
|
+
/**
|
|
1462
|
+
* Whether the map's style describes its 3D buildings (the buildings module's
|
|
1463
|
+
* `threeDimensional`), tiles raised, buildings and vertices, for diagnostics.
|
|
1464
|
+
*/
|
|
1267
1465
|
readonly stats: Readonly<{
|
|
1466
|
+
declared: boolean;
|
|
1268
1467
|
tiles: number;
|
|
1269
1468
|
buildings: number;
|
|
1270
1469
|
vertices: number;
|
|
@@ -1278,20 +1477,6 @@ declare const tileflowBuildings3DLayerId = "tileflow-buildings-3d";
|
|
|
1278
1477
|
* z15 tiles round the camera, the zoom at which World's buildings carry their heights.
|
|
1279
1478
|
*/
|
|
1280
1479
|
declare function createTileflowBuildings3D(options: TileflowBuildings3DOptions): TileflowBuildings3D;
|
|
1281
|
-
/**
|
|
1282
|
-
* The sun's view of a box of buildings: an orthographic projection along `direction` (towards the
|
|
1283
|
-
* sun; x east, y north, z up, in metres) as a column-major matrix to clip space, with the metres its
|
|
1284
|
-
* depth runs over and the metres its wider side spans. It follows only the sun, never the camera,
|
|
1285
|
-
* so shadows hold still while the camera moves.
|
|
1286
|
-
*/
|
|
1287
|
-
declare function tileflowSunLightMatrix(direction: readonly number[], box: Readonly<{
|
|
1288
|
-
min: readonly number[];
|
|
1289
|
-
max: readonly number[];
|
|
1290
|
-
}>): {
|
|
1291
|
-
matrix: Float32Array;
|
|
1292
|
-
depth: number;
|
|
1293
|
-
extent: number;
|
|
1294
|
-
};
|
|
1295
1480
|
|
|
1296
1481
|
/** The renderer's tile units: MapLibre projects custom layers' tiles over 8192. */
|
|
1297
1482
|
declare const tileflowBuildingExtent = 8192;
|
|
@@ -1340,47 +1525,6 @@ type TileflowBuildingMesh = Readonly<{
|
|
|
1340
1525
|
*/
|
|
1341
1526
|
declare function meshTileflowBuildings(layer: TileflowTileLayer, options: TileflowBuildingMeshOptions): TileflowBuildingMesh | undefined;
|
|
1342
1527
|
|
|
1343
|
-
/** Bytes per lamp; see `placeTileflowStreetLights` for the layout. */
|
|
1344
|
-
declare const tileflowStreetLightBytes = 12;
|
|
1345
|
-
/**
|
|
1346
|
-
* Where light is estimated where the data maps no lamps: `lit` (the default) along the streets and
|
|
1347
|
-
* pavements the data maps as lit; `streets` also along the streets the data says nothing about,
|
|
1348
|
-
* wherever it maps few lamps, which invents light as night windows do; `none` nowhere, so only
|
|
1349
|
-
* mapped lamps shine.
|
|
1350
|
-
*/
|
|
1351
|
-
type TileflowStreetLightEstimate = 'streets' | 'lit' | 'none';
|
|
1352
|
-
type TileflowStreetLightPlacementOptions = Readonly<{
|
|
1353
|
-
/** The tile's width in metres. */
|
|
1354
|
-
tileMetres: number;
|
|
1355
|
-
/** Defaults to `lit`. */
|
|
1356
|
-
estimate?: TileflowStreetLightEstimate;
|
|
1357
|
-
}>;
|
|
1358
|
-
/** A tile's layers the lamps come from, as World names them. */
|
|
1359
|
-
type TileflowStreetLightLayers = Readonly<{
|
|
1360
|
-
/** Points with `subclass` `street_lamp` (World's `street_furniture`). */
|
|
1361
|
-
streetFurniture?: TileflowTileLayer;
|
|
1362
|
-
/** Streets by `class`, with `lit` where mapped (World's `transportation`). */
|
|
1363
|
-
transportation?: TileflowTileLayer;
|
|
1364
|
-
/** Pavements, as lines or areas, with `lit` where mapped (World's `sidewalk`). */
|
|
1365
|
-
sidewalks?: TileflowTileLayer;
|
|
1366
|
-
}>;
|
|
1367
|
-
/** One tile's lamps, ready to upload. */
|
|
1368
|
-
type TileflowStreetLightPlacement = Readonly<{
|
|
1369
|
-
lamps: Uint8Array;
|
|
1370
|
-
/** Lamps from the data. */
|
|
1371
|
-
mapped: number;
|
|
1372
|
-
/** Points of soft light estimated along streets. */
|
|
1373
|
-
estimated: number;
|
|
1374
|
-
}>;
|
|
1375
|
-
/**
|
|
1376
|
-
* Places one tile's lamps and estimated light, or returns undefined when it has none. Each is a
|
|
1377
|
-
* point of light, flagged as mapped or estimated. Layout: 0 position in the
|
|
1378
|
-
* tile, 0 to 8192 (uint16 ×2); 4 height in decimetres (uint16); 6 the reach of its light on the
|
|
1379
|
-
* ground in metres (uint8); 7 flags (uint8: bit 0 mapped, bit 1 its own colour); 8 its colour
|
|
1380
|
-
* (uint8 ×3, sRGB); 11 a seed (uint8, normalised).
|
|
1381
|
-
*/
|
|
1382
|
-
declare function placeTileflowStreetLights(layers: TileflowStreetLightLayers, options: TileflowStreetLightPlacementOptions): TileflowStreetLightPlacement | undefined;
|
|
1383
|
-
|
|
1384
1528
|
/** The MapLibre GL JS map capabilities the street lights use. */
|
|
1385
1529
|
type TileflowStreetLightsMap = {
|
|
1386
1530
|
addLayer(layer: object, beforeId?: string): unknown;
|
|
@@ -1402,23 +1546,17 @@ type TileflowStreetLightsMap = {
|
|
|
1402
1546
|
};
|
|
1403
1547
|
type TileflowStreetLightsOptions = Readonly<{
|
|
1404
1548
|
map: TileflowStreetLightsMap;
|
|
1405
|
-
/**
|
|
1549
|
+
/**
|
|
1550
|
+
* The theme controller, whose sun switches the lights on and off and whose themes hold the map's
|
|
1551
|
+
* street lights (the roads module's `streetLights`).
|
|
1552
|
+
*/
|
|
1406
1553
|
controller?: {
|
|
1407
1554
|
getSun?(): TileflowSun;
|
|
1555
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
1556
|
+
values: readonly unknown[];
|
|
1557
|
+
position: number;
|
|
1558
|
+
}>;
|
|
1408
1559
|
};
|
|
1409
|
-
/** The vector source to read; defaults to `tileflow`, a Tileflow map's World source. */
|
|
1410
|
-
source?: string;
|
|
1411
|
-
/**
|
|
1412
|
-
* Where soft light is estimated where the data maps no lamps: `lit` (the default) along the
|
|
1413
|
-
* streets and pavements the data maps as lit; `streets` also along the streets the data says
|
|
1414
|
-
* nothing about, wherever it maps few lamps, which invents light as night windows do; `none`
|
|
1415
|
-
* nowhere, so only mapped lamps shine.
|
|
1416
|
-
*/
|
|
1417
|
-
estimate?: TileflowStreetLightEstimate;
|
|
1418
|
-
/** The light of the lamps whose data gives no colour, as a CSS colour; a warm white by default. */
|
|
1419
|
-
color?: string;
|
|
1420
|
-
/** How bright the lights shine, from 0 to 2; defaults to 1. */
|
|
1421
|
-
intensity?: number;
|
|
1422
1560
|
/** The zoom from which the lights shine. Defaults to 14. */
|
|
1423
1561
|
minzoom?: number;
|
|
1424
1562
|
/** The most tiles lit round the camera, from 1 to 64; defaults to 25. */
|
|
@@ -1431,8 +1569,12 @@ type TileflowStreetLightsOptions = Readonly<{
|
|
|
1431
1569
|
type TileflowStreetLights = {
|
|
1432
1570
|
/** How far the lights have switched on, from 0 by day to 1 at night. */
|
|
1433
1571
|
readonly on: number;
|
|
1434
|
-
/**
|
|
1572
|
+
/**
|
|
1573
|
+
* Whether the map's style describes its street lights, tiles lit, lamps, and how many of them the
|
|
1574
|
+
* data maps or the layer estimates.
|
|
1575
|
+
*/
|
|
1435
1576
|
readonly stats: Readonly<{
|
|
1577
|
+
declared: boolean;
|
|
1436
1578
|
tiles: number;
|
|
1437
1579
|
lamps: number;
|
|
1438
1580
|
mapped: number;
|
|
@@ -1448,6 +1590,182 @@ declare const tileflowStreetLightsLayerId = "tileflow-street-lights";
|
|
|
1448
1590
|
*/
|
|
1449
1591
|
declare function createTileflowStreetLights(options: TileflowStreetLightsOptions): TileflowStreetLights;
|
|
1450
1592
|
|
|
1593
|
+
/** The style metadata key under which a compiled map describes its 3D buildings. */
|
|
1594
|
+
declare const tileflowBuildingsMetadataKey = "tileflow:buildings";
|
|
1595
|
+
/** A compiled map's 3D buildings, resolved for one theme. */
|
|
1596
|
+
type TileflowBuildings3DDesign = Readonly<{
|
|
1597
|
+
/** The vector source and its layers with the buildings and the places they hold. */
|
|
1598
|
+
source: string;
|
|
1599
|
+
layers: Readonly<{
|
|
1600
|
+
building: string;
|
|
1601
|
+
places?: string;
|
|
1602
|
+
}>;
|
|
1603
|
+
/**
|
|
1604
|
+
* Each building's colour: a CSS colour, or a MapLibre expression over the building's
|
|
1605
|
+
* properties that gives one, as the map colours its 3D buildings (or its roofs).
|
|
1606
|
+
*/
|
|
1607
|
+
color: string | readonly unknown[];
|
|
1608
|
+
/** How strongly roof outlines and outer corners catch the light, from 0 to 1. */
|
|
1609
|
+
edges: number;
|
|
1610
|
+
/** Their own colour, drawn unlit; without it they take the building's colour, lightened. */
|
|
1611
|
+
edgeColor?: string;
|
|
1612
|
+
/** How bright the buildings light the street at night, from 0 to 2. */
|
|
1613
|
+
nightLight: number;
|
|
1614
|
+
/** Invented night windows, lit by rooms: decoration, not data. */
|
|
1615
|
+
windows: boolean;
|
|
1616
|
+
/** Shadows from the sun, and contact shadow at the foot of the walls. */
|
|
1617
|
+
shadows: boolean;
|
|
1618
|
+
occlusion: boolean;
|
|
1619
|
+
}>;
|
|
1620
|
+
/**
|
|
1621
|
+
* Reads the 3D buildings a compiled style describes, or undefined when its metadata has none or a
|
|
1622
|
+
* version or shape this Core does not know.
|
|
1623
|
+
*/
|
|
1624
|
+
declare function readTileflowBuildings3D(metadata: unknown): TileflowBuildings3DDesign | undefined;
|
|
1625
|
+
|
|
1626
|
+
/** The MapLibre GL JS map capabilities the trees use. */
|
|
1627
|
+
type TileflowTrees3DMap = {
|
|
1628
|
+
addLayer(layer: object, beforeId?: string): unknown;
|
|
1629
|
+
getBearing(): number;
|
|
1630
|
+
getCenter(): {
|
|
1631
|
+
lat: number;
|
|
1632
|
+
lng: number;
|
|
1633
|
+
};
|
|
1634
|
+
getLayer(id: string): unknown;
|
|
1635
|
+
getLayoutProperty?(layer: string, name: string): unknown;
|
|
1636
|
+
getPitch(): number;
|
|
1637
|
+
getSource(id: string): unknown;
|
|
1638
|
+
getStyle(): unknown;
|
|
1639
|
+
getZoom(): number;
|
|
1640
|
+
isStyleLoaded(): boolean | void;
|
|
1641
|
+
off(event: string, listener: () => void): unknown;
|
|
1642
|
+
on(event: string, listener: () => void): unknown;
|
|
1643
|
+
removeLayer(id: string): unknown;
|
|
1644
|
+
setLayoutProperty?(layer: string, name: string, value: unknown): unknown;
|
|
1645
|
+
triggerRepaint(): unknown;
|
|
1646
|
+
};
|
|
1647
|
+
/** Where the trees read the sun and the map's design: a Tileflow theme controller. */
|
|
1648
|
+
type TileflowTrees3DThemes = {
|
|
1649
|
+
getSun?(): TileflowSun;
|
|
1650
|
+
getThemeMetadata?(key: string): Readonly<{
|
|
1651
|
+
values: readonly unknown[];
|
|
1652
|
+
position: number;
|
|
1653
|
+
}>;
|
|
1654
|
+
};
|
|
1655
|
+
type TileflowTrees3DOptions = Readonly<{
|
|
1656
|
+
map: TileflowTrees3DMap;
|
|
1657
|
+
/** The theme controller, for the sun and the trees' colours in every theme. */
|
|
1658
|
+
controller?: TileflowTrees3DThemes;
|
|
1659
|
+
/** The vector source with the canopy points, when not the map's World source. */
|
|
1660
|
+
canopySource?: string;
|
|
1661
|
+
/** The zoom from which trees stand; they fade in over the zoom above it. Defaults to 15. */
|
|
1662
|
+
minzoom?: number;
|
|
1663
|
+
/** The most tiles of trees round the camera, from 1 to 64; defaults to 25. */
|
|
1664
|
+
maxTiles?: number;
|
|
1665
|
+
/** The layer to draw before; defaults to the style's `above-buildings` placement. */
|
|
1666
|
+
beforeId?: string;
|
|
1667
|
+
/** The map's request rules, for the tiles the layer reads. */
|
|
1668
|
+
transformRequest?: TileflowTileRequestTransform;
|
|
1669
|
+
}>;
|
|
1670
|
+
type TileflowTrees3DChange = Readonly<{
|
|
1671
|
+
transition?: Readonly<{
|
|
1672
|
+
duration?: number;
|
|
1673
|
+
}>;
|
|
1674
|
+
}>;
|
|
1675
|
+
type TileflowTrees3D = {
|
|
1676
|
+
/** Grows the trees out of the ground; resolves once they stand. */
|
|
1677
|
+
show(options?: TileflowTrees3DChange): Promise<void>;
|
|
1678
|
+
/** Sinks the trees back into the ground; resolves once they are gone. */
|
|
1679
|
+
hide(options?: TileflowTrees3DChange): Promise<void>;
|
|
1680
|
+
/** Eases the trees to `scale` of their size, from 0 (none) to 1. */
|
|
1681
|
+
grow(scale: number, options?: TileflowTrees3DChange): Promise<void>;
|
|
1682
|
+
/** The size scale shown now. */
|
|
1683
|
+
readonly scale: number;
|
|
1684
|
+
/**
|
|
1685
|
+
* 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 last frame.
|
|
1687
|
+
*/
|
|
1688
|
+
readonly stats: Readonly<{
|
|
1689
|
+
declared: boolean;
|
|
1690
|
+
tiles: number;
|
|
1691
|
+
trees: number;
|
|
1692
|
+
mapped: number;
|
|
1693
|
+
canopy: number;
|
|
1694
|
+
drawn: number;
|
|
1695
|
+
}>;
|
|
1696
|
+
/** Takes the layer off the map and lets go of its buffers. */
|
|
1697
|
+
dispose(): void;
|
|
1698
|
+
};
|
|
1699
|
+
declare const tileflowTrees3DLayerId = "tileflow-trees-3d";
|
|
1700
|
+
/**
|
|
1701
|
+
* Creates the trees and puts their layer on the map, sunk in the ground until `show()`. They read
|
|
1702
|
+
* the source's z15 tiles round the camera, where World carries its trees and canopy points.
|
|
1703
|
+
*/
|
|
1704
|
+
declare function createTileflowTrees3D(options: TileflowTrees3DOptions): TileflowTrees3D;
|
|
1705
|
+
|
|
1706
|
+
/** Bytes per lamp; see `placeTileflowStreetLights` for the layout. */
|
|
1707
|
+
declare const tileflowStreetLightBytes = 12;
|
|
1708
|
+
/**
|
|
1709
|
+
* Where light is estimated where the data maps no lamps: `lit` (the default) along the streets and
|
|
1710
|
+
* pavements the data maps as lit; `streets` also along the streets the data says nothing about,
|
|
1711
|
+
* wherever it maps few lamps, which invents light as night windows do; `none` nowhere, so only
|
|
1712
|
+
* mapped lamps shine.
|
|
1713
|
+
*/
|
|
1714
|
+
type TileflowStreetLightEstimate = 'streets' | 'lit' | 'none';
|
|
1715
|
+
type TileflowStreetLightPlacementOptions = Readonly<{
|
|
1716
|
+
/** The tile's width in metres. */
|
|
1717
|
+
tileMetres: number;
|
|
1718
|
+
/** Defaults to `lit`. */
|
|
1719
|
+
estimate?: TileflowStreetLightEstimate;
|
|
1720
|
+
}>;
|
|
1721
|
+
/** A tile's layers the lamps come from, as World names them. */
|
|
1722
|
+
type TileflowStreetLightLayers = Readonly<{
|
|
1723
|
+
/** Points with `subclass` `street_lamp` (World's `street_furniture`). */
|
|
1724
|
+
streetFurniture?: TileflowTileLayer;
|
|
1725
|
+
/** Streets by `class`, with `lit` where mapped (World's `transportation`). */
|
|
1726
|
+
transportation?: TileflowTileLayer;
|
|
1727
|
+
/** Pavements, as lines or areas, with `lit` where mapped (World's `sidewalk`). */
|
|
1728
|
+
sidewalks?: TileflowTileLayer;
|
|
1729
|
+
}>;
|
|
1730
|
+
/** One tile's lamps, ready to upload. */
|
|
1731
|
+
type TileflowStreetLightPlacement = Readonly<{
|
|
1732
|
+
lamps: Uint8Array;
|
|
1733
|
+
/** Lamps from the data. */
|
|
1734
|
+
mapped: number;
|
|
1735
|
+
/** Points of soft light estimated along streets. */
|
|
1736
|
+
estimated: number;
|
|
1737
|
+
}>;
|
|
1738
|
+
/**
|
|
1739
|
+
* Places one tile's lamps and estimated light, or returns undefined when it has none. Each is a
|
|
1740
|
+
* point of light, flagged as mapped or estimated. Layout: 0 position in the
|
|
1741
|
+
* tile, 0 to 8192 (uint16 ×2); 4 height in decimetres (uint16); 6 the reach of its light on the
|
|
1742
|
+
* ground in metres (uint8); 7 flags (uint8: bit 0 mapped, bit 1 its own colour); 8 its colour
|
|
1743
|
+
* (uint8 ×3, sRGB); 11 a seed (uint8, normalised).
|
|
1744
|
+
*/
|
|
1745
|
+
declare function placeTileflowStreetLights(layers: TileflowStreetLightLayers, options: TileflowStreetLightPlacementOptions): TileflowStreetLightPlacement | undefined;
|
|
1746
|
+
/** The style metadata key under which a compiled map describes its street lights. */
|
|
1747
|
+
declare const tileflowStreetLightsMetadataKey = "tileflow:street-lights";
|
|
1748
|
+
/** A compiled map's street lights, as the roads module describes them, resolved for one theme. */
|
|
1749
|
+
type TileflowStreetLightsDesign = Readonly<{
|
|
1750
|
+
/** The vector source and its layers with the lamps, the streets and the pavements. */
|
|
1751
|
+
source: string;
|
|
1752
|
+
layers: Readonly<{
|
|
1753
|
+
streetFurniture: string;
|
|
1754
|
+
transportation: string;
|
|
1755
|
+
sidewalk?: string;
|
|
1756
|
+
}>;
|
|
1757
|
+
estimate: TileflowStreetLightEstimate;
|
|
1758
|
+
/** The light of lamps whose data gives no colour, as a CSS colour. */
|
|
1759
|
+
color: string;
|
|
1760
|
+
/** How bright the lights shine, from 0 to 2. */
|
|
1761
|
+
intensity: number;
|
|
1762
|
+
}>;
|
|
1763
|
+
/**
|
|
1764
|
+
* Reads the street lights a compiled style describes, or undefined when its metadata has none or a
|
|
1765
|
+
* version or shape this Core does not know.
|
|
1766
|
+
*/
|
|
1767
|
+
declare function readTileflowStreetLights(metadata: unknown): TileflowStreetLightsDesign | undefined;
|
|
1768
|
+
|
|
1451
1769
|
/** The capabilities `tileflowGroundBeforeId` reads; importing this module never loads a renderer. */
|
|
1452
1770
|
type TileflowGroundOrderMap = {
|
|
1453
1771
|
getLayer(id: string): unknown;
|
|
@@ -1834,6 +2152,16 @@ type TileflowThemeController = {
|
|
|
1834
2152
|
getRouteInks(): TileflowRouteInks;
|
|
1835
2153
|
/** The value a style state was set to last, or undefined when it has not been set. */
|
|
1836
2154
|
getState(name: string): TileflowStyleStateValue | undefined;
|
|
2155
|
+
/**
|
|
2156
|
+
* What the compiled styles on screen hold under a metadata key, for an application's own layers
|
|
2157
|
+
* drawn in the map's design (Core's 3D trees read their colours this way): one value outside a
|
|
2158
|
+
* blend, and during a blend one per blended theme, in order, with the blend's position, so a layer
|
|
2159
|
+
* can mix them as the map does. A style without the key gives undefined in its place.
|
|
2160
|
+
*/
|
|
2161
|
+
getThemeMetadata(key: string): Readonly<{
|
|
2162
|
+
values: readonly unknown[];
|
|
2163
|
+
position: number;
|
|
2164
|
+
}>;
|
|
1837
2165
|
/**
|
|
1838
2166
|
* The sun the map shows, for an application's own 3D layers: its direction, the light it and
|
|
1839
2167
|
* the sky give, and how dark its shadows fall. It is the theme's sun (`lighting.sun`), mixed
|
|
@@ -1951,4 +2279,4 @@ declare function createTileflowTransformRequest<TRequest extends TileflowTransfo
|
|
|
1951
2279
|
worldRequestBridge?: TileflowWorldRequestBridge;
|
|
1952
2280
|
}): TileflowTransformRequest<TRequest, TResourceType>;
|
|
1953
2281
|
|
|
1954
|
-
export { type TileflowAtmosphereMap, type TileflowBrowserThemeBlendSelection, type TileflowBuildingMesh, type TileflowBuildingMeshOptions, type TileflowBuildings3D, type TileflowBuildings3DChange, 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 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 TileflowUserTransformRequest, type TileflowVectorTileDecodeOptions, type TileflowWorldProtocolHandler, type TileflowWorldProtocolRequest, type TileflowWorldProtocolResponse, type TileflowWorldRequestBridge, attachTileflowAtmosphere, attachTileflowFairUseNotice, attachTileflowMapLifecycle, createTileflowBuildings3D, createTileflowDepthMarkers, createTileflowGroundLayers, createTileflowLineProgress, createTileflowSessionStarter, createTileflowStreetLights, createTileflowThemeController, createTileflowTileReader, createTileflowTransformRequest, decodeTileflowVectorTile, getTileflowSystemColorScheme, loadTileflowStyleFonts, meshTileflowBuildings, mixTileflowRouteInks, mixTileflowSunPresets, placeTileflowStreetLights, playTileflowShot, readTileflowMapTileSource, readTileflowRouteInks, readTileflowSunPreset, registerTileflowContourProtocol, registerTileflowPmtilesProtocol, registerTileflowWorldRequestBridge, resolveTileflowSun, subscribeTileflowSystemColorScheme, tileflowBuildingExtent, tileflowBuildingVertexBytes, tileflowBuildings3DLayerId, tileflowDefaultRouteInks, tileflowDefaultSunPreset, tileflowDepthMarkerPlacement, tileflowFairUseNoticeMessage, tileflowGroundBeforeId, tileflowLayerDomainMetadataKey, tileflowLineProgressGradient, tileflowMaplibreContourVersion, tileflowPmtilesMaximumDirectoryDepth, tileflowPmtilesProtocol, tileflowRouteMetadataKey, tileflowShotStateAt, tileflowStreetLightBytes, tileflowStreetLightsLayerId, tileflowStyleRouteInks, tileflowStyleSunPreset, tileflowSunDirection, tileflowSunLightMatrix, tileflowSunMetadataKey, tileflowSunPosition, tileflowTilePointToLngLat, tileflowTilesForBounds, validateTileflowBrowserThemeBlendSelection, validateTileflowEmphasis };
|
|
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 };
|