01 - 基本的な地図表示

学習内容: Leaflet.jsを使って最も基本的な地図を表示します。

ポイント:

// 地図を初期化(東京駅を中心に表示)
const map = L.map('map').setView([35.6812, 139.7671], 13);

// OpenStreetMapのタイルレイヤーを追加
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);