aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/ParkMap.astro
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-25 21:29:16 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-10-25 21:29:16 +0900
commitfa73b6a9f36268986af68192f65978539f4d059c (patch)
tree6a4f27d54823d35da29f68ef37b93bba37f71cf2 /src/components/ParkMap.astro
parenta01062f43d36112c00d5c007ac9d488c14d8fb0d (diff)
parks: シェルター等の統合と編集画面の刷新
パーゴラ・東屋を「シェルター等」に統合し、編集画面に確認チェック・遊具別入力・時計・選択行ハイライトを追加した。周辺公園と周辺施設の自治体名を補完し、公園データの文字化けを修正した。
Diffstat (limited to 'src/components/ParkMap.astro')
-rw-r--r--src/components/ParkMap.astro18
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], {