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 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.5/dist/spacemap.js';
47
+ import { createMap } from 'https://cdn.jsdelivr.net/npm/spacemap@0.1.6/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