aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components
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
parenta01062f43d36112c00d5c007ac9d488c14d8fb0d (diff)
parks: シェルター等の統合と編集画面の刷新
パーゴラ・東屋を「シェルター等」に統合し、編集画面に確認チェック・遊具別入力・時計・選択行ハイライトを追加した。周辺公園と周辺施設の自治体名を補完し、公園データの文字化けを修正した。
Diffstat (limited to 'src/components')
-rw-r--r--src/components/FacilitiesTable.astro2
-rw-r--r--src/components/ParkMap.astro18
-rw-r--r--src/components/ParkMapHelp.astro8
-rw-r--r--src/components/ParksFilters.astro1
-rw-r--r--src/components/ParksTable.astro12
5 files changed, 29 insertions, 12 deletions
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<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], {
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 @@
<span><i class="swatch swatch-boundary"></i>小平市の境界</span>
<span><i class="swatch-fac swatch-fac-toilet">WC</i>トイレ</span>
<span><i class="swatch-fac swatch-fac-water"><svg viewBox="0 0 24 24" width="10" height="10" 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></i>水飲み場(拡大時)</span>
+ <span><i class="swatch-fac swatch-fac-clock">⏰</i>時計(拡大時)</span>
</div>
<div class="park-play-legend" data-play-legend></div>
<p class="park-map-note">
- 公園の範囲を赤、市外の近い公園を青、公共施設を紫(市外はオレンジ)で表示しています。地図を拡大すると見やすくなります。PCでは地図上でスクロールするとズームできます。市外の近い公園のうち、範囲が取得できないものは丸で表示しています。トイレと水飲み場のアイコンは拡大すると表示されます。さらに拡大すると、遊具アイコン(上の凡例)が表示されます。OpenStreetMapに公園として登録されている範囲を表示しているため、すべての公園を網羅しているわけではありません。現在地は端末内でのみ利用し、サーバーには送信しません。地図データ © <a
+ 公園の範囲を赤、市外の近い公園を青、公共施設を紫(市外はオレンジ)で表示しています。地図を拡大すると見やすくなります。PCでは地図上でスクロールするとズームできます。市外の近い公園のうち、範囲が取得できないものは丸で表示しています。トイレ・水飲み場・時計のアイコンは拡大すると表示されます。さらに拡大すると、遊具アイコン(上の凡例)が表示されます。OpenStreetMapに公園として登録されている範囲を表示しているため、すべての公園を網羅しているわけではありません。現在地は端末内でのみ利用し、サーバーには送信しません。地図データ © <a
href="https://www.openstreetmap.org/copyright"
target="_blank"
rel="noopener">OpenStreetMap</a
@@ -90,6 +91,11 @@
background: #0277bd;
border-radius: 50%;
}
+ .swatch-fac-clock {
+ background: #f9a825;
+ border-radius: 50%;
+ color: #1b1b1b;
+ }
.park-map-note {
margin-top: 0.4rem;
color: var(--sl-color-gray-2);
diff --git a/src/components/ParksFilters.astro b/src/components/ParksFilters.astro
index bf65d6e..3b51f4a 100644
--- a/src/components/ParksFilters.astro
+++ b/src/components/ParksFilters.astro
@@ -48,6 +48,7 @@ const facilityTypes = [
<input type="checkbox" data-fac-filter value="picnic" />
<span class="filter-icon" set:html={PARK_ICONS.picnic.svg} />ピクニック・広場
</label>
+ <label><input type="checkbox" data-fac-filter value="clock" />⏰時計</label>
<label><input type="checkbox" data-fac-filter value="toy" />遊具あり</label>
<label>
<input type="checkbox" data-fac-filter value="sand" />
diff --git a/src/components/ParksTable.astro b/src/components/ParksTable.astro
index 65b8412..f0864d6 100644
--- a/src/components/ParksTable.astro
+++ b/src/components/ParksTable.astro
@@ -92,12 +92,6 @@ function facilityBadges(p: Park): Badge[] {
if (p["遊具"]) {
badges.push({ kind: "toy", label: "遊具", title: `遊具: ${p["遊具"]}` });
}
- if (p["パーゴラ"]) {
- badges.push({ kind: "pergola", label: "パーゴラ", title: `パーゴラ: ${p["パーゴラ"]}` });
- }
- if (p["東屋"]) {
- badges.push({ kind: "azumaya", label: "東屋", title: `東屋: ${p["東屋"]}` });
- }
const ball = p["ボール遊び"];
if (ball && ball !== "禁止") {
const label = ball.includes("一部") ? "ボール遊び一部可" : "ボール遊び可";
@@ -126,10 +120,10 @@ function facTokens(p: Park): string {
if (play.includes("滑り台") || play.includes("滑台")) tokens.push("slide");
if (play.includes("複合遊具")) tokens.push("complex");
if (play.includes("ロープウェイ")) tokens.push("rope");
- if (p["パーゴラ"]) tokens.push("pergola");
- if (p["東屋"]) tokens.push("azumaya");
const ball = p["ボール遊び"];
if (ball && ball !== "禁止") tokens.push("ball");
+ const clock = (p["時計"] || "").trim();
+ if (clock === "○" || clock === "あり" || clock === "有") tokens.push("clock");
if (p["南西部指定管理"]) tokens.push("cm");
// ピクニック広場・芝生広場・テーブルのある公園。
const picnicText = `${p["公園名"] || ""} ${p["種別"] || ""} ${p["その他設備"] || ""} ${p["備考"] || ""}`;
@@ -150,8 +144,10 @@ function facTokens(p: Park): string {
const DETAIL_FIELDS: { key: string; icon: string }[] = [
{ key: "ベンチ・椅子", icon: "🪑" },
{ key: "テーブル", icon: "🍽" },
+ { key: "シェルター等", icon: "⛱" },
{ key: "防災用具", icon: "🧯" },
{ key: "遊具", icon: "🎠" },
+ { key: "時計", icon: "⏰" },
{ key: "駐車場", icon: "🅿" },
{ key: "その他設備", icon: "🔧" },
{ key: "備考", icon: "" },