本文へ移動

Chikyu Earth地球

世界の国の輪郭を線で描いた地球儀です。地球と同じ速さで回ります。宇宙から見たような地球と、好きな場所の目印も使えます。

「地球」(ちきゅう) は、私たちが住む星の名前です。 名前について(英語)

目次

リファレンス · データの入口(自分で用意した地球の地図や軌道データを、ライセンスと出典つきのソースとして渡し、いま画面にあるのは誰のデータかを示します)

createTileStore関数

リファレンスの説明と例は英語です。見出しと目次は日本語です。

A tile store for a view: loads the tiles of every source by key and keeps them under one budget of bytes (default 48 MB, all sources together).

  • At most maxInFlight loads (6) run at once for a source, and a load starts only because the keys changed: at rest the store sends nothing, and a tile that failed waits for the next change.
  • The least recently used tile goes first when room is needed, and never a tile the view needs now. If a new tile does not fit even so, it is refused and counted: the held bytes never pass the budget (nor the count, if maxTiles is set).
  • A tile that throws, comes back empty or reports a size that is not a finite number is counted in failed and never held, so it is never drawn.
  • drop(sourceId) aborts the source's loads and frees its tiles.

インポート

import { createTileStore } from "@johnmorrisdotca/chikyu-earth/door";

定義

function createTileStore<Tile>(options?: TileStoreOptions): TileStore<Tile>

引数

名前型説明
options (省略可)TileStoreOptions

Budget, loads in flight, and a callback for a redraw.

戻り値

TileStore<Tile>

The store.

例

import { createTileStore } from "./data-door.ts";

const store = createTileStore<Tile>({ onChange: draw });
const held = store.want(source, source.need(place, detail)); // draws what is held now; the rest arrives through onChange
store.drop(source.info.id); // the layer is switched off

ソースを見るGitHub で編集@johnmorrisdotca/chikyu-earth 0.51.1 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。