2. 地図の作成
-const map = new MapLibreMap({
- container: 'map',
- style: 'https://tiles.openfreemap.org/styles/bright',
- center: [132.4553, 34.3966],
- zoom: 12
-});
+const map = L.map('map').setView([34.3966, 132.4553], 12);
+L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
+ maxZoom: 19,
+ attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
+}).addTo(map);
座標の順序
MapLibre は [lng, lat] の順、Leaflet は [lat, lng] の順です。この 2 つを行き来するときに最もよくある間違いです。