diff --git a/test.html b/test.html index 9baa161..cdc8c40 100644 --- a/test.html +++ b/test.html @@ -41,8 +41,14 @@ layer.on('click', function() { let clickedLatLng = layer.getLatLng(); - let nearbyLocations = []; + // クリックした店名をリストに追加 + let listItem = document.createElement('li'); + listItem.textContent = feature.properties.name; + document.getElementById('list').appendChild(listItem); + + // 500メートル以内の他の地点をポップアップで表示 + let nearbyLocations = []; geojsonLayer.eachLayer(function(otherLayer) { let otherLatLng = otherLayer.getLatLng(); let distance = clickedLatLng.distanceTo(otherLatLng); @@ -65,6 +71,7 @@ }) .catch(error => console.error('GeoJSONデータの読み込みエラー:', error)); +