0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【MapLibre】イコールアース図法のWeb地図を作る方法 ~アフリカ大陸とグリーンランドの面積を正しく比較できる図法~

0
Last updated at Posted at 2026-09-26

:map: はじめに

国連でイコールアース図法などの正積図法の利用を促す決議が採択されたというニュースを目にした方も多いのではないでしょうか。

Web地図では、Web Mercator(メルカトル図法)が広く使われています。

一方で、Web Mercatorは高緯度ほど面積が大きく表示されるため、グリーンランドなどが実際より大きく見えてしまいます。

今回は、面積を正しく表現できるEqual Earth(イコールアース)図法を使って、MapLibre GL JSで世界地図を表示してみます!

:link: 動作するデモサイトのリンク

Web地図らしく、インタラクティブな操作が体験できます。
https://mayuge.github.io/EQUAL_EARTH_PROJECTION/

image.png

イコールアース図法のWeb地図を作る方法

フォルダ構造を以下のようにします。

フォルダ構造

.
├── index.html
└── dist/ # distフォルダは参考文献から取得
    ├── maplibre-gl-shared.mjs
    ├── maplibre-gl-worker.mjs
    ├── maplibre-gl.css
    └── maplibre-gl.mjs

index.htmlのソースコード

<!doctype html>
<html lang="ja">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />

		<title>Equal Earth Map Demo</title>

		<link rel="stylesheet" href="./dist/maplibre-gl.css" />

		<style>
			html,
			body,
			#map {
				width: 100%;
				height: 100%;
				margin: 0;
			}
		</style>
	</head>

	<body>
		<div id="map"></div>

		<script type="module">
			import * as maplibregl from "./dist/maplibre-gl.mjs"

			const map = new maplibregl.Map({
				container: "map",

				style:
					"https://raw.githubusercontent.com/mayuge/OpenSourceStyle/refs/heads/main/style.json",

				center: [0, 0],
				zoom: 1,
			})

			map.on("style.load", () => {
				map.setProjection({
					type: "equal-earth",
					transition: false,
				})
			})

			map.addControl(new maplibregl.NavigationControl(), "top-right")
		</script>
	</body>
</html>

地図のスタイルが読み込まれたときに、イコールアース図法を指定します。

    map.on("style.load", () => {
            map.setProjection({
                type: "equal-earth",
                transition: false,
            })
        })

index.htmlをクリックしても動かないのは正常

→pythonを使ってサーバーを起動します!

index.htmlのあるディレクトリまで移動し、pythonコマンドを入力

python -m http.server

ブラウザで http://localhost:8000 を開くと、index.htmlを表示できます。

おまけ

背景の地図のデザインを変えたい場合はmaptunikというサイトでベクトルタイルの地図のスタイルを変更できます!

以上

ソースコード

参考文献

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?