diff options
Diffstat (limited to 'src/components/ParkMap.astro')
| -rw-r--r-- | src/components/ParkMap.astro | 18 |
1 files changed, 16 insertions, 2 deletions
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<string, any>(); @@ -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 @@ '<span class="park-fac park-fac-water" title="水飲み場あり" aria-label="水飲み場あり"><svg viewBox="0 0 24 24" width="12" height="12" aria-hidden="true"><path fill="currentColor" d="M12 2.7c-3.4 4.2-6 8.1-6 11.3a6 6 0 0 0 12 0c0-3.2-2.6-7.1-6-11.3z"/></svg></span>', ); } + const clock = (p["時計"] || "").trim(); + if (clock === "○" || clock === "あり" || clock === "有") { + icons.push( + '<span class="park-fac park-fac-clock" title="時計あり" aria-label="時計あり">⏰</span>', + ); + } if (!icons.length) return; const center = lyr.getBounds().getCenter(); L.marker([center.lat, center.lng], { |
