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 · Markers on the globe

HereCitySourcetype

What here-city needs of a city list: nearest, as kuni's CitySet has it. Any list with that method will do.

Import it

import type { HereCitySource } from "@johnmorrisdotca/chikyu-earth/markers";

Definition

interface HereCitySource {
    nearest(point: {
        lat: number;
        lon: number;
    }, options?: {
        maxKm?: number;
    }): {
        city: {
            id: string;
            name: {
                en: string;
                ja?: string;
                jaShort?: string;
            };
            country?: string;
        };
        km: number;
    } | null;
    within?(point: {
        lat: number;
        lon: number;
    }, maxKm: number): readonly {
        city: {
            country?: string;
        };
        km: number;
    }[];
}

Members

NameTypeDescription
nearest(point: { lat: number; lon: number; }, options?: { maxKm?: number; }): { city: { id: string; name: { en: string; ja?: string; jaShort?: string; }; country?: string; }; km: number; } | null
within (optional)((point: { lat: number; lon: number; }, maxKm: number) => readonly { city: { country?: string; }; km: number; }[]) | undefined

Cities of the three tiers within maxKm, nearest first. Used to notice a second country across a border.

Examples

import type { HereCitySource } from "@johnmorrisdotca/chikyu-earth/markers";

const source: HereCitySource = { nearest: () => null };
console.log(source.nearest({ lat: 0, lon: 0 }));
null

What it prints (run when this page was built)

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