リファレンス · データの入口(自分で用意した地球の地図や軌道データを、ライセンスと出典つきのソースとして渡し、いま画面にあるのは誰のデータかを示します)
elementsFrom関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A source of element sets read from an address of your choosing, with whose data it is. The address is read through fetchElements, so its politeness rules apply (one request in two hours, a refusal is left alone for an hour,
nothing at rest); the sets are read once, when the source is added. The package has no address of its own and never asks one by itself.
インポート
import { elementsFrom } from "@johnmorrisdotca/chikyu-earth/door";
定義
function elementsFrom(url: string, info: SourceInfo, options?: FetchElementsOptions): ElementRecordSource
引数
| 名前 | 型 | 説明 |
|---|---|---|
url | string | The address of OMM JSON, OMM CSV or TLE text. |
info | SourceInfo | Who the data is: its id, credit, licence and page. |
options (省略可) | FetchElementsOptions | What |
戻り値
ElementRecordSource
The source, for addSource or sources.
例
import { elementsFrom } from "@johnmorrisdotca/chikyu-earth/door";
const mine = elementsFrom("https://example.org/elements/bright.json", {
id: "my-elements",
name: { en: "My elements", ja: "私の軌道要素" },
credit: { en: "Orbit data: my own mirror", ja: "軌道データ:私のミラー" },
licence: { name: "CC BY 4.0", url: "https://creativecommons.org/licenses/by/4.0/" },
url: "https://example.org/elements/",
retrieved: "2026-11-11",
});
console.log(mine.info.id);この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。