From fa73b6a9f36268986af68192f65978539f4d059c Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Sun, 25 Oct 2026 21:29:16 +0900 Subject: parks: シェルター等の統合と編集画面の刷新 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit パーゴラ・東屋を「シェルター等」に統合し、編集画面に確認チェック・遊具別入力・時計・選択行ハイライトを追加した。周辺公園と周辺施設の自治体名を補完し、公園データの文字化けを修正した。 --- src/components/FacilitiesTable.astro | 2 +- src/components/ParkMap.astro | 18 ++++++++++++++++-- src/components/ParkMapHelp.astro | 8 +++++++- src/components/ParksFilters.astro | 1 + src/components/ParksTable.astro | 12 ++++-------- 5 files changed, 29 insertions(+), 12 deletions(-) (limited to 'src/components') diff --git a/src/components/FacilitiesTable.astro b/src/components/FacilitiesTable.astro index 797bb1a..72515d0 100644 --- a/src/components/FacilitiesTable.astro +++ b/src/components/FacilitiesTable.astro @@ -35,7 +35,7 @@ const types = [ const mapsUrl = (f: Facility) => { // 市外の施設は「小平市」を付けない。名前が市名を含む場合は二重にしない。 const query = f.nearby - ? f.city && !f.name.includes(f.city) + ? f.city && !f.name.startsWith(f.city) ? `${f.city}${f.name}` : f.name : `小平市${f.name}`; diff --git a/src/components/ParkMap.astro b/src/components/ParkMap.astro index e4f226b..b96992d 100644 --- a/src/components/ParkMap.astro +++ b/src/components/ParkMap.astro @@ -231,6 +231,12 @@ border: 1px solid #01579b; border-radius: 50%; } + :global(.park-fac-clock) { + background: #f9a825; + border: 1px solid #f57f17; + border-radius: 50%; + color: #1b1b1b; + } :global(.park-fac svg) { display: block; } @@ -506,7 +512,7 @@ if (name) nearbyInfoByName.set(name, p); }); const nearbyMapsQuery = (name: string, city = "") => - name ? (city && !name.includes(city) ? `${city}${name}` : name) : ""; + name ? (city && !name.startsWith(city) ? `${city}${name}` : name) : ""; const nearbyBaseStyle = (lyr: any) => lyr._isPoint ? NEARBY_POINT_STYLE : NEARBY_STYLE; const parkDataByName = new Map(); @@ -555,6 +561,7 @@ osmName && osmName !== ourName ? `OSM: ${osmName}` : ""; // 表と同じく、公園名で検索する。名前がない場合だけ住所・座標を使う。 const rec = parkDataByName.get(ourName); + const fixed = rec?.["地図URL"]; const name = (ourName || "").trim(); const query = mapsQuery || (name ? `小平市${name}` @@ -563,7 +570,8 @@ : rec?.["緯度"] && rec?.["経度"] ? `${rec["緯度"]},${rec["経度"]}` : "小平市"); - selectedMapsLink.href = `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(query)}`; + selectedMapsLink.href = + fixed || `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(query)}`; selectedTableLink.dataset.parkRow = encodeURIComponent(ourName); selectedTableLink.hidden = !listed; if (selectedNoteEl) selectedNoteEl.hidden = listed; @@ -762,6 +770,12 @@ '', ); } + const clock = (p["時計"] || "").trim(); + if (clock === "○" || clock === "あり" || clock === "有") { + icons.push( + '⏰', + ); + } if (!icons.length) return; const center = lyr.getBounds().getCenter(); L.marker([center.lat, center.lng], { diff --git a/src/components/ParkMapHelp.astro b/src/components/ParkMapHelp.astro index 26d9917..61156c1 100644 --- a/src/components/ParkMapHelp.astro +++ b/src/components/ParkMapHelp.astro @@ -14,10 +14,11 @@ 小平市の境界 WCトイレ 水飲み場(拡大時) + ⏰時計(拡大時)

- 公園の範囲を赤、市外の近い公園を青、公共施設を紫(市外はオレンジ)で表示しています。地図を拡大すると見やすくなります。PCでは地図上でスクロールするとズームできます。市外の近い公園のうち、範囲が取得できないものは丸で表示しています。トイレと水飲み場のアイコンは拡大すると表示されます。さらに拡大すると、遊具アイコン(上の凡例)が表示されます。OpenStreetMapに公園として登録されている範囲を表示しているため、すべての公園を網羅しているわけではありません。現在地は端末内でのみ利用し、サーバーには送信しません。地図データ © OpenStreetMap ピクニック・広場 +