本文へ移動

Chizu地図

世界、253の国、33か国の州や県などの地域を、SVGの地図に描けます。表示する範囲を決めたり、番号付きの注記をつけたり、地理クイズを作ったりもできます。名前は今のところ英語と日本語で、スペイン語、ドイツ語、中国語にも対応する予定です。

「地図」は、土地や場所を図で表したものです。 名前について(英語)

目次

リファレンス · ジブラルタルの輪郭

default定数

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

Gibraltar, alone: Natural Earth 5.1.2 admin-0 countries, 1:10m, Lambert azimuthal equal-area centred on the country, longer side 1000. The native map geometry, region identifiers, names, projection and insets; coordinates belong to this canvas.

インポート

import value from "@johnmorrisdotca/chizu/countries/gi";

定義

const map: ChizuMap = {
    id: "country-gi",
    kind: "country",
    name: "Gibraltar",
    nameJa: "ジブラルタル",
    regionName: "Country",
    regionNamePlural: "Countries",
    viewBox: "0 0 517 1000",
    width: 517,
    height: 1000,
    wraps: false,
    projection: {
        kind: "azimuthal-equal-area",
        centre: [-5.3467, 36.129463],
        scale: 1871177.69,
        translate: [308.23, 380.703],
    },
    insets: [],
    source: "Natural Earth 5.1.2 admin-0 countries, 1:10m, Lambert azimuthal equal-area centred on the country, longer side 1000",
    regions: [
        {
            code: "GI",
            name: "Gibraltar",
            nameJa: "ジブラルタル",
            reading: "ジブラルタル",
            group: "Europe",
            groupJa: "ヨーロッパ",
            iso3: "GIB",
            path: "M0,0.35L517.29,0L487.2,368.78L509.77,564.11L431.44,1000L214.58,712.97Z",
            neighbors: ["ES"],
            bbox: [0, 0, 517.29, 1000],
            centroid: [308.23, 380.7],
        },
    ],
}

メンバー

名前型説明
idstring

world, country-fr (France alone, from Natural Earth's countries) or divisions-fr (its départements).

kind"world" | "country" | "divisions" | "local"

What its regions are: the whole world, a single country, the divisions of one, or the shapes of a local map of a city or a venue.

namestring

The map's name in English and Japanese.

nameJa (省略可)string | undefined
regionNamestring

What a region is called here, singular and plural, in English: Country, Province.

regionNamePluralstring
viewBoxstring

The canvas: 0 0 width height.

widthnumber
heightnumber
wrapsboolean

Whether its east edge is its west edge: a map of the earth is a cylinder cut open, and pans round without stopping.

projectionChizuProjection
insetsChizuInset[]

The regions drawn in boxes of their own.

sourcestring

Where the outlines come from, in a line.

regionsChizuRegion[]

例

import map from "@johnmorrisdotca/chizu/countries/gi";
console.log(map.id, map.kind, map.regions.length, map.viewBox);
// country-gi country 1 0 0 517 1000
country-gi country 1 0 0 517 1000

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/chizu 1.17.0 のソースから作成しました。

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