spacemap 0.1.0 → 0.1.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/README.md CHANGED
@@ -7,24 +7,53 @@ Distances are kilometres and angles are degrees throughout. Objects are named
7
7
  by their export id — `naif-399` for Earth, `spkid-20000004` for Vesta,
8
8
  `norad_satcat-25544` for the ISS.
9
9
 
10
- Licensed MPL-2.0. No key, no quota for now. The credit line the map draws is
11
- not removable: the imagery it shows requires attribution. Some body textures
12
- are licensed for non-commercial use only.
10
+ No key, no quota for now.
11
+
12
+ ## Licensing
13
+
14
+ The code is MPL-2.0. The data and imagery the map fetches keep the terms of
15
+ their sources, which is why the credit line the map draws is not removable:
16
+ these license require attribution.
17
+
18
+ Every surface map and panorama is ranked by its terms, and the SDK draws only
19
+ what a page may use:
20
+
21
+ - **Open** imagery is free for any use, commercial included. It is the default
22
+ and all a map draws unless asked otherwise.
23
+ - **Non-commercial** imagery is licensed for educational and non-commercial
24
+ use: the Uranus map, and the Huygens descent panorama of Titan. A page that
25
+ is not commercial turns it on:
26
+
27
+ ```js
28
+ const map = await createMap({ container: '#map', includeNonCommercial: true });
29
+ ```
30
+
31
+ Asking for it is accepting its terms, and the credit line naming each author
32
+ is part of those terms. Without the flag Uranus renders in a flat fallback
33
+ colour, and the Huygens stop is a place on Titan with no panorama to open.
34
+
35
+ - **Site-only** imagery is licensed to spacemap.co alone and never reaches the
36
+ SDK.
13
37
 
14
38
  ## Getting it
15
39
 
16
- As one script that carries everything it needs — `spacemap.js`, an ES module,
17
- next to `spacemap.iife.js` for pages that want a global instead:
40
+ As one script that carries everything it needs, from the CDN or copied next to
41
+ your page:
18
42
 
19
43
  ```html
20
44
  <div id="map" style="height: 500px"></div>
21
45
  <script type="module">
22
- import { createMap } from './spacemap.js';
46
+ import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.2/dist/spacemap.js';
23
47
  const map = await createMap({ container: '#map' });
24
48
  </script>
25
49
  ```
26
50
 
27
- Or from npm, where three.js is yours to provide:
51
+ `spacemap.iife.js` next to it defines a `spacemap` global instead, for pages
52
+ without modules. Pin the version you tested: a published version never changes,
53
+ and an `integrity` attribute with the file's `sha384` digest keeps the page from
54
+ running anything else.
55
+
56
+ Or from npm, where you also need to provide three.js:
28
57
 
29
58
  ```sh
30
59
  npm install spacemap three
@@ -167,6 +196,8 @@ map.addSurfaceCircle({ body: 'naif-499', center: { lon: 77.5, lat: 18.4 }, radiu
167
196
 
168
197
  `boxRing`, `smallCircle` and `graticule`, the flat map's helpers, make point
169
198
  lists these take; `circlePoints` does the same for a circle in space.
199
+ `groundDistanceM` and `bearingDeg` measure between any two places on a body,
200
+ given its radius.
170
201
 
171
202
  Every drawing answers `remove()` and `setVisible()`, a shape answers
172
203
  `setAnchor()` and `setPoints()`, and `map.clearDrawings()` takes them all away
@@ -435,6 +466,19 @@ A rover's panorama from the inside, with arrows along its traverse. The
435
466
  three-dimensional part is all the SDK draws; the date, the place, a list to
436
467
  pick from or a map of the traverse are the page's to build.
437
468
 
469
+ Which bodies have panoramas, and where each one stands, can be read before a
470
+ view exists — what a page picking one for the reader needs, since `createPanorama`
471
+ opens the body's first unless told which:
472
+
473
+ ```js
474
+ import { fetchPanoramaIndex, fetchPanoramas } from 'spacemap';
475
+
476
+ await fetchPanoramaIndex(); // every body with coverage, and the missions on it
477
+ const entries = await fetchPanoramas('naif-499'); // every panorama on Mars
478
+ const pick = entries[(Math.random() * entries.length) | 0];
479
+ const view = await createPanorama({ container: '#panorama', body: 'naif-499', at: pick.id });
480
+ ```
481
+
438
482
  ```js
439
483
  const view = await createPanorama({
440
484
  container: '#panorama',
@@ -0,0 +1,65 @@
1
+ This bundle carries the following packages, under their own licences.
2
+
3
+ ========================================================================
4
+ satellite.js 7.0.0 — MIT
5
+ ========================================================================
6
+
7
+ MIT License
8
+
9
+ Copyright (C) 2013 Shashwat Kandadai, UCSC Jack Baskin School of Engineering
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ ========================================================================
30
+ svelte 5.56.1 — MIT
31
+ ========================================================================
32
+
33
+ Copyright (c) 2016-2025 [Svelte Contributors](https://github.com/sveltejs/svelte/graphs/contributors)
34
+
35
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
36
+
37
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
38
+
39
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40
+
41
+ ========================================================================
42
+ three 0.183.2 — MIT
43
+ ========================================================================
44
+
45
+ The MIT License
46
+
47
+ Copyright © 2010-2026 three.js authors
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining a copy
50
+ of this software and associated documentation files (the "Software"), to deal
51
+ in the Software without restriction, including without limitation the rights
52
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
+ copies of the Software, and to permit persons to whom the Software is
54
+ furnished to do so, subject to the following conditions:
55
+
56
+ The above copyright notice and this permission notice shall be included in
57
+ all copies or substantial portions of the Software.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
65
+ THE SOFTWARE.