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 place under a point: country, sea, continent and the nearest city

PlaceCitiestype

The city lists for placeOf. The three tiers here-city loads (capitals, a million, 100,000) match this. towns is read only when the caller passes it, and only for the one or two countries those tiers name, the same rule as here-city.

Import it

import type { PlaceCities } from "@johnmorrisdotca/chikyu-earth/place";

Definition

interface PlaceCities {
    nearest(point: {
        lat: number;
        lon: number;
    }, options?: {
        maxKm?: number;
    }): {
        city: {
            id: string;
            name: {
                en: string;
                ja?: string;
                jaShort?: string;
            };
            country?: string;
            lat?: number;
            lon?: number;
        };
        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; lat?: number; lon?: number; }; km: number; } | null
within (optional)((point: { lat: number; lon: number; }, maxKm: number) => readonly { city: { country?: string; }; km: number; }[]) | undefined

Examples

import type { PlaceCities } from "@johnmorrisdotca/chikyu-earth/place";

const cities: PlaceCities = { nearest: () => null };
console.log(cities.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.