spacemap 0.1.5 → 0.1.6
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 +19 -1
- package/dist/spacemap.iife.js +48 -37
- package/dist/spacemap.js +54 -43
- package/index.d.ts +18 -0
- package/index.js +214 -19
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -369,6 +369,10 @@ export declare function dateToJD(date: Date): number;
|
|
|
369
369
|
* renderer through the same effects a host's own store drives. */
|
|
370
370
|
export declare function defaultSceneSettings(): SceneSettings;
|
|
371
371
|
|
|
372
|
+
/** Kilometres between two places at `date`. Null and rejection are those of
|
|
373
|
+
* {@link offsetKm}. */
|
|
374
|
+
export declare function distanceKm(from: Anchor, to: Anchor, date: Date): Promise<number | null>;
|
|
375
|
+
|
|
372
376
|
/**
|
|
373
377
|
* A Keplerian orbit, propagated from its epoch by the mean motion the elements
|
|
374
378
|
* carry. Defined at every date, so an object on one is always drawn.
|
|
@@ -1198,6 +1202,13 @@ export declare type NoticeTopic = Notice['topic'];
|
|
|
1198
1202
|
* ecliptic north pole. */
|
|
1199
1203
|
export declare type OffsetKm = readonly [number, number, number];
|
|
1200
1204
|
|
|
1205
|
+
/**
|
|
1206
|
+
* From one place to another at `date`, in kilometres on ecliptic J2000 axes.
|
|
1207
|
+
* Null when either end is nowhere at that date. Rejects when the data does
|
|
1208
|
+
* not load.
|
|
1209
|
+
*/
|
|
1210
|
+
export declare function offsetKm(from: Anchor, to: Anchor, date: Date): Promise<OffsetKm | null>;
|
|
1211
|
+
|
|
1201
1212
|
export declare interface OrbitalElements {
|
|
1202
1213
|
a: number;
|
|
1203
1214
|
e: number;
|
|
@@ -2098,6 +2109,13 @@ export declare interface SpaceMapOptions {
|
|
|
2098
2109
|
layers?: Partial<Record<MapLayerId, boolean>>;
|
|
2099
2110
|
}
|
|
2100
2111
|
|
|
2112
|
+
/**
|
|
2113
|
+
* The place on `id` where the Sun is overhead at `date`, in the frame of a
|
|
2114
|
+
* surface anchor. Null for the Sun, and for a body that is nowhere at that
|
|
2115
|
+
* date. Rejects when the data does not load.
|
|
2116
|
+
*/
|
|
2117
|
+
export declare function subsolarPoint(id: string, date: Date): Promise<LonLat | null>;
|
|
2118
|
+
|
|
2101
2119
|
/** A place on (or above) the body's surface, turning with it. */
|
|
2102
2120
|
export declare interface SurfaceAnchor {
|
|
2103
2121
|
body: string;
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! spacemap SDK — https://spacemap.co — Mozilla Public License 2.0. Bundles MIT and ISC libraries: THIRD_PARTY_NOTICES.txt in the spacemap npm package. */
|
|
2
|
-
import { ACESFilmicToneMapping, AdditiveBlending, AmbientLight, ArrowHelper, BackSide, Box3, BufferAttribute, BufferGeometry, CanvasTexture, Color, CubeTexture, CustomBlending, DataTexture, DepthTexture, DirectionalLight, DoubleSide, Euler, Float32BufferAttribute, FloatType, FrontSide, Group, HalfFloatType, InstancedBufferAttribute, InstancedMesh, Line, LineBasicMaterial, LineLoop, LinearFilter, LinearMipmapLinearFilter, LinearSRGBColorSpace, MathUtils, Matrix4, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshStandardMaterial, NoBlending, NoColorSpace, NormalBlending, OneFactor, OneMinusSrcAlphaFactor, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, PerspectiveCamera, PlaneGeometry, PointLight, Points, PointsMaterial, Quaternion, RGBAFormat, RawShaderMaterial, Raycaster, RedFormat, RingGeometry, SRGBColorSpace, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapeUtils, SphereGeometry, Sprite, SpriteMaterial, TOUCH, Texture, TextureLoader, Uint16BufferAttribute, UnsignedByteType, Vector2, Vector3, Vector4, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
2
|
+
import { ACESFilmicToneMapping, AdditiveBlending, AmbientLight, ArrowHelper, BackSide, Box3, BufferAttribute, BufferGeometry, CanvasTexture, Color, CubeTexture, CustomBlending, DataTexture, DepthTexture, DirectionalLight, DoubleSide, Euler, Float32BufferAttribute, FloatType, FrontSide, Group, HalfFloatType, InstancedBufferAttribute, InstancedMesh, Line, LineBasicMaterial, LineLoop, LinearFilter, LinearMipmapLinearFilter, LinearSRGBColorSpace, MathUtils, Matrix4, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshStandardMaterial, NoBlending, NoColorSpace, NormalBlending, OneFactor, OneMinusSrcAlphaFactor, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, PerspectiveCamera, PlaneGeometry, PointLight, Points, PointsMaterial, Quaternion, RGBAFormat, RawShaderMaterial, Raycaster, RedFormat, RingGeometry, SRGBColorSpace, Scene, ShaderChunk, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapeUtils, SphereGeometry, Sprite, SpriteMaterial, TOUCH, Texture, TextureLoader, Uint16BufferAttribute, UnsignedByteType, Vector2, Vector3, Vector4, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
3
3
|
import { OrbitControls } from "three/addons/controls/OrbitControls.js";
|
|
4
4
|
import { EffectComposer } from "three/addons/postprocessing/EffectComposer.js";
|
|
5
5
|
import { RenderPass } from "three/addons/postprocessing/RenderPass.js";
|
|
@@ -6287,6 +6287,12 @@ var BodyIndex = class {
|
|
|
6287
6287
|
findAsteroidZone(id) {
|
|
6288
6288
|
for (const [zone, byId] of this.asteroidBodiesByZone) if (byId.has(id)) return zone;
|
|
6289
6289
|
}
|
|
6290
|
+
elementRow(body) {
|
|
6291
|
+
const d = body.data;
|
|
6292
|
+
if (d.orbitalSource !== OrbitalSource.SPICE) return d;
|
|
6293
|
+
const zone = this.findAsteroidZone(d.id);
|
|
6294
|
+
return zone === void 0 ? void 0 : this.asteroidBodiesByZone.get(zone)?.get(d.id)?.data;
|
|
6295
|
+
}
|
|
6290
6296
|
maxMoonA(parentId) {
|
|
6291
6297
|
return this.moonMaxAByParent.get(parentId);
|
|
6292
6298
|
}
|
|
@@ -12101,6 +12107,26 @@ function isReversedDepth() {
|
|
|
12101
12107
|
function ndcZVisible(z) {
|
|
12102
12108
|
return reversed ? z >= 0 && z <= 1 : z >= -1 && z <= 1;
|
|
12103
12109
|
}
|
|
12110
|
+
var LOG_DEPTH_FLOOR = -44;
|
|
12111
|
+
function installLogDepthChunks() {
|
|
12112
|
+
ShaderChunk.logdepthbuf_vertex = `
|
|
12113
|
+
#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
|
|
12114
|
+
vFragDepth = gl_Position.w;
|
|
12115
|
+
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
|
|
12116
|
+
#endif
|
|
12117
|
+
`;
|
|
12118
|
+
ShaderChunk.logdepthbuf_fragment = `
|
|
12119
|
+
#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
|
|
12120
|
+
gl_FragDepth = vIsPerspective == 0.0
|
|
12121
|
+
? gl_FragCoord.z
|
|
12122
|
+
: max( log2( vFragDepth ) - ${LOG_DEPTH_FLOOR.toFixed(1)}, 0.0 ) / ( 2.0 / logDepthBufFC - ${LOG_DEPTH_FLOOR.toFixed(1)} );
|
|
12123
|
+
#endif
|
|
12124
|
+
`;
|
|
12125
|
+
}
|
|
12126
|
+
function logDepthToEyeGlsl(depth, far) {
|
|
12127
|
+
const floor = LOG_DEPTH_FLOOR.toFixed(1);
|
|
12128
|
+
return `exp2(${depth} * (log2(${far} + 1.0) - ${floor}) + ${floor})`;
|
|
12129
|
+
}
|
|
12104
12130
|
|
|
12105
12131
|
//#endregion
|
|
12106
12132
|
//#region src/lib/scene/label/throttled-renderer.ts
|
|
@@ -12419,6 +12445,7 @@ var WebGLUnavailableError = class extends Error {
|
|
|
12419
12445
|
function bootThree(canvas, labelContainer, ctx) {
|
|
12420
12446
|
let renderer;
|
|
12421
12447
|
const reversedDepth = probeClipControl();
|
|
12448
|
+
if (!reversedDepth) installLogDepthChunks();
|
|
12422
12449
|
try {
|
|
12423
12450
|
renderer = new WebGLRenderer(reversedDepth ? {
|
|
12424
12451
|
canvas,
|
|
@@ -15294,7 +15321,7 @@ var FRAGMENT_SHADER = `
|
|
|
15294
15321
|
if (hitGeom && fwd > 1e-4) {
|
|
15295
15322
|
float terrainW = uReversedDepth > 0.5
|
|
15296
15323
|
? uCameraNear * uCameraFar / (d * (uCameraFar - uCameraNear) + uCameraNear)
|
|
15297
|
-
:
|
|
15324
|
+
: ${logDepthToEyeGlsl("d", "uCameraFar")};
|
|
15298
15325
|
float tTerrain = terrainW * dLen / (uPlanetRadiusScene * fwd);
|
|
15299
15326
|
if (tTerrain < tEnd) {
|
|
15300
15327
|
tEnd = tTerrain;
|
|
@@ -21429,6 +21456,18 @@ function updatePositions(params) {
|
|
|
21429
21456
|
ctx.bodies.hostRead.delete(id);
|
|
21430
21457
|
return false;
|
|
21431
21458
|
};
|
|
21459
|
+
const elementRowOffset = (body, parentPos) => {
|
|
21460
|
+
const row = ctx.bodies.elementRow(body);
|
|
21461
|
+
const rowParentPos = row && positionMap.get(row.parentId);
|
|
21462
|
+
if (!rowParentPos) return null;
|
|
21463
|
+
const offset = row.q != null ? parabolicToPositionJD(row, jd) : orbitalElementsToPositionJD(row, jd);
|
|
21464
|
+
if (!offset) return null;
|
|
21465
|
+
return [
|
|
21466
|
+
rowParentPos[0] - parentPos[0] + offset[0],
|
|
21467
|
+
rowParentPos[1] - parentPos[1] + offset[1],
|
|
21468
|
+
rowParentPos[2] - parentPos[2] + offset[2]
|
|
21469
|
+
];
|
|
21470
|
+
};
|
|
21432
21471
|
const computePosition = (body) => {
|
|
21433
21472
|
if (computed.has(body.data.id)) return;
|
|
21434
21473
|
computed.add(body.data.id);
|
|
@@ -21489,7 +21528,7 @@ function updatePositions(params) {
|
|
|
21489
21528
|
let y;
|
|
21490
21529
|
let z;
|
|
21491
21530
|
if (isChebTracked) {
|
|
21492
|
-
const chebOffset = ctx.chebStore.positionScene(d.id, jd);
|
|
21531
|
+
const chebOffset = ctx.chebStore.positionScene(d.id, jd) ?? elementRowOffset(body, parentPos);
|
|
21493
21532
|
if (!chebOffset) {
|
|
21494
21533
|
hide(true);
|
|
21495
21534
|
const coverage = ctx.chebStore.zoneCoverage(d.id);
|
|
@@ -23489,10 +23528,7 @@ function rotateByQuaternion(q, x, y, z, out, at) {
|
|
|
23489
23528
|
function bodyCentre(body, ctx, jd) {
|
|
23490
23529
|
return placeForRead(body, jd, ctx) ? body.position : null;
|
|
23491
23530
|
}
|
|
23492
|
-
function
|
|
23493
|
-
const body = ctx.getBody(anchor.body);
|
|
23494
|
-
const centre = body && bodyCentre(body, ctx, jd);
|
|
23495
|
-
if (!centre) return null;
|
|
23531
|
+
function placeAnchor(anchor, body, centre, jd) {
|
|
23496
23532
|
const [cx, cy, cz] = centre;
|
|
23497
23533
|
if (isSurface(anchor)) {
|
|
23498
23534
|
const distance = kmToScene(effectiveRadiusKm(body.data) + (anchor.altitudeKm ?? 0));
|
|
@@ -23529,6 +23565,11 @@ function resolveAnchor(anchor, ctx, jd) {
|
|
|
23529
23565
|
cz + oz
|
|
23530
23566
|
];
|
|
23531
23567
|
}
|
|
23568
|
+
function resolveAnchor(anchor, ctx, jd) {
|
|
23569
|
+
const body = ctx.getBody(anchor.body);
|
|
23570
|
+
const centre = body && bodyCentre(body, ctx, jd);
|
|
23571
|
+
return centre ? placeAnchor(anchor, body, centre, jd) : null;
|
|
23572
|
+
}
|
|
23532
23573
|
function anchorNormal(anchor, world, ctx, jd) {
|
|
23533
23574
|
const body = ctx.getBody(anchor.body);
|
|
23534
23575
|
const centre = body && bodyCentre(body, ctx, jd);
|
|
@@ -27321,13 +27362,7 @@ function anchorDistanceKm(a, b, ctx, jd) {
|
|
|
27321
27362
|
const offset = anchorOffsetKm(a, b, ctx, jd);
|
|
27322
27363
|
return offset && Math.hypot(...offset);
|
|
27323
27364
|
}
|
|
27324
|
-
function
|
|
27325
|
-
const body = ctx.getBody(id);
|
|
27326
|
-
const sun = ctx.getBody(SUN_ID);
|
|
27327
|
-
if (!body || !sun || body === sun) return null;
|
|
27328
|
-
if (!body.orientation && !ctx.bodies.orientationRead.has(id)) return null;
|
|
27329
|
-
const centre = bodyCentre(body, ctx, jd);
|
|
27330
|
-
if (!centre) return null;
|
|
27365
|
+
function subsolarAt(body, centre, sun, jd) {
|
|
27331
27366
|
const turn = body.orientation ? bodyQuaternion(body.orientation, jd, body.nutPrec).toArray() : [
|
|
27332
27367
|
0,
|
|
27333
27368
|
0,
|
|
@@ -27335,9 +27370,9 @@ function subsolarPoint(id, ctx, jd) {
|
|
|
27335
27370
|
1
|
|
27336
27371
|
];
|
|
27337
27372
|
const { latitude, longitude, distance } = cartesianToSpherical([
|
|
27338
|
-
sun
|
|
27339
|
-
sun
|
|
27340
|
-
sun
|
|
27373
|
+
sun[0],
|
|
27374
|
+
sun[1],
|
|
27375
|
+
sun[2]
|
|
27341
27376
|
], [
|
|
27342
27377
|
centre[0],
|
|
27343
27378
|
centre[1],
|
|
@@ -27348,6 +27383,14 @@ function subsolarPoint(id, ctx, jd) {
|
|
|
27348
27383
|
lat: latitude
|
|
27349
27384
|
} : null;
|
|
27350
27385
|
}
|
|
27386
|
+
function subsolarPoint$1(id, ctx, jd) {
|
|
27387
|
+
const body = ctx.getBody(id);
|
|
27388
|
+
const sun = ctx.getBody(SUN_ID);
|
|
27389
|
+
if (!body || !sun || body === sun) return null;
|
|
27390
|
+
if (!body.orientation && !ctx.bodies.orientationRead.has(id)) return null;
|
|
27391
|
+
const centre = bodyCentre(body, ctx, jd);
|
|
27392
|
+
return centre && subsolarAt(body, centre, sun.position, jd);
|
|
27393
|
+
}
|
|
27351
27394
|
|
|
27352
27395
|
//#endregion
|
|
27353
27396
|
//#region src/lib/interaction/gesture.ts
|
|
@@ -27667,7 +27710,7 @@ var SpaceMap = class {
|
|
|
27667
27710
|
return anchorOffsetKm(from, to, this.ctx, this.placedJd);
|
|
27668
27711
|
}
|
|
27669
27712
|
getSubsolarPoint(id) {
|
|
27670
|
-
return subsolarPoint(id, this.ctx, this.placedJd);
|
|
27713
|
+
return subsolarPoint$1(id, this.ctx, this.placedJd);
|
|
27671
27714
|
}
|
|
27672
27715
|
load(targetId = this.initialView.id) {
|
|
27673
27716
|
return this.ctx.load(jdToDate(this.clock.jd), targetId);
|
|
@@ -32216,6 +32259,158 @@ function kmToAu(km) {
|
|
|
32216
32259
|
return km / AU_KM;
|
|
32217
32260
|
}
|
|
32218
32261
|
|
|
32262
|
+
//#endregion
|
|
32263
|
+
//#region src/lib/scene/extensions/ephemeris.ts
|
|
32264
|
+
var chebyshev = null;
|
|
32265
|
+
var queue = Promise.resolve();
|
|
32266
|
+
function inTurn(read) {
|
|
32267
|
+
const turn = queue.then(read, read);
|
|
32268
|
+
queue = turn.catch(() => {});
|
|
32269
|
+
return turn;
|
|
32270
|
+
}
|
|
32271
|
+
async function open(date) {
|
|
32272
|
+
const jd = dateToJD(date);
|
|
32273
|
+
const metadata = await fetchMetadata();
|
|
32274
|
+
if (!chebyshev) {
|
|
32275
|
+
const params = chebyshevZoneParams(metadata);
|
|
32276
|
+
if (params.size > 0) chebyshev = new ChebyshevStore(params);
|
|
32277
|
+
}
|
|
32278
|
+
try {
|
|
32279
|
+
await chebyshev?.ensure(jd).done;
|
|
32280
|
+
} catch (error) {
|
|
32281
|
+
chebyshev = null;
|
|
32282
|
+
throw error;
|
|
32283
|
+
}
|
|
32284
|
+
return {
|
|
32285
|
+
jd,
|
|
32286
|
+
metadata,
|
|
32287
|
+
chebyshev
|
|
32288
|
+
};
|
|
32289
|
+
}
|
|
32290
|
+
function discovered(visibleFromDays, jd) {
|
|
32291
|
+
return !(visibleFromDays !== void 0 && jd - 2451545 < visibleFromDays);
|
|
32292
|
+
}
|
|
32293
|
+
async function moonRow(id, { jd, metadata }) {
|
|
32294
|
+
const zone = metadata.position.zones.moons;
|
|
32295
|
+
const zoom = zone && flatZoom(zone);
|
|
32296
|
+
if (!zoom) return null;
|
|
32297
|
+
const cols = await fetchElements("moons", null, 0, isChunkIndexed(zoom) ? String(chunkIndexForJd(zoom, jd)) : null);
|
|
32298
|
+
for (let i = 0; i < cols.rowCount; i++) if (rowId(cols, i) === id) return materializeBodyData(cols, i, /* @__PURE__ */ new Map(), "naif");
|
|
32299
|
+
return null;
|
|
32300
|
+
}
|
|
32301
|
+
function elementsOffset(data, jd) {
|
|
32302
|
+
if (!discovered(data.visibleFromDays, jd)) return null;
|
|
32303
|
+
if (jd < data.validityStart || jd > data.validityEnd) return null;
|
|
32304
|
+
if (data.satrec) return sgp4PositionScene(data.satrec, jd);
|
|
32305
|
+
if (data.q != null) return parabolicToPositionJD(data, jd);
|
|
32306
|
+
if (data.a === 0) return [
|
|
32307
|
+
0,
|
|
32308
|
+
0,
|
|
32309
|
+
0
|
|
32310
|
+
];
|
|
32311
|
+
return orbitalElementsToPositionJD(data, jd);
|
|
32312
|
+
}
|
|
32313
|
+
async function locate(id, at) {
|
|
32314
|
+
const { jd } = at;
|
|
32315
|
+
if (at.chebyshev?.has(id)) {
|
|
32316
|
+
const body = at.chebyshev.body(id, jd);
|
|
32317
|
+
if (body && !discovered(body.visibleFromDays, jd)) return null;
|
|
32318
|
+
const offset = body && chebyshevPositionScene(body, jd);
|
|
32319
|
+
if (offset) {
|
|
32320
|
+
const { radiusKm, objectType } = body;
|
|
32321
|
+
return {
|
|
32322
|
+
data: {
|
|
32323
|
+
radiusKm,
|
|
32324
|
+
objectType,
|
|
32325
|
+
orbitalSource: OrbitalSource.SPICE
|
|
32326
|
+
},
|
|
32327
|
+
parentId: `naif-${body.parentId}`,
|
|
32328
|
+
offset
|
|
32329
|
+
};
|
|
32330
|
+
}
|
|
32331
|
+
if (id.startsWith("naif-")) return null;
|
|
32332
|
+
}
|
|
32333
|
+
const data = (id.startsWith("naif-") ? await moonRow(id, at) : null) ?? bodyDataFromGlobal(id, await fetchObjectDetail(id, false));
|
|
32334
|
+
const offset = data && elementsOffset(data, jd);
|
|
32335
|
+
return offset ? {
|
|
32336
|
+
data,
|
|
32337
|
+
parentId: data.parentId,
|
|
32338
|
+
offset
|
|
32339
|
+
} : null;
|
|
32340
|
+
}
|
|
32341
|
+
async function place(id, at, above = /* @__PURE__ */ new Set()) {
|
|
32342
|
+
if (above.has(id)) return null;
|
|
32343
|
+
const own = await locate(id, at);
|
|
32344
|
+
if (!own) return null;
|
|
32345
|
+
if (own.parentId === "naif-0") return {
|
|
32346
|
+
data: own.data,
|
|
32347
|
+
centre: own.offset
|
|
32348
|
+
};
|
|
32349
|
+
const parent = await place(own.parentId, at, new Set(above).add(id));
|
|
32350
|
+
if (!parent) return null;
|
|
32351
|
+
const [x, y, z] = parent.centre;
|
|
32352
|
+
return {
|
|
32353
|
+
data: own.data,
|
|
32354
|
+
centre: [
|
|
32355
|
+
x + own.offset[0],
|
|
32356
|
+
y + own.offset[1],
|
|
32357
|
+
z + own.offset[2]
|
|
32358
|
+
]
|
|
32359
|
+
};
|
|
32360
|
+
}
|
|
32361
|
+
async function spinOf(id) {
|
|
32362
|
+
const [detail] = await Promise.all([fetchObjectDetail(id, false), loadSystemsGlobal()]);
|
|
32363
|
+
const orientation = detail.global?.orientation;
|
|
32364
|
+
const sums = detail.global?.nut_prec;
|
|
32365
|
+
const naif = /^naif-(-?\d+)$/.exec(id);
|
|
32366
|
+
const angles = naif ? getNutPrecAngles(ownerIdFor(parseInt(naif[1], 10))) : void 0;
|
|
32367
|
+
return {
|
|
32368
|
+
orientation,
|
|
32369
|
+
nutPrec: sums && angles ? {
|
|
32370
|
+
...sums,
|
|
32371
|
+
angles
|
|
32372
|
+
} : void 0
|
|
32373
|
+
};
|
|
32374
|
+
}
|
|
32375
|
+
async function resolve(anchor, at) {
|
|
32376
|
+
const placed = await place(anchor.body, at);
|
|
32377
|
+
if (!placed) return null;
|
|
32378
|
+
const spin = "latitude" in anchor ? await spinOf(anchor.body) : {};
|
|
32379
|
+
return placeAnchor(anchor, {
|
|
32380
|
+
data: placed.data,
|
|
32381
|
+
...spin
|
|
32382
|
+
}, placed.centre, at.jd);
|
|
32383
|
+
}
|
|
32384
|
+
function offsetKm(from, to, date) {
|
|
32385
|
+
return inTurn(async () => {
|
|
32386
|
+
const at = await open(date);
|
|
32387
|
+
const a = await resolve(from, at);
|
|
32388
|
+
const b = a && await resolve(to, at);
|
|
32389
|
+
return a && b ? sceneToEcliptic([
|
|
32390
|
+
b[0] - a[0],
|
|
32391
|
+
b[1] - a[1],
|
|
32392
|
+
b[2] - a[2]
|
|
32393
|
+
]) : null;
|
|
32394
|
+
});
|
|
32395
|
+
}
|
|
32396
|
+
async function distanceKm(from, to, date) {
|
|
32397
|
+
const offset = await offsetKm(from, to, date);
|
|
32398
|
+
return offset && Math.hypot(...offset);
|
|
32399
|
+
}
|
|
32400
|
+
function subsolarPoint(id, date) {
|
|
32401
|
+
return inTurn(async () => {
|
|
32402
|
+
if (id === "naif-10") return null;
|
|
32403
|
+
const at = await open(date);
|
|
32404
|
+
const body = await place(id, at);
|
|
32405
|
+
const sun = body && await place("naif-10", at);
|
|
32406
|
+
if (!body || !sun) return null;
|
|
32407
|
+
return subsolarAt({
|
|
32408
|
+
data: body.data,
|
|
32409
|
+
...await spinOf(id)
|
|
32410
|
+
}, body.centre, sun.centre, at.jd);
|
|
32411
|
+
});
|
|
32412
|
+
}
|
|
32413
|
+
|
|
32219
32414
|
//#endregion
|
|
32220
32415
|
//#region src/lib/fetch/panoramas.ts
|
|
32221
32416
|
var index = null;
|
|
@@ -32336,5 +32531,5 @@ function applyHost(options) {
|
|
|
32336
32531
|
}
|
|
32337
32532
|
|
|
32338
32533
|
//#endregion
|
|
32339
|
-
export { AttributionControl, FlatAttributionControl, FlatMap, GestureHandler, MAP_LAYERS, PROJECTION_IDS, PanoramaAttributionControl, PanoramaView, SpaceMap, SystemMap, Viewport, bearingDeg, boxRing, circlePoints, configureHost, createFlatMap, createMap, createPanorama, createProjection, createSystemMap, dateToJD, defaultSceneSettings, elements, fetchPanoramaIndex, fetchPanoramas, findPanorama, fixed, graticule, groundDistanceM, isViewable, jdToDate, kmToAu, neighboursOf, panoramaAt, pathFor, planeBasis, projectionAspect, samples, smallCircle, tle };
|
|
32534
|
+
export { AttributionControl, FlatAttributionControl, FlatMap, GestureHandler, MAP_LAYERS, PROJECTION_IDS, PanoramaAttributionControl, PanoramaView, SpaceMap, SystemMap, Viewport, bearingDeg, boxRing, circlePoints, configureHost, createFlatMap, createMap, createPanorama, createProjection, createSystemMap, dateToJD, defaultSceneSettings, distanceKm, elements, fetchPanoramaIndex, fetchPanoramas, findPanorama, fixed, graticule, groundDistanceM, isViewable, jdToDate, kmToAu, neighboursOf, offsetKm, panoramaAt, pathFor, planeBasis, projectionAspect, samples, smallCircle, subsolarPoint, tle };
|
|
32340
32535
|
(function(){if(typeof document==='undefined')return;var s=document.createElement('style');s.textContent=".scene-label{pointer-events:auto;cursor:pointer;-webkit-user-select:none;user-select:none;color:inherit;touch-action:none;z-index:1;width:32px;height:32px;text-decoration:none;display:block;position:relative;left:0}.scene-label__halo{border-radius:50%;width:100%;height:100%;transition:transform .1s}.scene-label__halo--spacecraft,.scene-label__halo--debris{overflow:visible}.scene-label__loader{box-sizing:border-box;pointer-events:none;border:2px solid #fff;border-color:#fff #fff #fff3 #fff3;border-radius:50%;width:32px;height:32px;margin:auto;animation:.9s linear infinite scene-label-loader-spin;position:fixed;inset:0}@keyframes scene-label-loader-spin{to{transform:rotate(360deg)}}.reduce-motion .scene-label__loader{animation-duration:.9s!important;animation-iteration-count:infinite!important}.scene-label__name{white-space:nowrap;pointer-events:auto;cursor:pointer;color:#fff;text-shadow:0 0 4px #000,0 0 4px #000;padding-left:8px;font-size:14px;font-weight:700;text-decoration:none;position:absolute;top:50%;left:32px;transform:translateY(-50%)}.scene-label__name--large{font-size:16px}.scene-label__annotations{top:28px;pointer-events:none;flex-direction:column;padding-inline-start:8px;display:flex;position:absolute;inset-inline-start:32px}.scene-label__annotation{opacity:0;white-space:nowrap;color:#fff9;text-shadow:0 0 3px #000,0 0 3px #000;transition:opacity .15s, display .15s allow-discrete;font-size:11px;line-height:1.3;display:none}.scene-label__annotation--visible{opacity:1;display:block}@starting-style{.scene-label__annotation--visible{opacity:0}}.scene-feature-label{color:#ffffffb3;white-space:nowrap;pointer-events:auto;cursor:pointer;-webkit-user-select:none;user-select:none;text-shadow:0 0 2px #000,0 0 2px #000;z-index:0;font-size:12px;transition:color .1s;left:0}.scene-feature-label:hover{color:#fff;text-shadow:0 0 3px #000,0 0 3px #000}.scene-feature-label--active{color:#fff;font-size:14px;font-weight:600}.scene-path-label{color:#fff;font:inherit;white-space:nowrap;text-align:start;text-shadow:0 0 4px #000,0 0 4px #000;pointer-events:auto;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:none;z-index:2;background:0 0;border:0;align-items:center;gap:8px;padding:0;line-height:1.15;display:flex;left:0}.scene-path-label--static{pointer-events:none;cursor:default}.scene-path-label__halo{border-radius:50%;flex-shrink:0;width:32px;height:32px;margin-inline-start:-16px;transition:transform .1s}.scene-path-label:hover .scene-path-label__halo{transform:scale(1.15)}.scene-path-label__text{flex-direction:column;gap:1px;display:flex}.scene-path-label__name{font-size:14px;font-weight:700}.scene-path-label__when{opacity:.8;font-variant-numeric:tabular-nums;font-size:12px}.scene-path-label--dim .scene-path-label__text{display:none}.scene-path-label--dim .scene-path-label__halo{transform:scale(.55)}.scene-path-label--dim:hover .scene-path-label__halo{transform:scale(.75)}.scene-path-label--step .scene-path-label__halo{background:0 0;border:0}.scene-path-label--step:hover .scene-path-label__halo{background:#ffffff1f}.scene-path-label--step .scene-path-label__name{font-size:12px;font-weight:600}.scene-path-label--step .scene-path-label__when{font-size:11px}.scene-path-label__hazard{font-size:11px;font-weight:700}.scene-path-label--lit{color:#fff}.scene-path-label--lit .scene-path-label__halo{transform:scale(1.15)}.scene-path-label--lit.scene-path-label--dim .scene-path-label__halo{transform:scale(.75)}.scene-path-label--faint .scene-path-label__text{display:none}.scene-path-label--faint .scene-path-label__halo{opacity:.45;transform:scale(.5)}.scene-path-label--faint:hover .scene-path-label__halo{opacity:1;transform:scale(.75)}.scene-overlay--no-names .scene-label__name,.scene-overlay--no-names .scene-label__annotations{display:none}.scene-hazard-label{white-space:nowrap;pointer-events:none;-webkit-user-select:none;user-select:none;text-shadow:0 0 4px #000,0 0 4px #000;margin-inline-start:16px;font-size:12px;font-weight:700;position:relative;left:0}.user-location-marker{pointer-events:none;background:#1a73e8;border:2px solid #fff;border-radius:50%;width:16px;height:16px;box-shadow:0 0 6px #0006}.sm-drawing-label{white-space:nowrap;color:#fff;text-shadow:0 0 4px #000,0 0 4px #000;-webkit-user-select:none;user-select:none;pointer-events:none;font:700 14px/1.2 system-ui,sans-serif}.sm-drawing-icon{-webkit-user-select:none;user-select:none;pointer-events:none;display:block}.sm-drawing--interactive{pointer-events:auto;cursor:pointer;touch-action:none}.sm-cooperative-hint{z-index:4;color:#fff;text-align:center;pointer-events:none;opacity:0;background:#0000008c;place-content:center;padding:16px;font:15px/1.4 system-ui,sans-serif;transition:opacity .2s;display:grid;position:absolute;inset:0}.sm-cooperative-hint--shown{opacity:1}@media (prefers-reduced-motion:reduce){.sm-cooperative-hint{transition:none}}.sm-ctrl{z-index:2;pointer-events:none;flex-direction:column;gap:6px;max-width:100%;padding:6px;display:flex;position:absolute}.sm-ctrl>*{pointer-events:auto}.sm-ctrl--top-left{align-items:flex-start;top:0;left:0}.sm-ctrl--top-right{align-items:flex-end;top:0;right:0}.sm-ctrl--bottom-left{align-items:flex-start;bottom:0;left:0}.sm-ctrl--bottom-right{align-items:flex-end;bottom:0;right:0}.sm-map{-webkit-user-select:none;user-select:none}:where(.sm-map){width:100%;height:100%;position:relative}.sm-map__canvas{pointer-events:auto;touch-action:none;width:100%;height:100%;display:block}.sm-map__canvas:focus-visible{outline:2px solid var(--ring,Highlight)}.sm-map .scene-overlay{pointer-events:none;z-index:0;position:absolute;inset:0}.sm-flat{touch-action:none;background:#05070e;width:100%;height:100%;position:relative;overflow:hidden}.sm-flat__raster,.sm-flat__vector,.sm-flat__markers{width:100%;height:100%;position:absolute;inset:0}.sm-flat__raster{display:block}.sm-flat__vector,.sm-flat__markers{pointer-events:none}.sm-flat--interactive{cursor:grab}.sm-flat--cooperative{touch-action:pan-x pan-y}.sm-flat--dragging{cursor:grabbing}.sm-flat__graticule{fill:none;stroke:#ffffff47;stroke-width:1px}.sm-flat__frame{fill:none;stroke:#ffffff73;stroke-width:1px}.sm-flat__feature-dot{fill:#fffc}.sm-flat__feature-label{fill:#ffffffd9;paint-order:stroke;stroke:#000000a6;stroke-width:2.5px;font:10px/1 system-ui,sans-serif}.sm-flat__marker-dot{background:#4ea3ff;border:2px solid #fff;border-radius:50%;width:10px;height:10px;box-shadow:0 0 0 1px #00000073}.sm-system-map{border-radius:var(--sm-system-map-radius,6px);background:var(--sm-system-map-background,#ffffff0d);width:100%;color:var(--sm-system-map-ink,#ffffff9e);position:relative;overflow:hidden}.sm-system-map--background{pointer-events:none;background:0 0;border-radius:0;height:100%}.sm-system-map__svg{touch-action:pan-y;width:100%;height:auto;display:block}.sm-system-map--background .sm-system-map__svg{height:100%}.sm-system-map__svg--near :is(a,.sm-system-map__button):not([data-near]){pointer-events:none}.sm-system-map__button{cursor:pointer}.sm-system-map__button:focus{outline:none}.sm-system-map__reference{opacity:.6}.sm-system-map__band--muted{color:var(--sm-system-map-ink,#ffffff9e)}.sm-system-map__band--sky{color:var(--sm-system-map-sky,oklch(74.6% .16 232.661/.7))}.sm-system-map__band--amber{color:var(--sm-system-map-amber,oklch(92.4% .12 95.746/.8))}.sm-system-map__band-label{font-weight:600}.sm-system-map__band-label--muted{fill:var(--sm-system-map-ink,#ffffff9e)}.sm-system-map__band-label--sky{fill:var(--sm-system-map-sky-label,oklch(74.6% .16 232.661))}.sm-system-map__band-label--amber{fill:var(--sm-system-map-amber-label,oklch(92.4% .12 95.746/.9))}.sm-system-map__tip{z-index:10;background:var(--sm-system-map-tip-background,#0a0c14e6);width:max-content;color:var(--sm-system-map-tip-ink,#fffffff2);white-space:nowrap;pointer-events:none;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border-radius:.25rem;padding:.25rem .5rem;font-size:.75rem;line-height:1.33333;position:absolute;transform:translate(-50%);box-shadow:0 1px 3px #0000001a,0 1px 2px -1px #0000001a}.sm-system-map__tip[hidden]{display:none}.sm-system-map__tip-title{font-weight:500}.sm-system-map__tip-sub{color:var(--sm-system-map-ink,#ffffff9e)}.sm-ctrl:has(>.sm-attribution:only-child){padding:0}.sm-ctrl--top-left:has(>.sm-attribution:only-child)>.sm-attribution{border-radius:0 0 var(--sm-attribution-radius) 0}.sm-ctrl--top-right:has(>.sm-attribution:only-child)>.sm-attribution{border-radius:0 0 0 var(--sm-attribution-radius)}.sm-ctrl--bottom-left:has(>.sm-attribution:only-child)>.sm-attribution{border-radius:0 var(--sm-attribution-radius) 0 0}.sm-ctrl--bottom-right:has(>.sm-attribution:only-child)>.sm-attribution{border-radius:var(--sm-attribution-radius) 0 0 0}.sm-attribution{--sm-attribution-radius:3px;border-radius:var(--sm-attribution-radius);color:#ffffffbf;white-space:nowrap;background:#0006;align-items:center;gap:.5em;max-width:100%;padding:1px 6px;font:11px/1.45 system-ui,sans-serif;display:flex}.sm-attribution a{color:inherit;text-decoration:none}.sm-attribution a:hover{color:#fff;text-decoration:underline}.sm-attribution__home{font-weight:600}.sm-attribution__group{text-overflow:ellipsis;overflow:hidden}.sm-attribution__label{color:#ffffff80}\n/*$vite$:1*/";document.head.appendChild(s);})();
|
package/package.json
CHANGED