map3d v0.6.0
map3d が描画したフォトリアルな 3D 都市。上に描画エディタが開かれている

パリ Google Photorealistic 3D Tiles 48.8584° N · 2.2945° E

React 19 · three.js ≥ 0.160 · ESM + CJS + types

React のための
リアルタイム
3D 地図

Real-time 3D cartography for React.

React がマウントしたあとは手を出さない命令型 Three.js エンジン。MapEngine がカメラ・タイル・レイヤーを保持するため、描画ループが再レンダーを待つことはありません。

npm i @pasquelin/map3d three react react-dom

バージョン
0.6.0
ピア依存
react 19 · three ≥ 0.160
ビルド
ESM + CJS + .d.ts
ライセンス
PolyForm Noncommercial

ライブデモ

ブラウザーで試す

インストールもキーも不要。以下のデモはプッシュのたびに本リポジトリからビルドされ、GitHub Pages から直接配信されます。

機能

最初から入っているもの

ツールバー、コントロール、検索、座標グリッド、クラスタリング —— どの面も <Map> の内部にマウントされ、設定で制御されます。用意するのはデータだけです。

実際の動作

道具が働いているところ

以下のスクリーンショットはすべて、上で開けるデモそのものです。モックアップはありません。

クイックスタート

十数行でクラスタ付きの地図を

import { Map, markersLayer, type MarkerData } from '@pasquelin/map3d'

type Alert = { title: string }

const alerts: MarkerData<Alert>[] = [
  { id: 1, type: 'critical', position: { lat: 48.8566, lng: 2.3522 }, title: 'Intrusion', data: { title: 'Intrusion' } },
  { id: 2, type: 'info', position: { lat: 48.8606, lng: 2.3376 }, title: 'Patrol', data: { title: 'Patrol' } },
]

export function App() {
  return (
    <div style={{ height: '100vh' }}>
      <Map
        center={{ lat: 48.8566, lng: 2.3522 }}
        zoom={13}
        layers={[markersLayer<Alert>({ points: alerts, cluster: { enabled: true } })]}
      />
    </div>
  )
}

任意のプラグイン —— IGN Géoplateforme、Windy、屋内フロアプラン —— は別リポジトリにあり、プラグイン API で自作もできます。