diff options
Diffstat (limited to 'scripts/park-editor.html')
| -rw-r--r-- | scripts/park-editor.html | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/park-editor.html b/scripts/park-editor.html index 9ce109a..8c519e9 100644 --- a/scripts/park-editor.html +++ b/scripts/park-editor.html @@ -38,7 +38,7 @@ </header> <div class="wrap"><table id="tbl"><thead></thead><tbody></tbody></table></div> <script> -const FIELDS = ["公園名","住所","町名","面積㎡","500㎡以上","種別","南西部指定管理","トイレ","水飲み場","ベンチ・椅子","テーブル","パーゴラ","東屋","防災用具","ボール遊び","遊具","備考"]; +const FIELDS = ["公園名","住所","町名","面積㎡","500㎡以上","種別","南西部指定管理","設置者","トイレ","水飲み場","ベンチ・椅子","テーブル","パーゴラ","東屋","防災用具","ボール遊び","遊具","緯度","経度","備考"]; let parks = []; const tbl = document.getElementById("tbl"); const thead = tbl.querySelector("thead"); @@ -47,8 +47,11 @@ const q = document.getElementById("q"); const count = document.getElementById("count"); const status = document.getElementById("status"); -function mapsUrl(name) { - return "https://www.google.com/maps/search/?api=1&query=" + encodeURIComponent("小平市" + (name || "")); +function mapsUrl(p) { + if (p["緯度"] && p["経度"]) { + return "https://www.google.com/maps/search/?api=1&query=" + p["緯度"] + "," + p["経度"]; + } + return "https://www.google.com/maps/search/?api=1&query=" + encodeURIComponent("小平市" + (p["公園名"] || "")); } async function load() { @@ -71,7 +74,7 @@ function render() { const mapA = document.createElement("a"); mapA.textContent = "🗺"; mapA.title = "Googleマップで開く"; - mapA.href = mapsUrl(p["公園名"] || ""); + mapA.href = mapsUrl(p); mapA.target = "_blank"; mapA.rel = "noopener"; mapA.addEventListener("click", function (ev) { |
