@johnmorrisdotca/chikyu-earth 0.46.0 → 0.46.2
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/CHANGELOG.md +8 -0
- package/NOTICE.md +10 -0
- package/README.md +2 -2
- package/dist/door/gibs.d.ts +171 -0
- package/dist/door/gibs.js +362 -0
- package/dist/door/grid.d.ts +201 -0
- package/dist/door/grid.js +251 -0
- package/dist/door/index.d.ts +2 -0
- package/dist/door/index.js +2 -0
- package/dist/door/map.d.ts +5 -0
- package/dist/realistic/element-base.d.ts +6 -0
- package/dist/realistic/element-base.js +51 -7
- package/dist/realistic/index.d.ts +1 -1
- package/dist/realistic/index.js +1 -1
- package/dist/realistic/shaders.js +2 -2
- package/dist/realistic/tile-set.d.ts +11 -1
- package/dist/realistic/tile-set.js +143 -19
- package/dist/realistic/tiles.d.ts +20 -0
- package/dist/realistic/tiles.js +94 -1
- package/dist/space/element-base.d.ts +17 -0
- package/dist/space/element-base.js +45 -5
- package/dist/space/ride.js +2 -2
- package/dist/space/scene.d.ts +14 -0
- package/dist/space/scene.js +17 -5
- package/package.json +1 -1
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import type { MapPlace } from "../data-door.ts";
|
|
2
|
+
/**
|
|
3
|
+
* One level of a source's own grid. `width` is the pixels across a full turn of longitude, which is what a view compares with the screen. `west` and `north` are the outer corner of column 0, row 0, in degrees.
|
|
4
|
+
* `tileLon` and `tileLat` are the degrees one tile covers, which may run past the Earth.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```ts
|
|
8
|
+
* import type { MapGridLevel } from "@johnmorrisdotca/chikyu-earth/door";
|
|
9
|
+
*
|
|
10
|
+
* const level: MapGridLevel = { level: 3, width: 5120, columns: 10, rows: 5, west: -180, north: 90, tileLon: 36, tileLat: 36 };
|
|
11
|
+
* console.log(level.columns);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export interface MapGridLevel {
|
|
15
|
+
level: number;
|
|
16
|
+
width: number;
|
|
17
|
+
columns: number;
|
|
18
|
+
rows: number;
|
|
19
|
+
west: number;
|
|
20
|
+
north: number;
|
|
21
|
+
tileLon: number;
|
|
22
|
+
tileLat: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The grid a map source declares when it is not the package's pyramid: the tile size, the Earth's extent in degrees, and one entry per level.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import type { MapGrid } from "@johnmorrisdotca/chikyu-earth/door";
|
|
30
|
+
*
|
|
31
|
+
* const grid: MapGrid = { tileSize: 512, extent: { west: -180, south: -90, east: 180, north: 90 }, levels: [] };
|
|
32
|
+
* console.log(grid.tileSize);
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export interface MapGrid {
|
|
36
|
+
tileSize: number;
|
|
37
|
+
extent: {
|
|
38
|
+
west: number;
|
|
39
|
+
south: number;
|
|
40
|
+
east: number;
|
|
41
|
+
north: number;
|
|
42
|
+
};
|
|
43
|
+
levels: readonly MapGridLevel[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Fold a longitude into the half-open range from -180 up to, but not including, 180. 180 and -180 are the same meridian, and both come back as -180.
|
|
47
|
+
*
|
|
48
|
+
* @param lon - A longitude in degrees, which may fall outside one turn.
|
|
49
|
+
* @returns The longitude in `[-180, 180)`.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { wrapLon } from "@johnmorrisdotca/chikyu-earth/door";
|
|
54
|
+
*
|
|
55
|
+
* console.log(wrapLon(180), wrapLon(-180), wrapLon(190));
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function wrapLon(lon: number): number;
|
|
59
|
+
/**
|
|
60
|
+
* The level of a grid whose width is at least `detail` pixels across a full turn, or the finest level when none is, or `undefined` when the grid has no level wider than `minWidth`.
|
|
61
|
+
*
|
|
62
|
+
* @param grid - The source's grid.
|
|
63
|
+
* @param detail - The pixels across a full turn the view wants.
|
|
64
|
+
* @param minWidth - Levels no wider than this are left out (the picture already underneath).
|
|
65
|
+
* @returns The level, or `undefined` when nothing in the grid is finer than `minWidth`.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* import { gibsGrid, gridLevelFor } from "@johnmorrisdotca/chikyu-earth/door";
|
|
70
|
+
*
|
|
71
|
+
* console.log(gridLevelFor(gibsGrid("250m"), 40000, 32768)?.level);
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare function gridLevelFor(grid: MapGrid, detail: number, minWidth: number): MapGridLevel | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* The longitude and latitude a tile covers, before it is cut to the Earth. The south and east edges may fall past the Earth on a coarse level.
|
|
77
|
+
*
|
|
78
|
+
* @param level - The level the tile is on.
|
|
79
|
+
* @param col - The column, from the west.
|
|
80
|
+
* @param row - The row, from the north.
|
|
81
|
+
* @returns The tile's bounds in degrees.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { gibsGrid, gridSpan } from "@johnmorrisdotca/chikyu-earth/door";
|
|
86
|
+
*
|
|
87
|
+
* console.log(gridSpan(gibsGrid("250m").levels[0]!, 0, 0).latMin < -90);
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare function gridSpan(level: MapGridLevel, col: number, row: number): {
|
|
91
|
+
lonMin: number;
|
|
92
|
+
lonMax: number;
|
|
93
|
+
latMin: number;
|
|
94
|
+
latMax: number;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* True when the tile runs past the Earth's extent (a coarse level's tile is wider than the Earth).
|
|
98
|
+
*
|
|
99
|
+
* @param level - The level.
|
|
100
|
+
* @param col - The column.
|
|
101
|
+
* @param row - The row.
|
|
102
|
+
* @returns Whether any edge falls outside -180 to 180 or -90 to 90.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* import { gibsGrid, gridPastExtent } from "@johnmorrisdotca/chikyu-earth/door";
|
|
107
|
+
*
|
|
108
|
+
* const coarse = gibsGrid("250m").levels[0]!;
|
|
109
|
+
* console.log(gridPastExtent(coarse, 0, 0));
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare function gridPastExtent(level: MapGridLevel, col: number, row: number): boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The part of a tile that lies on the Earth, or `undefined` when the tile misses the Earth entirely.
|
|
115
|
+
*
|
|
116
|
+
* @param level - The level.
|
|
117
|
+
* @param col - The column.
|
|
118
|
+
* @param row - The row.
|
|
119
|
+
* @param extent - The Earth's extent in degrees.
|
|
120
|
+
* @returns The overlap, or `undefined`.
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* import { gibsGrid, gridOnEarth } from "@johnmorrisdotca/chikyu-earth/door";
|
|
125
|
+
*
|
|
126
|
+
* console.log(gridOnEarth(gibsGrid("250m").levels[3]!, 0, 0, { west: -180, south: -90, east: 180, north: 90 }));
|
|
127
|
+
* ```
|
|
128
|
+
*/
|
|
129
|
+
export declare function gridOnEarth(level: MapGridLevel, col: number, row: number, extent: MapGrid["extent"]): MapPlace | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* The column and row of the tile that holds a point, or `undefined` when the point is off the Earth or the tile that would hold it misses the Earth.
|
|
132
|
+
* A longitude of 180 is the same meridian as -180, and both fall in column 0. A latitude of -90 falls in the last row that still meets the Earth.
|
|
133
|
+
*
|
|
134
|
+
* @param level - The level.
|
|
135
|
+
* @param lon - The longitude in degrees.
|
|
136
|
+
* @param lat - The latitude in degrees.
|
|
137
|
+
* @param extent - The Earth's extent.
|
|
138
|
+
* @returns The tile, or `undefined`.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* import { gibsGrid, gridTileAt } from "@johnmorrisdotca/chikyu-earth/door";
|
|
143
|
+
*
|
|
144
|
+
* const level = gibsGrid("250m").levels[3]!;
|
|
145
|
+
* console.log(gridTileAt(level, 180, 0, gibsGrid("250m").extent));
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export declare function gridTileAt(level: MapGridLevel, lon: number, lat: number, extent: MapGrid["extent"]): {
|
|
149
|
+
col: number;
|
|
150
|
+
row: number;
|
|
151
|
+
} | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* The key of the tile that holds a point, `[<prefix>]level/column/row`, or `undefined` when no tile holds it.
|
|
154
|
+
*
|
|
155
|
+
* @param grid - The grid.
|
|
156
|
+
* @param level - The level number.
|
|
157
|
+
* @param lon - The longitude in degrees.
|
|
158
|
+
* @param lat - The latitude in degrees.
|
|
159
|
+
* @param prefix - Put before the key.
|
|
160
|
+
* @returns The key, or `undefined`.
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { gibsGrid, gridKey } from "@johnmorrisdotca/chikyu-earth/door";
|
|
165
|
+
*
|
|
166
|
+
* console.log(gridKey(gibsGrid("250m"), 3, 0, 0));
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
169
|
+
export declare function gridKey(grid: MapGrid, level: number, lon: number, lat: number, prefix?: string): string | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* The keys of the tiles that cover a place at a detail. The longitude may pass 180. A place with no area gives none.
|
|
172
|
+
*
|
|
173
|
+
* @param grid - The grid.
|
|
174
|
+
* @param place - The part of the map, in degrees.
|
|
175
|
+
* @param detail - The pixels across a full turn wanted.
|
|
176
|
+
* @param prefix - Put before each key.
|
|
177
|
+
* @returns The keys, row by row.
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* ```ts
|
|
181
|
+
* import { gibsGrid, gridKeys } from "@johnmorrisdotca/chikyu-earth/door";
|
|
182
|
+
*
|
|
183
|
+
* console.log(gridKeys(gibsGrid("250m"), { lonMin: 170, lonMax: 190, latMin: -5, latMax: 5 }, 5120));
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
export declare function gridKeys(grid: MapGrid, place: MapPlace, detail: number, prefix?: string): string[];
|
|
187
|
+
/**
|
|
188
|
+
* The Geographic (EPSG:4326) tile matrix NASA's imagery service publishes, read from its capabilities on 2026-11-13.
|
|
189
|
+
* A pixel is `0.5625 / 2^level` degrees. Tiles are 512 pixels, the corner of column 0 and row 0 is longitude -180 and latitude 90, and a level has as many tiles as it takes to cover the Earth, so levels 0, 1 and 2 run past it.
|
|
190
|
+
*
|
|
191
|
+
* @param matrix - `250m` (levels 0 to 8) or `500m` (levels 0 to 7).
|
|
192
|
+
* @returns The grid.
|
|
193
|
+
*
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* import { gibsGrid } from "@johnmorrisdotca/chikyu-earth/door";
|
|
197
|
+
*
|
|
198
|
+
* console.log(gibsGrid("250m").levels[3]);
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
export declare function gibsGrid(matrix: "250m" | "500m"): MapGrid;
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
const EDGE = 1e-9;
|
|
2
|
+
/**
|
|
3
|
+
* Fold a longitude into the half-open range from -180 up to, but not including, 180. 180 and -180 are the same meridian, and both come back as -180.
|
|
4
|
+
*
|
|
5
|
+
* @param lon - A longitude in degrees, which may fall outside one turn.
|
|
6
|
+
* @returns The longitude in `[-180, 180)`.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { wrapLon } from "@johnmorrisdotca/chikyu-earth/door";
|
|
11
|
+
*
|
|
12
|
+
* console.log(wrapLon(180), wrapLon(-180), wrapLon(190));
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export function wrapLon(lon) {
|
|
16
|
+
const turned = (((lon + 180) % 360) + 360) % 360 - 180;
|
|
17
|
+
return turned === 180 ? -180 : turned;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The level of a grid whose width is at least `detail` pixels across a full turn, or the finest level when none is, or `undefined` when the grid has no level wider than `minWidth`.
|
|
21
|
+
*
|
|
22
|
+
* @param grid - The source's grid.
|
|
23
|
+
* @param detail - The pixels across a full turn the view wants.
|
|
24
|
+
* @param minWidth - Levels no wider than this are left out (the picture already underneath).
|
|
25
|
+
* @returns The level, or `undefined` when nothing in the grid is finer than `minWidth`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* import { gibsGrid, gridLevelFor } from "@johnmorrisdotca/chikyu-earth/door";
|
|
30
|
+
*
|
|
31
|
+
* console.log(gridLevelFor(gibsGrid("250m"), 40000, 32768)?.level);
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export function gridLevelFor(grid, detail, minWidth) {
|
|
35
|
+
const levels = grid.levels.filter((level) => level.width > minWidth).sort((a, b) => a.width - b.width);
|
|
36
|
+
if (levels.length === 0 || !(detail > minWidth))
|
|
37
|
+
return undefined;
|
|
38
|
+
return levels.find((level) => level.width >= detail) ?? levels[levels.length - 1];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The longitude and latitude a tile covers, before it is cut to the Earth. The south and east edges may fall past the Earth on a coarse level.
|
|
42
|
+
*
|
|
43
|
+
* @param level - The level the tile is on.
|
|
44
|
+
* @param col - The column, from the west.
|
|
45
|
+
* @param row - The row, from the north.
|
|
46
|
+
* @returns The tile's bounds in degrees.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* import { gibsGrid, gridSpan } from "@johnmorrisdotca/chikyu-earth/door";
|
|
51
|
+
*
|
|
52
|
+
* console.log(gridSpan(gibsGrid("250m").levels[0]!, 0, 0).latMin < -90);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export function gridSpan(level, col, row) {
|
|
56
|
+
const lonMin = level.west + col * level.tileLon;
|
|
57
|
+
const latMax = level.north - row * level.tileLat;
|
|
58
|
+
return { lonMin, lonMax: lonMin + level.tileLon, latMax, latMin: latMax - level.tileLat };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* True when the tile runs past the Earth's extent (a coarse level's tile is wider than the Earth).
|
|
62
|
+
*
|
|
63
|
+
* @param level - The level.
|
|
64
|
+
* @param col - The column.
|
|
65
|
+
* @param row - The row.
|
|
66
|
+
* @returns Whether any edge falls outside -180 to 180 or -90 to 90.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* import { gibsGrid, gridPastExtent } from "@johnmorrisdotca/chikyu-earth/door";
|
|
71
|
+
*
|
|
72
|
+
* const coarse = gibsGrid("250m").levels[0]!;
|
|
73
|
+
* console.log(gridPastExtent(coarse, 0, 0));
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export function gridPastExtent(level, col, row) {
|
|
77
|
+
const span = gridSpan(level, col, row);
|
|
78
|
+
return span.lonMin < -180 - EDGE || span.lonMax > 180 + EDGE || span.latMin < -90 - EDGE || span.latMax > 90 + EDGE;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* The part of a tile that lies on the Earth, or `undefined` when the tile misses the Earth entirely.
|
|
82
|
+
*
|
|
83
|
+
* @param level - The level.
|
|
84
|
+
* @param col - The column.
|
|
85
|
+
* @param row - The row.
|
|
86
|
+
* @param extent - The Earth's extent in degrees.
|
|
87
|
+
* @returns The overlap, or `undefined`.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```ts
|
|
91
|
+
* import { gibsGrid, gridOnEarth } from "@johnmorrisdotca/chikyu-earth/door";
|
|
92
|
+
*
|
|
93
|
+
* console.log(gridOnEarth(gibsGrid("250m").levels[3]!, 0, 0, { west: -180, south: -90, east: 180, north: 90 }));
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export function gridOnEarth(level, col, row, extent) {
|
|
97
|
+
const span = gridSpan(level, col, row);
|
|
98
|
+
const lonMin = Math.max(span.lonMin, extent.west);
|
|
99
|
+
const lonMax = Math.min(span.lonMax, extent.east);
|
|
100
|
+
const latMin = Math.max(span.latMin, extent.south);
|
|
101
|
+
const latMax = Math.min(span.latMax, extent.north);
|
|
102
|
+
if (!(lonMax > lonMin) || !(latMax > latMin))
|
|
103
|
+
return undefined;
|
|
104
|
+
return { lonMin, lonMax, latMin, latMax };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* The column and row of the tile that holds a point, or `undefined` when the point is off the Earth or the tile that would hold it misses the Earth.
|
|
108
|
+
* A longitude of 180 is the same meridian as -180, and both fall in column 0. A latitude of -90 falls in the last row that still meets the Earth.
|
|
109
|
+
*
|
|
110
|
+
* @param level - The level.
|
|
111
|
+
* @param lon - The longitude in degrees.
|
|
112
|
+
* @param lat - The latitude in degrees.
|
|
113
|
+
* @param extent - The Earth's extent.
|
|
114
|
+
* @returns The tile, or `undefined`.
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* import { gibsGrid, gridTileAt } from "@johnmorrisdotca/chikyu-earth/door";
|
|
119
|
+
*
|
|
120
|
+
* const level = gibsGrid("250m").levels[3]!;
|
|
121
|
+
* console.log(gridTileAt(level, 180, 0, gibsGrid("250m").extent));
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
export function gridTileAt(level, lon, lat, extent) {
|
|
125
|
+
if (!Number.isFinite(lon) || !Number.isFinite(lat) || lat > extent.north || lat < extent.south)
|
|
126
|
+
return undefined;
|
|
127
|
+
const x = wrapLon(lon);
|
|
128
|
+
let col = Math.floor((x - level.west) / level.tileLon + EDGE);
|
|
129
|
+
let row = Math.floor((level.north - lat) / level.tileLat + EDGE);
|
|
130
|
+
if (col >= level.columns)
|
|
131
|
+
col = level.columns - 1;
|
|
132
|
+
if (row >= level.rows)
|
|
133
|
+
row = level.rows - 1;
|
|
134
|
+
if (col < 0 || row < 0)
|
|
135
|
+
return undefined;
|
|
136
|
+
return gridOnEarth(level, col, row, extent) ? { col, row } : undefined;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The key of the tile that holds a point, `[<prefix>]level/column/row`, or `undefined` when no tile holds it.
|
|
140
|
+
*
|
|
141
|
+
* @param grid - The grid.
|
|
142
|
+
* @param level - The level number.
|
|
143
|
+
* @param lon - The longitude in degrees.
|
|
144
|
+
* @param lat - The latitude in degrees.
|
|
145
|
+
* @param prefix - Put before the key.
|
|
146
|
+
* @returns The key, or `undefined`.
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* import { gibsGrid, gridKey } from "@johnmorrisdotca/chikyu-earth/door";
|
|
151
|
+
*
|
|
152
|
+
* console.log(gridKey(gibsGrid("250m"), 3, 0, 0));
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
export function gridKey(grid, level, lon, lat, prefix = "") {
|
|
156
|
+
const found = grid.levels.find((one) => one.level === level);
|
|
157
|
+
if (!found)
|
|
158
|
+
return undefined;
|
|
159
|
+
const tile = gridTileAt(found, lon, lat, grid.extent);
|
|
160
|
+
return tile ? `${prefix}${found.level}/${tile.col}/${tile.row}` : undefined;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* The keys of the tiles that cover a place at a detail. The longitude may pass 180. A place with no area gives none.
|
|
164
|
+
*
|
|
165
|
+
* @param grid - The grid.
|
|
166
|
+
* @param place - The part of the map, in degrees.
|
|
167
|
+
* @param detail - The pixels across a full turn wanted.
|
|
168
|
+
* @param prefix - Put before each key.
|
|
169
|
+
* @returns The keys, row by row.
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* import { gibsGrid, gridKeys } from "@johnmorrisdotca/chikyu-earth/door";
|
|
174
|
+
*
|
|
175
|
+
* console.log(gridKeys(gibsGrid("250m"), { lonMin: 170, lonMax: 190, latMin: -5, latMax: 5 }, 5120));
|
|
176
|
+
* ```
|
|
177
|
+
*/
|
|
178
|
+
export function gridKeys(grid, place, detail, prefix = "") {
|
|
179
|
+
if (!(place.lonMax > place.lonMin) || !(place.latMax > place.latMin))
|
|
180
|
+
return [];
|
|
181
|
+
const level = grid.levels.find((one) => one.width >= detail) ?? grid.levels[grid.levels.length - 1];
|
|
182
|
+
if (!level)
|
|
183
|
+
return [];
|
|
184
|
+
const span = Math.min(360, place.lonMax - place.lonMin);
|
|
185
|
+
const cols = [];
|
|
186
|
+
const seenCol = new Set();
|
|
187
|
+
const stepLon = level.tileLon / 2;
|
|
188
|
+
const midLat = Math.min(place.latMax - EDGE, Math.max(place.latMin + EDGE, (place.latMin + place.latMax) / 2));
|
|
189
|
+
const markCol = (lon) => {
|
|
190
|
+
const tile = gridTileAt(level, lon, midLat, grid.extent);
|
|
191
|
+
if (!tile || seenCol.has(tile.col))
|
|
192
|
+
return;
|
|
193
|
+
seenCol.add(tile.col);
|
|
194
|
+
cols.push(tile.col);
|
|
195
|
+
};
|
|
196
|
+
for (let lon = place.lonMin; lon < place.lonMin + span - EDGE; lon += stepLon)
|
|
197
|
+
markCol(lon);
|
|
198
|
+
markCol(place.lonMin + span - EDGE);
|
|
199
|
+
const rows = [];
|
|
200
|
+
const seenRow = new Set();
|
|
201
|
+
const stepLat = level.tileLat / 2;
|
|
202
|
+
const markRow = (lat) => {
|
|
203
|
+
const tile = gridTileAt(level, place.lonMin, lat, grid.extent);
|
|
204
|
+
if (!tile || seenRow.has(tile.row))
|
|
205
|
+
return;
|
|
206
|
+
seenRow.add(tile.row);
|
|
207
|
+
rows.push(tile.row);
|
|
208
|
+
};
|
|
209
|
+
for (let lat = place.latMax; lat > place.latMin + EDGE; lat -= stepLat)
|
|
210
|
+
markRow(lat);
|
|
211
|
+
markRow(place.latMin + EDGE);
|
|
212
|
+
rows.sort((a, b) => a - b);
|
|
213
|
+
const keys = [];
|
|
214
|
+
for (const row of rows)
|
|
215
|
+
for (const col of cols)
|
|
216
|
+
keys.push(`${prefix}${level.level}/${col}/${row}`);
|
|
217
|
+
return keys;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* The Geographic (EPSG:4326) tile matrix NASA's imagery service publishes, read from its capabilities on 2026-11-13.
|
|
221
|
+
* A pixel is `0.5625 / 2^level` degrees. Tiles are 512 pixels, the corner of column 0 and row 0 is longitude -180 and latitude 90, and a level has as many tiles as it takes to cover the Earth, so levels 0, 1 and 2 run past it.
|
|
222
|
+
*
|
|
223
|
+
* @param matrix - `250m` (levels 0 to 8) or `500m` (levels 0 to 7).
|
|
224
|
+
* @returns The grid.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* import { gibsGrid } from "@johnmorrisdotca/chikyu-earth/door";
|
|
229
|
+
*
|
|
230
|
+
* console.log(gibsGrid("250m").levels[3]);
|
|
231
|
+
* ```
|
|
232
|
+
*/
|
|
233
|
+
export function gibsGrid(matrix) {
|
|
234
|
+
const max = matrix === "250m" ? 8 : 7;
|
|
235
|
+
const levels = [];
|
|
236
|
+
for (let level = 0; level <= max; level += 1) {
|
|
237
|
+
const pixel = 0.5625 / 2 ** level;
|
|
238
|
+
const tile = 512 * pixel;
|
|
239
|
+
levels.push({
|
|
240
|
+
level,
|
|
241
|
+
width: 360 / pixel,
|
|
242
|
+
columns: Math.ceil((360 - EDGE) / tile),
|
|
243
|
+
rows: Math.ceil((180 - EDGE) / tile),
|
|
244
|
+
west: -180,
|
|
245
|
+
north: 90,
|
|
246
|
+
tileLon: tile,
|
|
247
|
+
tileLat: tile,
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return { tileSize: 512, extent: { west: -180, south: -90, east: 180, north: 90 }, levels };
|
|
251
|
+
}
|
package/dist/door/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { createTileStore, creditLine, loadRecords, MAX_IN_FLIGHT, MAX_RECORDS, TILE_BUDGET_BYTES, validateSource } from "../data-door.ts";
|
|
2
2
|
export type { BitmapLike, Credit, DataSource, ImageTile, Licence, MapPlace, RecordsRead, RecordSource, SourceInfo, TileLoader, TileSource, TileStats, TileStore, TileStoreOptions } from "../data-door.ts";
|
|
3
3
|
export { DEFAULT_LEVELS, earthTiles, imageBytes, mapKeys, tileKeyParts, tilePlace, type EarthMapPlace, type EarthMapSource, type EarthTilesOptions, type MapLayer } from "./map.ts";
|
|
4
|
+
export { gibsGrid, gridKey, gridKeys, gridLevelFor, gridOnEarth, gridPastExtent, gridSpan, gridTileAt, wrapLon, type MapGrid, type MapGridLevel } from "./grid.ts";
|
|
5
|
+
export { GIBS_CREDIT, GIBS_ID, GIBS_SLOW_MS, gibsTiles, previousUtcDay, samplesAreBlank, utcDay, type GibsTilesOptions } from "./gibs.ts";
|
|
4
6
|
export { elementsFrom, mergeElementSets, readElementSets, type ElementRecordSource, type ElementSetsRead } from "./elements.ts";
|
|
5
7
|
export { OWN_SOURCES, ownCredit } from "./own.ts";
|
|
6
8
|
export { createSourceBook, creditsOf, type SourceBook, type SourceBookOptions, type SourceStats } from "./book.ts";
|
package/dist/door/index.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// entries beyond what they use: a page that never uses the door pays nothing. With no outside source every view draws what it always drew. Pure: no DOM, no three.js, no clock.
|
|
6
6
|
export { createTileStore, creditLine, loadRecords, MAX_IN_FLIGHT, MAX_RECORDS, TILE_BUDGET_BYTES, validateSource } from "../data-door.js";
|
|
7
7
|
export { DEFAULT_LEVELS, earthTiles, imageBytes, mapKeys, tileKeyParts, tilePlace } from "./map.js";
|
|
8
|
+
export { gibsGrid, gridKey, gridKeys, gridLevelFor, gridOnEarth, gridPastExtent, gridSpan, gridTileAt, wrapLon } from "./grid.js";
|
|
9
|
+
export { GIBS_CREDIT, GIBS_ID, GIBS_SLOW_MS, gibsTiles, previousUtcDay, samplesAreBlank, utcDay } from "./gibs.js";
|
|
8
10
|
export { elementsFrom, mergeElementSets, readElementSets } from "./elements.js";
|
|
9
11
|
export { OWN_SOURCES, ownCredit } from "./own.js";
|
|
10
12
|
export { createSourceBook, creditsOf } from "./book.js";
|
package/dist/door/map.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BitmapLike, ImageTile, MapPlace, TileSource } from "../data-door.ts";
|
|
2
2
|
import { type TileId, type TileLayer } from "../realistic/tiles.ts";
|
|
3
|
+
import type { MapGrid } from "./grid.ts";
|
|
3
4
|
/**
|
|
4
5
|
* What a map source draws: `day` and `night` are the Earth's pictures, which the realistic Earth lays tiles over; `clouds` and `water` are the door's for the whole-Earth layers they are, which the package does not tile or draw yet.
|
|
5
6
|
*
|
|
@@ -42,6 +43,10 @@ export type EarthMapPlace = MapPlace & {
|
|
|
42
43
|
export type EarthMapSource = TileSource<EarthMapPlace, number, ImageTile> & {
|
|
43
44
|
layer: MapLayer | "*";
|
|
44
45
|
levels?(layer: string, signal: AbortSignal): TileLayer | undefined | Promise<TileLayer | undefined>;
|
|
46
|
+
/**
|
|
47
|
+
* The source's own grid, when it is not the package's pyramid (`2^(L+1)` columns by `2^L` rows). The loader places tiles from this. Left out, the pyramid is unchanged.
|
|
48
|
+
*/
|
|
49
|
+
grid?: MapGrid;
|
|
45
50
|
};
|
|
46
51
|
/**
|
|
47
52
|
* The levels a source has when it does not say: levels 3 and 4 (8192 and 16384 pixels across), the two the package's cutter makes beyond its own 4096 pixel picture.
|
|
@@ -326,6 +326,12 @@ export declare class ChikyuEarthRealistic extends HTMLElement {
|
|
|
326
326
|
/** Where the finer map tiles are served from (a folder with `manifest.json`), or `null` for none; the attribute `tiles`. The Earth loads only the tiles in view, over its own pictures. */
|
|
327
327
|
get tiles(): string | null;
|
|
328
328
|
set tiles(value: string | null);
|
|
329
|
+
/**
|
|
330
|
+
* Finer imagery than the package's own tiles, read by the browser from NASA's imagery service. `gibs` turns it on; anything else, or leaving it out, leaves it off. The daily picture is the MODIS Terra true-colour layer for the most recent day that has one (looked for from the day before the moment on show back at most 10 days, one tile a day, and kept for the session), with the clouds left in and black gaps between satellite passes, and only when the view is closer than the package's own tiles. A tile that is slow or missing leaves the coarser picture in place.
|
|
331
|
+
* `tiles-finer-layer` names another layer (`MODIS_Terra_CorrectedReflectance_TrueColor` or `BlueMarble_ShadedRelief_Bathymetry`), and `tiles-finer-date` is `latest` (the default), `previous-day`, `shown` or one day `yyyy-mm-dd`.
|
|
332
|
+
*/
|
|
333
|
+
get tilesFiner(): string | null;
|
|
334
|
+
set tilesFiner(value: string | null);
|
|
329
335
|
/** A box laid over the Earth for markers (see `@johnmorrisdotca/chikyu-earth/markers`): where it is, the pose of the last draw, and a way to hear the next. */
|
|
330
336
|
get overlay(): OverlayHost;
|
|
331
337
|
/** Where the view starts: longitude and latitude; the shared controls' yaw and tilt turn it from there. */
|
|
@@ -13,6 +13,7 @@ import { applySatelliteFocus, satelliteEmphasis, satelliteGroupRows, shellRadius
|
|
|
13
13
|
import { readMeteorStrength } from "../meteors/strength.js";
|
|
14
14
|
import { METEOR_NOTE_STYLE, prefersLessMotion, setMeteorNote } from "../meteors/note.js";
|
|
15
15
|
import { createDoorHost } from "../door/host.js";
|
|
16
|
+
import { createFinerHolder, GIBS_CREDIT, GIBS_ID } from "../door/gibs.js";
|
|
16
17
|
import { folderSource } from "../door/map.js";
|
|
17
18
|
import { ownCredit } from "../door/own.js";
|
|
18
19
|
import { BODY_LABEL_ATTRIBUTES, bodyLabelText, loadMichroma, readBodyLabel } from "./body-label.js";
|
|
@@ -160,7 +161,7 @@ export const readTime = (value) => {
|
|
|
160
161
|
* ```
|
|
161
162
|
*/
|
|
162
163
|
export class ChikyuEarthRealistic extends HTMLElement {
|
|
163
|
-
static observedAttributes = ["cloud-drift", "center", "time", "speed", "clouds", "lights", "light", "live-seconds", "tiles", "data", "camera", "immersive", "meteors", "meteors-label", "meteors-strength", ...BODY_LABEL_ATTRIBUTES, ...SKY_ATTRIBUTES, ...CITY_NAMES_ATTRIBUTES, ...BORDER_ATTRIBUTES, ...GRID_ATTRIBUTES, ...COUNTRY_NAMES_ATTRIBUTES, ...SEA_NAMES_ATTRIBUTES, "air-thickness", "air-label", "lang", "places", "places-look", "place-groups", "here-city", "route", "satellite-tint", "satellite-streak-max"];
|
|
164
|
+
static observedAttributes = ["cloud-drift", "center", "time", "speed", "clouds", "lights", "light", "live-seconds", "tiles", "tiles-finer", "tiles-finer-layer", "tiles-finer-date", "data", "camera", "immersive", "meteors", "meteors-label", "meteors-strength", ...BODY_LABEL_ATTRIBUTES, ...SKY_ATTRIBUTES, ...CITY_NAMES_ATTRIBUTES, ...BORDER_ATTRIBUTES, ...GRID_ATTRIBUTES, ...COUNTRY_NAMES_ATTRIBUTES, ...SEA_NAMES_ATTRIBUTES, "air-thickness", "air-label", "lang", "places", "places-look", "place-groups", "here-city", "route", "satellite-tint", "satellite-streak-max"];
|
|
164
165
|
#model = newModel();
|
|
165
166
|
#paint = createPaintState();
|
|
166
167
|
#mode = "now";
|
|
@@ -172,6 +173,9 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
172
173
|
/** The page's own clock, in milliseconds, at the last step. */
|
|
173
174
|
#last = 0;
|
|
174
175
|
#announced = -Infinity;
|
|
176
|
+
/** The finer imagery (NASA's tile service), one source while the attributes stay the same. Off unless `tiles-finer="gibs"`. */
|
|
177
|
+
#finerHold = createFinerHolder(() => new Date(this.#model.time), () => this.#gate?.soon());
|
|
178
|
+
#finerNote;
|
|
175
179
|
/** The clock is running (a `running: false` is owed when it holds). */
|
|
176
180
|
#running = false;
|
|
177
181
|
#state = "loading";
|
|
@@ -240,12 +244,13 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
240
244
|
if (!this.hasAttribute("aria-label"))
|
|
241
245
|
this.setAttribute("aria-label", "The Earth from space, with its sunlit and dark sides");
|
|
242
246
|
const root = this.shadowRoot ?? this.attachShadow({ mode: "open" });
|
|
243
|
-
root.innerHTML = `<div id="stage"></div><div id="places"></div><div id="overlay"></div><div id="notes"><p id="air-note" hidden></p><p id="meteor-note" hidden></p></div>`;
|
|
247
|
+
root.innerHTML = `<div id="stage"></div><div id="places"></div><div id="overlay"></div><div id="notes"><p id="air-note" hidden></p><p id="meteor-note" hidden></p><p id="finer-credit" hidden></p></div>`;
|
|
244
248
|
adoptStyles(root, STYLE, this.nonce);
|
|
245
249
|
this.#stage = root.getElementById("stage");
|
|
246
250
|
this.#overlay = root.getElementById("overlay");
|
|
247
251
|
this.#note = root.getElementById("meteor-note");
|
|
248
252
|
this.#airNote = root.getElementById("air-note");
|
|
253
|
+
this.#finerNote = root.getElementById("finer-credit");
|
|
249
254
|
this.#sky = createSkyHost({
|
|
250
255
|
root,
|
|
251
256
|
attribute: (name) => this.getAttribute(name),
|
|
@@ -325,7 +330,10 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
325
330
|
air: () => airFor(this.getAttribute("air")),
|
|
326
331
|
invalidate: () => this.#gate?.soon(),
|
|
327
332
|
onDraw: () => this.#gate?.drawn(),
|
|
328
|
-
onTiled: () =>
|
|
333
|
+
onTiled: () => {
|
|
334
|
+
this.#showFinerCredit();
|
|
335
|
+
this.#door.announce();
|
|
336
|
+
},
|
|
329
337
|
onSky: (sky) => this.#sky?.frame(sky),
|
|
330
338
|
onLabelError: (error) => this.dispatchEvent(new CustomEvent("chikyu-body-label-unavailable", { detail: { reason: error instanceof Error ? error.message : String(error) } })),
|
|
331
339
|
placeSprites: () => this.#placeLayer?.sprites ?? null,
|
|
@@ -432,10 +440,12 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
432
440
|
this.light = readLight(value);
|
|
433
441
|
else if (name === "live-seconds")
|
|
434
442
|
this.#startTick();
|
|
435
|
-
else if (name === "tiles")
|
|
443
|
+
else if (name === "tiles" || name === "tiles-finer" || name === "tiles-finer-layer" || name === "tiles-finer-date")
|
|
436
444
|
this.#gate?.soon();
|
|
437
|
-
else if (name === "data")
|
|
445
|
+
else if (name === "data") {
|
|
438
446
|
this.#door.book.ownOnly(value === "own");
|
|
447
|
+
this.#gate?.soon();
|
|
448
|
+
}
|
|
439
449
|
else if (name === "camera")
|
|
440
450
|
this.camera = readCamera(value);
|
|
441
451
|
else if (name === "cloud-drift") {
|
|
@@ -461,6 +471,7 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
461
471
|
this.#seas?.refresh();
|
|
462
472
|
this.#countries?.refresh();
|
|
463
473
|
this.#here?.refresh();
|
|
474
|
+
this.#showFinerCredit();
|
|
464
475
|
}
|
|
465
476
|
}
|
|
466
477
|
else if (BODY_LABEL_ATTRIBUTES.includes(name))
|
|
@@ -949,7 +960,23 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
949
960
|
const folder = this.tiles === null ? undefined : folderSource(this.tiles);
|
|
950
961
|
const day = this.#door.book.mapSources("day")[0] ?? folder;
|
|
951
962
|
const night = this.#door.book.mapSources("night")[0] ?? folder;
|
|
952
|
-
|
|
963
|
+
const finer = this.#finerHold.source((attr) => this.getAttribute(attr), this.getAttribute("data") === "own");
|
|
964
|
+
return { ...(day ? { day } : {}), ...(night ? { night } : {}), ...(finer ? { finer } : {}) };
|
|
965
|
+
}
|
|
966
|
+
/** The acknowledgement for the finer imagery, shown only while those tiles are on the screen. */
|
|
967
|
+
#showFinerCredit() {
|
|
968
|
+
const note = this.#finerNote;
|
|
969
|
+
if (!note)
|
|
970
|
+
return;
|
|
971
|
+
const count = this.#model.tiles?.stats.used[GIBS_ID] ?? 0;
|
|
972
|
+
const lang = (this.closest("[lang]")?.getAttribute("lang") ?? "").toLowerCase().startsWith("ja") ? "ja" : "en";
|
|
973
|
+
const text = count > 0 ? GIBS_CREDIT[lang] : "";
|
|
974
|
+
if (note.textContent !== text)
|
|
975
|
+
note.textContent = text;
|
|
976
|
+
if (note.lang !== lang)
|
|
977
|
+
note.lang = lang;
|
|
978
|
+
if (note.hidden !== (text === ""))
|
|
979
|
+
note.hidden = text === "";
|
|
953
980
|
}
|
|
954
981
|
/** The package's own credits for the last drawn frame: its pictures while it is drawn, and its finer tiles when a window of them is in view (unless a page added the folder itself, which the door counts). */
|
|
955
982
|
#ownCredits() {
|
|
@@ -957,6 +984,10 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
957
984
|
const own = [ownCredit("chikyu-pictures", this.#state === "live" ? 1 : 0)];
|
|
958
985
|
if (this.#door.book.get("chikyu-tiles") === undefined)
|
|
959
986
|
own.push(ownCredit("chikyu-tiles", used["chikyu-tiles"] ?? 0));
|
|
987
|
+
const finer = this.#finerHold.source((attr) => this.getAttribute(attr), this.getAttribute("data") === "own");
|
|
988
|
+
const finerUsed = used[GIBS_ID] ?? 0;
|
|
989
|
+
if (finer && finerUsed > 0)
|
|
990
|
+
own.push({ source: finer.info, own: false, used: finerUsed });
|
|
960
991
|
return own;
|
|
961
992
|
}
|
|
962
993
|
/**
|
|
@@ -1001,6 +1032,19 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
1001
1032
|
else
|
|
1002
1033
|
this.setAttribute("tiles", value);
|
|
1003
1034
|
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Finer imagery than the package's own tiles, read by the browser from NASA's imagery service. `gibs` turns it on; anything else, or leaving it out, leaves it off. The daily picture is the MODIS Terra true-colour layer for the most recent day that has one (looked for from the day before the moment on show back at most 10 days, one tile a day, and kept for the session), with the clouds left in and black gaps between satellite passes, and only when the view is closer than the package's own tiles. A tile that is slow or missing leaves the coarser picture in place.
|
|
1037
|
+
* `tiles-finer-layer` names another layer (`MODIS_Terra_CorrectedReflectance_TrueColor` or `BlueMarble_ShadedRelief_Bathymetry`), and `tiles-finer-date` is `latest` (the default), `previous-day`, `shown` or one day `yyyy-mm-dd`.
|
|
1038
|
+
*/
|
|
1039
|
+
get tilesFiner() {
|
|
1040
|
+
return this.getAttribute("tiles-finer") === "gibs" ? "gibs" : null;
|
|
1041
|
+
}
|
|
1042
|
+
set tilesFiner(value) {
|
|
1043
|
+
if (value === "gibs")
|
|
1044
|
+
this.setAttribute("tiles-finer", "gibs");
|
|
1045
|
+
else
|
|
1046
|
+
this.removeAttribute("tiles-finer");
|
|
1047
|
+
}
|
|
1004
1048
|
/** A box laid over the Earth for markers (see `@johnmorrisdotca/chikyu-earth/markers`): where it is, the pose of the last draw, and a way to hear the next. */
|
|
1005
1049
|
get overlay() {
|
|
1006
1050
|
if (!this.#overlay)
|
|
@@ -1132,7 +1176,7 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
1132
1176
|
state: this.#state,
|
|
1133
1177
|
tiers: { ...this.#tiers },
|
|
1134
1178
|
satellites: this.#satelliteStats(),
|
|
1135
|
-
tiles: this.#model.tiles?.stats ?? { ready: false, level: null, held: 0, shown: 0, loading: 0, failed: 0, requested: 0, heldBytes: 0, refused: 0, used: {} },
|
|
1179
|
+
tiles: this.#model.tiles?.stats ?? { ready: false, level: null, held: 0, shown: 0, loading: 0, failed: 0, requested: 0, heldBytes: 0, refused: 0, used: {}, finer: null, fading: false },
|
|
1136
1180
|
draws: stats?.draws ?? 0,
|
|
1137
1181
|
contexts: stats?.contexts ?? 0,
|
|
1138
1182
|
canvas: stats?.canvas ?? { width: 0, height: 0, pixels: 0 },
|
|
@@ -3,7 +3,7 @@ export { chooseTier, textureBytes, textureCap, MAX_TEXTURE, TIERS, TEXELS_PER_RA
|
|
|
3
3
|
export { createGate, frameCap, type Gate } from "./gate.ts";
|
|
4
4
|
export { lookAt, discRadius, ATMOSPHERE_OUTER, cameraCentre, type CameraMode, type LightMode } from "./earth.ts";
|
|
5
5
|
export type { ThreeParts } from "./earth.ts";
|
|
6
|
-
export { TEXEL_SLACK, coveringTile, parseManifest, pointOnEarth, tileColumns, tileLevel, tileRect, tileRows, tilesInView, type TileCamera, type TileId, type TileLayer, type TilePerspective, type VisibleTile } from "./tiles.ts";
|
|
6
|
+
export { TEXEL_SLACK, coveringTile, gridTilesInView, parseManifest, pointOnEarth, tileColumns, tileLevel, tileRect, tileRows, tilesInView, type TileCamera, type TileId, type TileLayer, type TilePerspective, type VisibleTile } from "./tiles.ts";
|
|
7
7
|
export { TILE_KEEP_MS, TILE_LIMIT } from "./tile-set.ts";
|
|
8
8
|
export { BODY_LABEL_ATTRIBUTES, bodyLabelText, readBodyLabel, loadMichroma, setBodyLabelFontUrl, type BodyLabelSettings } from "./body-label.ts";
|
|
9
9
|
export { AIR_QUALITY, AIR_THICKNESS_DEFAULT, AIR_THICKNESS_MAX, AIR_TOP, AIR_VERT, airFor, airFrag, airTop, readAirThickness, type AirSamples } from "./air.ts";
|
package/dist/realistic/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { greenwichSidereal, subsolarPoint, unitVector, julianDay } from "./sun.j
|
|
|
4
4
|
export { chooseTier, textureBytes, textureCap, MAX_TEXTURE, TIERS, TEXELS_PER_RADIUS_PIXEL } from "./tiers.js";
|
|
5
5
|
export { createGate, frameCap } from "./gate.js";
|
|
6
6
|
export { lookAt, discRadius, ATMOSPHERE_OUTER, cameraCentre } from "./earth.js";
|
|
7
|
-
export { TEXEL_SLACK, coveringTile, parseManifest, pointOnEarth, tileColumns, tileLevel, tileRect, tileRows, tilesInView } from "./tiles.js";
|
|
7
|
+
export { TEXEL_SLACK, coveringTile, gridTilesInView, parseManifest, pointOnEarth, tileColumns, tileLevel, tileRect, tileRows, tilesInView } from "./tiles.js";
|
|
8
8
|
export { TILE_KEEP_MS, TILE_LIMIT } from "./tile-set.js";
|
|
9
9
|
export { BODY_LABEL_ATTRIBUTES, bodyLabelText, readBodyLabel, loadMichroma, setBodyLabelFontUrl } from "./body-label.js";
|
|
10
10
|
export { AIR_QUALITY, AIR_THICKNESS_DEFAULT, AIR_THICKNESS_MAX, AIR_TOP, AIR_VERT, airFor, airFrag, airTop, readAirThickness } from "./air.js";
|