diff --git a/map.js b/map.js index 7ab3571..833cad2 100644 --- a/map.js +++ b/map.js @@ -1,18 +1,11 @@ document.addEventListener('DOMContentLoaded', () => { const map = L.map('map').setView([38.9175, 139.8353], 16); + const markers = []; L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: '© OpenStreetMap contributors' }).addTo(map); - -// カスタムアイコンを定義 - const customIcon = L.icon({ - iconUrl: 'images/marker-icon.png', // カスタムマーカー画像のパス - iconSize: [32, 32], // マーカーのサイズ - iconAnchor: [16, 32], // アイコンの「足」の位置 - popupAnchor: [0, -32] // ポップアップの表示位置 - }); - + fetch('snack.csv') .then(response => response.text()) .then(text => { @@ -63,9 +56,7 @@ .catch(error => { console.error('CSV読み込みエラー:', error); }); - -let markers = []; - + // マーカーを追加し、ポップアップを設定 snacks.forEach(snack => { const markerIcon = L.icon({