spacemap 0.1.11 → 0.1.13
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 +32 -9
- package/dist/spacemap.iife.js +167 -105
- package/dist/spacemap.js +167 -105
- package/index.d.ts +37 -15
- package/index.js +603 -274
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,14 +16,15 @@ The code is MPL-2.0. The data and imagery the map fetches keep the terms of
|
|
|
16
16
|
their sources, which is why the credit line the map draws is not removable:
|
|
17
17
|
these license require attribution.
|
|
18
18
|
|
|
19
|
-
Every surface map and
|
|
20
|
-
what a page may use:
|
|
19
|
+
Every surface map, panorama and spacecraft model is ranked by its terms, and
|
|
20
|
+
the SDK draws only what a page may use:
|
|
21
21
|
|
|
22
|
-
- **Open** imagery
|
|
23
|
-
and all a map draws unless asked otherwise.
|
|
24
|
-
- **Non-commercial** imagery
|
|
25
|
-
use: the Uranus map,
|
|
26
|
-
|
|
22
|
+
- **Open** imagery and models are free for any use, commercial included. They
|
|
23
|
+
are the default and all a map draws unless asked otherwise.
|
|
24
|
+
- **Non-commercial** imagery and models are licensed for educational and
|
|
25
|
+
non-commercial use: the Uranus map, the Huygens descent panorama of Titan,
|
|
26
|
+
and the models of a few craft, most of them Soviet (Buran, Vostok, Lunokhod,
|
|
27
|
+
Salyut 1). A page that is not commercial turns them on:
|
|
27
28
|
|
|
28
29
|
```js
|
|
29
30
|
const map = await createMap({ container: '#map', includeNonCommercial: true });
|
|
@@ -31,7 +32,9 @@ what a page may use:
|
|
|
31
32
|
|
|
32
33
|
Asking for it is accepting its terms, and the credit line naming each author
|
|
33
34
|
is part of those terms. Without the flag Uranus renders in a flat fallback
|
|
34
|
-
colour,
|
|
35
|
+
colour, the Huygens stop is a place on Titan with no panorama to open, and
|
|
36
|
+
those craft stay markers with no model. Mir is the exception: it has an open
|
|
37
|
+
model too, and the map draws that one.
|
|
35
38
|
|
|
36
39
|
- **Site-only** imagery is licensed to spacemap.co alone and never reaches the
|
|
37
40
|
SDK.
|
|
@@ -44,7 +47,7 @@ your page:
|
|
|
44
47
|
```html
|
|
45
48
|
<div id="map" style="height: 500px"></div>
|
|
46
49
|
<script type="module">
|
|
47
|
-
import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.
|
|
50
|
+
import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.13/dist/spacemap.js';
|
|
48
51
|
const map = await createMap({ container: '#map' });
|
|
49
52
|
</script>
|
|
50
53
|
```
|
|
@@ -184,6 +187,26 @@ moons and small bodies as the map does. Spacecraft are not placed, and a
|
|
|
184
187
|
satellite of Earth only near the present: those need the map. A failed
|
|
185
188
|
download rejects.
|
|
186
189
|
|
|
190
|
+
`sunlight` is a fourth, with no map form. It says how much of the Sun's light
|
|
191
|
+
reaches a body, which is how to know that the map will draw it in eclipse:
|
|
192
|
+
|
|
193
|
+
```js
|
|
194
|
+
import { sunlight } from 'spacemap';
|
|
195
|
+
|
|
196
|
+
// Enceladus goes into the shadow of Saturn.
|
|
197
|
+
await sunlight('naif-602', new Date('2026-10-08T04:19:00Z')); // 1
|
|
198
|
+
await sunlight('naif-602', new Date('2026-10-08T04:20:00Z')); // 0.6
|
|
199
|
+
await sunlight('naif-602', new Date('2026-10-08T04:21:00Z')); // 0
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
It is 1 in full sunlight and 0 when the whole body is in the shadow of another;
|
|
203
|
+
between the two, that share of its sunlit face is lit. The bodies of its own
|
|
204
|
+
system are what can be in the way: the body it orbits, and the planet and moons
|
|
205
|
+
that orbit the same body. Each is a ball of the radius the map draws it with,
|
|
206
|
+
and the shadow is the one the map shades with. The answer is a mean over 1024
|
|
207
|
+
points of the sunlit face, so a shadow smaller than a thousandth of that face
|
|
208
|
+
can be missed: a small moon's on its planet, say.
|
|
209
|
+
|
|
187
210
|
### Drawing on it
|
|
188
211
|
|
|
189
212
|
Everything you draw is put somewhere by an **anchor**, and the anchor is what
|