Skip to the content

Chikyu Earth地球

A line-drawn globe of the world's countries that turns at the Earth's own rate, with an optional realistic Earth from space and markers for any place.

Chikyu is the Japanese word 地球 for the Earth. About the name

Contents

Reference · The <chikyu-earth-realistic> element

setSharedRendererfunction

Hands the elements a renderer the page made, so a page that draws other things with kazoku-ui's shared renderer keeps one WebGL context for all of them. Call it before the first element connects, or while none is in the page. The page owns the renderer: the elements never dispose it, and its own maxRatio and onContext apply. Pass undefined to go back to the package's own.

Import it

import { setSharedRenderer } from "@johnmorrisdotca/chikyu-earth/realistic/element";

Definition

function setSharedRenderer(renderer: SharedRenderer<Three> | undefined): void

Parameters

NameTypeDescription
rendererSharedRenderer<ThreeParts> | undefined

A renderer made with createSharedRenderer from @johnmorrisdotca/kazoku-ui/renderer, whose load gives the same three.js, or undefined.

Examples

import { createSharedRenderer } from "@johnmorrisdotca/kazoku-ui/renderer";
import { setSharedRenderer } from "@johnmorrisdotca/chikyu-earth/realistic/element";

setSharedRenderer(createSharedRenderer({ load: () => import("three"), maxRatio: 1.5 }));

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/chikyu-earth 0.11.0.