spacemap 0.1.5 → 0.1.7
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 +22 -3
- package/dist/spacemap.iife.js +49 -38
- package/dist/spacemap.js +55 -44
- package/index.d.ts +19 -1
- package/index.js +232 -28
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -44,7 +44,7 @@ your page:
|
|
|
44
44
|
```html
|
|
45
45
|
<div id="map" style="height: 500px"></div>
|
|
46
46
|
<script type="module">
|
|
47
|
-
import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.
|
|
47
|
+
import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.7/dist/spacemap.js';
|
|
48
48
|
const map = await createMap({ container: '#map' });
|
|
49
49
|
</script>
|
|
50
50
|
```
|
|
@@ -166,6 +166,24 @@ anchor there is on the lit side even on a body whose spin is not measured. It
|
|
|
166
166
|
is null as well until the map has read how the body spins, which it does once
|
|
167
167
|
the camera is on the body or its system.
|
|
168
168
|
|
|
169
|
+
The same three measures are functions that need no map, for a page that has
|
|
170
|
+
none or that cannot wait for one to reach a date. They take the date and
|
|
171
|
+
resolve when the export has answered for it:
|
|
172
|
+
|
|
173
|
+
```js
|
|
174
|
+
import { distanceKm, offsetKm, subsolarPoint } from 'spacemap';
|
|
175
|
+
|
|
176
|
+
const landing = new Date('1971-07-30T22:16:00Z');
|
|
177
|
+
await distanceKm({ body: 'naif-301' }, { body: 'naif-499' }, landing);
|
|
178
|
+
await offsetKm({ body: 'naif-301' }, { body: 'naif-499' }, landing);
|
|
179
|
+
await subsolarPoint('naif-301', landing);
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Null means nowhere at that date and never not loaded yet. They place planets,
|
|
183
|
+
moons and small bodies as the map does. Spacecraft are not placed, and a
|
|
184
|
+
satellite of Earth only near the present: those need the map. A failed
|
|
185
|
+
download rejects.
|
|
186
|
+
|
|
169
187
|
### Drawing on it
|
|
170
188
|
|
|
171
189
|
Everything you draw is put somewhere by an **anchor**, and the anchor is what
|
|
@@ -417,8 +435,9 @@ object first, then the chrome drawn around them:
|
|
|
417
435
|
|
|
418
436
|
`planets`, `dwarfPlanets`, `moons`, `asteroids`, `comets`, `spacecraft`,
|
|
419
437
|
`satellites` (the ones round Earth), `debris`, `orbits`, `labels` (the names of
|
|
420
|
-
objects), `
|
|
421
|
-
|
|
438
|
+
objects), `halos` (the rings that mark objects too far to show a disc),
|
|
439
|
+
`nomenclature` (the names of places on them) and `stars` (the sky behind
|
|
440
|
+
everything).
|
|
422
441
|
|
|
423
442
|
```js
|
|
424
443
|
const map = await createMap({
|