แผนที่จาก GPKG + บทความ 6 ชิ้น + ลดความหนา footer
== แผนที่ / GIS ==
- qgis-to-web.py: อ่าน GPKG ได้ (--from gpkg) + เพิ่ม dream-Watcharapol
- เพิ่ม dream-*.geojson 6 ไฟล์ (เส้นทางที่เสนอ: บ้านภาชี · ชานเมืองอยุธยา · HSR · เมืองทองธานี · ปากเกร็ด · วัชรพล)
- map.js: ATMap.proposal() วาดเส้นจริงจาก geojson (ไม่ใช่เส้นตรง) · smoothFactor 0.5
· coordOf() รับ coords=[lat,lng] · fitAll รับได้ทั้งจุดเดี่ยวและเส้น · setStyle บน featureGroup
== บทความ (blog) ==
- text3: ถ้าผมได้ออกแบบสายเดินรถเอง (จาก mydream.html) TH+EN
- text4: วิธีเดินทางไปสถานีรถไฟ และสนามบิน (จาก train-airplane.html) TH+EN
- text5/text6: โครงเปล่ารอเติมเนื้อหา (แสวงหา-โพธิ์ทอง · อำเภอเข้าเมือง)
- แผนที่ความฝัน: map.groups 3 กลุ่ม · คลิกเส้น/หมุด/แถวได้ · ป้ายที่มา
- ย่อหน้า: ระยะห่าง 20px + ย่อหน้าหน้าบรรทัด 1.5em
== ตารางเดินรถ ==
- เปลี่ยนชื่อคีย์ dir_* -> direction_* ทุกไฟล์ (backward-compat ในโค้ด)
- 1011: จุดย่อย 2 ทิศ + offsets [0,25,55]
- 954/2194: จุดย่อย station 8 + offsets
- refreshHighlights: วนข้ามวันเมื่อเลยเที่ยวสุดท้าย + ไฮเทลต์ชิปทุกจุด
- 8 other_stop.md: อัปเดตตรงข้อมูลจริง 8 รายการ
== i18n ==
- แยกไฟล์ต่อภาษา ui/locales/{th,en}.json + i18n.js = loader (ลด 28KB -> 6.5KB)
- resource/tools/check-i18n.py ตรวจคีย์ขาด/ซ้ำ
- ข้อความผู้สนับสนุนหน้าแรก + คำแปล EN
== UI ==
- ฝังฟอนต์ K2D (ui/vendor/fonts/) ออฟไลน์ 100%
- cache busting ?v=<SW VERSION> ทุกรูป (ui/imageurl.js)
- footer: ลดความหนา 468 -> 349px + line-height 1.5 กันสระ/วรรณยุกต์ซ้อน
- QR modal + ปุ่มคัดลอกลิงก์ · หน้าอัปเดตล่าสุดใน #/check
- credits: ขอขอบคุณภาพรถ 3 สาย
== เครื่องมือ ==
- bump-version.py · stamp-schedules.py · derive-times.py (จุดอ้างอิง ± นาที)
This commit is contained in:
1 parent
1cfaeb1526
commit
656f65b41c
109 files changed
+3335
-1225
No files matched your search
@@ -216,7 +216,7 @@ URL ที่ใช้ได้: `#/stops/<station_code>` และ `#/stops/<st
|
||||
**ลำดับการตัดสิน (แม่น → หลวม):**
|
||||
1. `"days": ["sat","sun"]` ระบุตรง ๆ → ใช้ตามนั้น
|
||||
2. `"service": "weekday" | "holiday" | "all"` → เทียบกับวันนี้
|
||||
3. ไม่ระบุ → **ตรวจคำอัตโนมัติ** จาก `dir_label` + `dir_note`/`note` ของทุกจุดในทิศนั้น
|
||||
3. ไม่ระบุ → **ตรวจคำอัตโนมัติ** จาก `direction_label` + `direction_note`/`note` ของทุกจุดในทิศนั้น
|
||||
(เจอ "วันหยุด/นักขัตฤกษ์/ส-อา/weekend" = วันหยุด · "วันทำงาน/จ-ศ/ธรรมดา/workday" = วันทำงาน **ไม่เดาถ้าเจอทั้งคู่**)
|
||||
4. ตัดสินไม่ได้ → **แสดงทุกวัน** (ไม่ซ่อนข้อมูล) + ป้าย "ยังไม่ระบุวันของตาราง"
|
||||
|
||||
@@ -246,13 +246,13 @@ URL ที่ใช้ได้: `#/stops/<station_code>` และ `#/stops/<st
|
||||
|
||||
**หมายเหตุ:** ถ้ามีทั้ง `.jpg` และ `.jpeg` ในชื่อเดียวกัน → **`.jpg` ชนะ** (รักษาพฤติกรรมเดิม)
|
||||
|
||||
## หัวแถวทิศในหน้า `#/check` — ใช้ `dir_label` ก่อน
|
||||
## หัวแถวทิศในหน้า `#/check` — ใช้ `direction_label` ก่อน
|
||||
|
||||
การ์ดในหน้า check จัดกลุ่ม **ตามจุดจอด** (จุดเดียวกันที่มีหลายทิศ = การ์ดเดียว หลายแถว)
|
||||
หัวแถวจึงต้องใช้ **`dir_label`** (ชื่อทิศ เช่น `ป่าโมกไปอ่างทอง` / `ป่าโมกไปอยุธยา`) ไม่ใช่คำกลางว่า "ทิศทาง"
|
||||
หัวแถวจึงต้องใช้ **`direction_label`** (ชื่อทิศ เช่น `ป่าโมกไปอ่างทอง` / `ป่าโมกไปอยุธยา`) ไม่ใช่คำกลางว่า "ทิศทาง"
|
||||
|
||||
ลำดับที่ใช้แสดง: `dir_label` → `dir_note` (พร้อมป้าย "ทิศทาง") → "ที่จุด X"
|
||||
`records()` ส่งออกทั้ง `dir_label` และ `direction_note` — หน้าที่อื่นเรียกใช้ได้
|
||||
ลำดับที่ใช้แสดง: `direction_label` → `direction_note` (พร้อมป้าย "ทิศทาง") → "ที่จุด X"
|
||||
`records()` ส่งออกทั้ง `direction_label` และ `direction_note` — หน้าที่อื่นเรียกใช้ได้
|
||||
|
||||
## ชิปสาย (`buses-line`) ในหน้า `#/stops` → `#/routes/<รหัส>`
|
||||
|
||||
@@ -261,10 +261,36 @@ URL ที่ใช้ได้: `#/stops/<station_code>` และ `#/stops/<st
|
||||
- ข้อความปุ่ม: `stops.viewRoute` = "ดูรายละเอียดสาย {n}" / "View route {n}"
|
||||
- (หน้า `#/stops/<slug>` ปุ่ม "ดูตารางเวลาสาย N" ยังใช้ `#/check/<รหัส>` ตามเดิม — คนละบริบท)
|
||||
|
||||
## สีของเลขสายตามหมวดเส้นทาง (`#/routes/<id>`)
|
||||
|
||||
เลขสายในหัวเรื่อง (`.mu-route-chip #route-chip`) เปลี่ยน**สีพื้นหลังตามหมวดเส้นทาง**
|
||||
โดยอ่านจาก `routes.json → route_group` (นิยามหมวดอยู่ที่ `route_groups.json`)
|
||||
|
||||
| `route_group` | สี | คลาส | สายที่ใช้ตอนนี้ |
|
||||
|---|---|---|---|
|
||||
| `bangkok` | น้ำเงิน `#1f5fbf` | `.grp-bangkok` | 902, 15, 951, 952, 954, 8, 999 |
|
||||
| `interprovincial` | ม่วง `#7a4cc0` | `.grp-interprovincial` | 101, 464, 641, 2194 |
|
||||
| `in_province` | ชมพู `#d6388f` | `.grp-in_province` | 324, 1011, 2231 |
|
||||
| `municipal` | เทา `#6b7268` | `.grp-municipal` | *(สำรอง — ยังไม่มีสายใช้)* |
|
||||
| ไม่ระบุ | ม่วงแบรนด์ (ค่าเริ่มต้น) | — | — |
|
||||
|
||||
**วิธีทำงาน:** `busDetail.init.js` → `chipEl.className = 'mu-route-chip' + (route.route_group ? ' grp-' + route.route_group : '')`
|
||||
→ กฎ CSS `.mu-route-chip.grp-<key>` อยู่ใน `busDetail.html`
|
||||
|
||||
**เพิ่มหมวดใหม่ (3 ขั้น):**
|
||||
1. เพิ่มหมวดใน `resource/data/route_groups.json` (+ ใส่ `route_group` ให้สายใน `routes.json`)
|
||||
2. เพิ่มโทเคนสีใน `DESIGN.md §3` และกฎใน `DESIGN.md §5` (หัวข้อ "เลขสายหน้า `#/routes/:id`")
|
||||
3. เพิ่มกฎ `.mu-route-chip.grp-<key>` ใน `ui/partials/busDetail.html`
|
||||
|
||||
⚠️ ไม่แตะ CSS ของ chip หน้า `#/stops` (คนละบริบท ยังใช้ม่วงแบรนด์)
|
||||
|
||||
## ลิงก์ติดต่อผู้ประกอบการ (หน้ารายละเอียดสาย `#/routes/<id>`)
|
||||
|
||||
ใช้ฟิลด์ **`web_url`** ใน `routes.json` (มีอยู่เดิม) — ไม่ต้องแก้โค้ดเวลาเพิ่ม/เปลี่ยนลิงก์
|
||||
|
||||
- **`web_url` เก็บเป็นอาร์เรย์ `[ชนิดลิงก์, URL]`** เช่น `["facebook", "https://www.facebook.com/..."]`
|
||||
→ อ่านด้วย `parseWebUrl()` ใน `busDetail.init.js` (รับสตริงเดี่ยวได้ด้วย เผื่อไฟล์เก่า)
|
||||
→ **ใช้ `kind` ที่ระบุในไฟล์ก่อน** ถ้าไม่มีจึงเดาจาก URL · ⚠️ ห้ามใช้ `String(web_url)` ตรง ๆ (จะได้ `"line,https://..."` แล้วลิงก์เสีย)
|
||||
- **ไอคอน + ชื่อ + สี เปลี่ยนตามชนิด URL อัตโนมัติ** (`linkKind()` ใน `busDetail.init.js`):
|
||||
| ตรวจพบ | ไอคอน | โทนสี | ชื่อที่แสดง |
|
||||
|---|---|---|---|
|
||||
@@ -304,3 +330,106 @@ route_id,station_id,from_station_id,offset_min,note
|
||||
```
|
||||
- `--check` ดูก่อน · รันเปล่า = เขียนจริง · `--audit` = ตรวจว่าไฟล์ตรงตาราง + **ชี้จุดที่เวลาซ้ำแต่ยังไม่มีกฎ** ✓
|
||||
- รันซ้ำได้ (idempotent) · จุดอ้างอิงต้องมีเวลาจริง · เขียนไฟล์คง CRLF เดิม
|
||||
|
||||
## บทความ (`#/blog`) — แผนที่ในบทความ 2 โหมด (`textN.json` → `map`)
|
||||
|
||||
**โหมด 1 · เส้นทางจริง** `"map": {"route_id":"101"}` → ใช้ `ATMap.route()` + geojson
|
||||
- ขึ้นเฉพาะหน้าอ่าน · ไม่มีไฟล์ geojson → คงรูป + ป้าย `blog.noGeo`
|
||||
|
||||
**โหมด 2 · เส้นทางที่เสนอ ("ความฝัน")** `"map": {"origin":{…}, "routes":[…]}`
|
||||
- เข้าโหมดนี้ทันทีเมื่อมี `routes` (อาร์เรย์) · ใช้ `ATMap.proposal(el, spec, onPick)` ใน `ui/map.js`
|
||||
- วาดเส้นต้นทาง → ปลายทาง (เส้นประ สีตาม `line_color`) + หมุดสีเดียวกัน · **คลิกได้ทั้งเส้น หมุด และแถวรายการ**
|
||||
- แผงรายละเอียดอยู่ใน blog (`buildProposal()` ใน `blog.init.js`) — map.js แค่เรียก `onPick(route)` กลับมา
|
||||
- **`dest.lat/lng` ต้องเป็นตัวเลข** → ถ้า `null` ไม่วาด แต่ขึ้นในรายการพร้อมป้าย `blog.mapNoCoord`
|
||||
- `distance_km`/`duration_min`/`fare_thb` = `null` → **ซ่อนในแผง** (ห้ามโชว์ 0 หรือเดาค่า)
|
||||
- พิกัดต้นทาง: `station_code` → ค้นจาก `stations.json` หรือใส่ `lat`/`lng` ตรง ๆ
|
||||
- ค่าทุกอย่างเป็น WGS84 · รายการ `routes[]` ใช้ `__layer` ที่ `proposal()` แนบไว้เพื่อไฮไลต์เส้นที่เลือก
|
||||
|
||||
**ร่วมทั้ง 2 โหมด**
|
||||
- แผนที่ขึ้นเฉพาะหน้าอ่าน — การ์ดในรายการยังใช้รูป `picN.*` (ไม่โหลด Leaflet หลายใบ)
|
||||
- รูปใน blog เติม `?v=` ผ่าน `ImgURL.of()` · เรียก `invalidateSize()` หลังวาด (กันแผนที่ 0×0)
|
||||
- เอกสาร schema เต็ม: `ui/partials/blog-data/README.md`
|
||||
|
||||
## ระบบภาษา (i18n) — ไฟล์ต่อภาษา + fallback chain
|
||||
|
||||
**สถาปัตยกรรม (แนวทาง A2):** คำแปล **ไม่ได้อยู่ใน `i18n.js` แล้ว** — แยกเป็นไฟล์ต่อภาษา
|
||||
|
||||
| ส่วน | ที่อยู่ | หน้าที่ |
|
||||
|---|---|---|
|
||||
| ไฟล์คำแปล | `ui/locales/th.json` · `en.json` | แบน `"key": "ข้อความ"` (256 คีย์/ภาษา) |
|
||||
| ตัวโหลด | `ui/i18n.js` | `SUPPORTED` · `BASE='th'` · cache ต่อภาษา · `t()` · `apply()` · `setLang()` · **`ready`** |
|
||||
| จุดรอโหลด | `ui/router.js` ท้ายไฟล์ | `I18N.ready.then(render)` — รอคำแปลก่อนวาดหน้าแรก |
|
||||
| precache | `ui/sw.js` | `./locales/th.json` + `./locales/en.json` (ออฟไลน์ใช้ได้) |
|
||||
| เครื่องมือตรวจ | `resource/tools/check-i18n.py` | ดูหัวข้อท้าย |
|
||||
|
||||
**กติกาเหล็ก**
|
||||
- เพิ่มคีย์ = ใส่ **ทุกไฟล์ภาษา** ในคำสั่งเดียว · คีย์ที่ขาดจะถอยไปใช้ `BASE` (คำไทยโผล่ในหน้า EN)
|
||||
- **ห้ามคีย์ซ้ำในไฟล์เดียวกัน** — JSON เก็บตัวหลังเงียบ ๆ (เคยเกิดจริง: ค่าอังกฤษทับค่าไทย ทำให้โหมดไทยแสดงอังกฤษ)
|
||||
- ข้อความใน HTML คือ **fallback** → ถ้าโหลดไฟล์ภาษาไม่ได้ `apply()` จะ **ไม่แตะ DOM** (ผู้ใช้เห็นข้อความเดิม ไม่เห็น key)
|
||||
- `t()` คืน **key เดิม** เมื่อไม่พบทั้งภาษาปัจจุบันและ BASE (ใช้ตรวจว่าลืมแปล)
|
||||
- ข้อความ JS ใช้ `I18N.t(...)` เท่านั้น · ข้อความล้วนใส่ `textContent` · ถ้าต้องมี HTML → `data-i18n-attr="html:key"`
|
||||
- ชื่อเฉพาะ (สถานี/จังหวัด/สายรถ) **ไม่แปล**
|
||||
- เพิ่มภาษาใหม่ 4 ขั้น: ไฟล์ `locales/<รหัส>.json` → `SUPPORTED` → PRECACHE ใน `sw.js` → รัน `check-i18n.py`
|
||||
|
||||
**ตรวจก่อน commit**
|
||||
```
|
||||
python resource/tools/check-i18n.py
|
||||
```
|
||||
ERROR = คีย์ขาด · คีย์ซ้ำ · ไฟล์ภาษาไม่ตรง `SUPPORTED` → exit 1 ห้าม commit
|
||||
WARN = ค่าว่างเปล่า (อาจตั้งใจ) · คีย์ที่ไม่พบที่ใช้ (อาจใช้ไดนามิก)
|
||||
|
||||
## หัวโซน (`.mu-zone-head`) — ป้ายหัวข้อ + บรรทัดข้อมูลที่ตัดคำถูกต้อง
|
||||
|
||||
**ปัญหาเดิม:** `.mu-zone-head` เป็น `display:flex` **ไม่มี `flex-wrap`** แต่ลูก ๆ เป็น `flex-basis:100%`
|
||||
→ ทุกบรรทัดถูกย่อรวมในแถวเดียว ข้อความไทยถูกตัดกลางคำ (แย่มากบนมือถือ)
|
||||
|
||||
**แก้แล้ว:**
|
||||
| ส่วน | ที่อยู่ | ทำอะไร |
|
||||
|---|---|---|
|
||||
| โครง flex/grid | `ui/index.html` (§.mu-zone-head) | `flex-wrap: wrap` + `.mu-zone-head .mu-zone-desc { flex-basis:100%; min-width:0; line-height:1.65 }` |
|
||||
| กฎจริง (ต้องชนะ partial) | `ui/responsive.css` (`#view …`) | `.mu-zone-meta` / `.mu-zone-seg` / ตัวคั่น `::after` · ≥768px เปลี่ยนเป็น grid 2 คอลัมน์ + `max-width:82ch` |
|
||||
| สร้างชิ้น | `ui/partials/checkSchedule.init.js` → `setSegments(host, segs)` | รับ `"ข้อความ"` หรือ `{ html, icon }` · ข้อความล้วนใช้ `textContent` (กัน HTML หลุด) |
|
||||
| HTML | `ui/partials/checkSchedule.html` | `#check-zone-desc` = `mu-zone-desc mu-zone-meta` · `#check-now-line` เพิ่ม `mu-zone-now` |
|
||||
|
||||
**กติกาสำคัญ**
|
||||
- **ห้าม** สร้างบรรทัดข้อมูลด้วยสตริงเดียวที่ต่อ `' · '` เอง → ให้ส่ง array เข้า `setSegments()` เสมอ
|
||||
- ตัวคั่น `·` **ห้าม** ใส่ในข้อความ — CSS `(.mu-zone-seg:not(:last-child)::after)` วาดให้ (ชิ้นสุดท้ายไม่มีจุด)
|
||||
- ต้องการสไตล์ใหม่ → ใส่ที่ `responsive.css` **พร้อม prefix `#view`** (เพราะ `<style>` ของ partial ถูก inject ทีหลัง)
|
||||
- เพิ่มหน้าใหม่ที่ใช้ `.mu-zone-head` ได้เลย — โครง flex/grid + ระยะห่างจัดการให้อัตโนมัติทั้งมือถือและจอคอม
|
||||
|
||||
**ตรวจ layout หลายความกว้าง:** ใช้ iframe จำลองความกว้าง (320/375/414/768/1024/1280) แล้ววัด
|
||||
`getBoundingClientRect()` ของทุกชิ้น — เกณฑ์ผ่าน: `scrollWidth - clientWidth === 0` (ไม่มีล้นแนวนอน)
|
||||
และไม่มีชิ้นไหนล้นขอบขวาของโซน
|
||||
|
||||
## ฟอนต์ (Typography)
|
||||
|
||||
| บทบาท | ฟอนต์ | ที่ใช้ |
|
||||
|---|---|---|
|
||||
| เนื้อหา + หัวเรื่อง | **K2D** (มีหัวแบบไทย) 300–800 | ทุกหน้า SPA + หน้าสถานี static |
|
||||
| ตัวสำรอง | Prompt · Noto Sans Thai · Sarabun | ใน fallback chain ของ `font-family` |
|
||||
| เวลา/เลขสาย/ตัวเลข | **IBM Plex Mono** + `tabular-nums` | `.mu-time-chip` · เลขสาย · รหัสป้าย |
|
||||
|
||||
- **K2D ฝังในโปรเจกต์**: `ui/vendor/fonts/` (`k2d.css` + `.woff2` 18 ไฟล์ · 6 น้ำหนัก × thai/latin/latin-ext)
|
||||
→ ทุกหน้า link `k2d.css` (SPA = `./vendor/fonts/`, หน้าสถานี static = `../vendor/fonts/`)
|
||||
→ **precache ใน `sw.js` ครบทุกไฟล์** = ออฟไลน์ได้จริง · เพิ่ม/เปลี่ยนฟอนต์ → แก้ `PRECACHE` + bump `VERSION`
|
||||
- ตัวสำรอง (`Noto Sans Thai` · `Prompt` · `IBM Plex Mono`) ยังโหลดจาก Google Fonts CDN
|
||||
- เปลี่ยนฟอนต์ = แก้ **DESIGN.md §4 ก่อน** แล้วค่อยแก้โค้ด (DESIGN.md เป็นรัฐธรรมนูญ)
|
||||
- ห้ามใช้ฟอนต์แฟนซี/display เกินจำเป็น (DESIGN.md กฎข้อ 9) — ระบบเดียวทั้งเว็บ
|
||||
|
||||
## รูปเปลี่ยนแล้วไม่ขึ้น? — cache busting (แนวทาง B2)
|
||||
|
||||
**สาเหตุ:** SW ใช้ **cache-first กับรูป** → วางรูปทับชื่อเดิมแล้วเบราว์เซอร์ยังใช้ของเก่า
|
||||
|
||||
**วิธีแก้ (ใช้อยู่):** เติม **`?v=<เวอร์ชันแอป>`** ต่อท้าย URL รูปทุกตัว
|
||||
- `ui/imageurl.js` → `ImgURL.of(url)` เติมให้ (ข้าม URL ภายนอก/data:; ไม่เติมซ้ำ)
|
||||
- ใช้ใน: `busDetail.init.js` (รูปรถ/QR) · `busStop.init.js` (รูปสถานี/ป้าย) · `stopDetail.init.js` (รูปสถานี)
|
||||
- รูป static ใน `ui/index.html` (โลโก้/ไอคอน 4 จุด) เติม `?v=` ตรง ๆ
|
||||
- ค่ามาจาก `<meta name="app-version">` ซึ่ง**ต้องตรงกับ** `const VERSION` ใน `sw.js`
|
||||
|
||||
**ขั้นตอนหลังอัปรูป:**
|
||||
```
|
||||
python resource/tools/bump-version.py ← +1 รอบ (อัปเดต sw.js + meta + โลโก้ ให้ตรงกัน)
|
||||
python resource/tools/bump-version.py --check ← ตรวจว่าทุกที่ตรงกัน
|
||||
→ ให้ผู้ใช้กด Ctrl+Shift+R ครั้งเดียว = รูปทั้งหมดโหลดใหม่
|
||||
```
|
||||
⚠️ รูปที่เพิ่ม "ชื่อใหม่" (ไม่ทับของเดิม) เห็นผลทันที ไม่ต้อง bump
|
||||
@@ -61,6 +61,12 @@
|
||||
--muted: #6f7b95; /* ตัวอักษรรอง */
|
||||
--line: #e7e0f6; /* เส้นขอบม่วงอ่อน */
|
||||
|
||||
/* หมวดเส้นทาง (route_group ใน routes.json) — ใช้กับ "เลขสาย" (chip) เท่านั้น */
|
||||
--group-bangkok: #1f5fbf; /* เข้ากรุงเทพฯ — น้ำเงิน */
|
||||
--group-interprovincial: #7a4cc0; /* ระหว่างจังหวัด — ม่วง (ม่วงแบรนด์) */
|
||||
--group-in-province: #d6388f; /* ภายในจังหวัด — ชมพู */
|
||||
--group-municipal: #6b7268; /* ภายในเทศบาล — เทา (สำรอง ยังไม่มีสายใช้) */
|
||||
|
||||
/* สถานะ */
|
||||
--green-500: #1f8765; /* มีรอบ / เปิดให้บริการ */
|
||||
--green-50: #e4efe4;
|
||||
@@ -93,14 +99,38 @@
|
||||
|
||||
---
|
||||
|
||||
## 3.1 ระบบภาษา (i18n)
|
||||
|
||||
คำแปลแยกเป็น **ไฟล์ต่อภาษา** — `ui/locales/<รหัสภาษา>.json` (แบน: `"key": "ข้อความ"`)
|
||||
|
||||
- **ภาษาที่รองรับ** ประกาศที่ `ui/i18n.js → SUPPORTED` (ปัจจุบัน `th`, `en`) · ภาษาตั้งต้น `th`
|
||||
ใช้เป็น fallback เมื่อคีย์ขาดในภาษาปัจจุบัน
|
||||
- **เพิ่มภาษาใหม่** = วางไฟล์ `ui/locales/<รหัส>.json` + เพิ่มรหัสใน `SUPPORTED`
|
||||
+ เพิ่ม `./locales/<รหัส>.json` ใน PRECACHE ของ `ui/sw.js` (ไม่ต้องแก้โค้ดอื่น)
|
||||
- **โหลดแบบ lazy** เฉพาะภาษาที่ใช้ (+ ภาษาตั้งต้น) — ไม่ดึงทุกภาษามาทั้งหน้า
|
||||
- **ข้อความใน HTML คือ fallback** — ถ้าโหลดไฟล์ภาษาไม่สำเร็จ ระบบจะ **ไม่เขียนทับ** (คงข้อความเดิมไว้)
|
||||
- **สลับภาษา** → `I18N.setLang()` โหลดไฟล์ภาษาให้เสร็จก่อน แล้วประกาศ event `langchange` ให้หน้าวาดใหม่
|
||||
(กันข้อความที่ JS สร้างค้างเป็นภาษาเก่า) · จำค่าไว้ใน `localStorage('at_lang')`
|
||||
- `<html lang>` ถูกอัปเดตตามภาษาที่เลือกอัตโนมัติ (a11y · การตัดคำ · เลือกฟอนต์)
|
||||
- **ชื่อเฉพาะไม่แปล** — ชื่อสถานี จังหวัด สายรถ (ภาษาไทยเสมอ)
|
||||
- **ตรวจก่อน commit:** `python resource/tools/check-i18n.py`
|
||||
|
||||
## 4. ตัวพิมพ์ (Typography)
|
||||
|
||||
```css
|
||||
--font-display: "Prompt", "Noto Sans Thai", sans-serif; /* หัวเรื่อง — หนัก 700–800 */
|
||||
--font-body: "Noto Sans Thai", "Sarabun", sans-serif; /* เนื้อหา */
|
||||
--font-mono: "IBM Plex Mono", ui-monospace, monospace; /* เวลา + เลขสาย + ตัวเลข */
|
||||
--font-display: "K2D", "Prompt", "Noto Sans Thai", sans-serif; /* หัวเรื่อง — หนัก 600–800 (มีหัวแบบไทย) */
|
||||
--font-body: "K2D", "Noto Sans Thai", "Sarabun", sans-serif; /* เนื้อหา — อ่านง่ายบนจอเล็ก */
|
||||
--font-mono: "IBM Plex Mono", ui-monospace, monospace; /* เวลา + เลขสาย + ตัวเลข */
|
||||
```
|
||||
|
||||
**ทำไม K2D:** ฟอนต์ไทย **มีหัว (Loop)** หัวเหลี่ยมโมเดิร์น ไม่เชย · น้ำหนักครบ 300–800 · ตัวเลขสวย (เข้าคู่กับ
|
||||
`IBM Plex Mono` ที่ใช้กับเวลา/เลขสาย) · ใบอนุญาต SIL OFL
|
||||
|
||||
**ฝังไว้ในโปรเจกต์ (ไม่พึ่ง CDN):** ไฟล์อยู่ที่ `ui/vendor/fonts/` — `k2d.css` (@font-face 18 กฎ · 6 น้ำหนัก ×
|
||||
subset thai/latin/latin-ext · ~218 KB) + ไฟล์ `.woff2` 18 ไฟล์
|
||||
· precache ใน `sw.js` → **ทำงานออฟไลน์ได้จริง** · อัปเดตฟอนต์ = โหลดชุดใหม่ทับ แล้ว bump `VERSION` ใน `sw.js`
|
||||
· `Prompt` / `Noto Sans Thai` ยังโหลดจาก Google Fonts เป็นตัวสำรองใน Fallback chain (ออฟไลน์จะถอยไป `system-ui`)
|
||||
|
||||
| ระดับ | ฟอนต์ | ขนาด | ลักษณะ |
|
||||
|---|---|---|---|
|
||||
| H1 (hero) | display 800 | clamp(2.2rem, 6vw, 3.4rem) | ตัวตรง ไม่มี gradient |
|
||||
@@ -125,10 +155,40 @@
|
||||
- รหัสป้าย/เลขสาย: พื้น `--grad-brand` ตัวอักษรขาว mono 700
|
||||
- กลุ่มเวลาวางเป็น grid เรียงจากน้อยไปมาก
|
||||
|
||||
### เลขสายหน้า `#/routes/:id` — พื้นหลังตามหมวดเส้นทาง
|
||||
เลขสาย (`.mu-route-chip`) เปลี่ยนสีพื้นหลังตาม **หมวดเส้นทาง** ที่ประกาศใน
|
||||
`resource/data/routes.json → route_group` (นิยามหมวดอยู่ที่ `route_groups.json`)
|
||||
เพื่อให้อ่านปราดเดียวรู้ว่าสายนั้นเป็นสายประเภทใด
|
||||
|
||||
| หมวด (`route_group`) | สี | โทเคน | คลาส CSS |
|
||||
|---|---|---|---|
|
||||
| `bangkok` — เข้ากรุงเทพฯ | น้ำเงิน | `--group-bangkok` | `.grp-bangkok` |
|
||||
| `interprovincial` — ระหว่างจังหวัด | ม่วง | `--group-interprovincial` | `.grp-interprovincial` |
|
||||
| `in_province` — ภายในจังหวัด | ชมพู | `--group-in-province` | `.grp-in_province` |
|
||||
| `municipal` — ภายในเทศบาล | เทา (สำรอง) | `--group-municipal` | `.grp-municipal` |
|
||||
| ไม่ระบุ / ไม่รู้จัก | ม่วงแบรนด์ (ค่าเริ่มต้น) | `--grad-brand` | *(ไม่มีคลาส)* |
|
||||
|
||||
- ใช้เฉพาะ **การ์ดหัวเรื่องหน้ารายละเอียดสาย** (`#/routes/:id`) — chip เล็กในหน้า `#/stops` ยังใช้ม่วงแบรนด์
|
||||
- **เพิ่มหมวดใหม่** = เพิ่ม `route_group` ใน `route_groups.json` + โทเคนสีใน §3 + กฎ `.grp-<key>` ใน `busDetail.html`
|
||||
- สีของหมวด **ไม่ใช่** สีสถานะ — ห้ามนำไปใช้กับ badge สถานะ (§5 ป้ายสถานะ)
|
||||
|
||||
### ป้ายสถานะ (status badge)
|
||||
- พื้นสีอ่อน (`--green-50` / `--red-50` / `--amber-50`) + ตัวอักษรสีเข้มของเฉดนั้น
|
||||
- ใช้เฉพาะบอกสถานะจริง ไม่ใช่แค่ตกแต่ง
|
||||
|
||||
### หัวโซน (zone head) — ป้ายหัวข้อ + บรรทัดข้อมูล
|
||||
ใช้กับทุกโซนที่มีป้ายกำกับ (`.mu-zone-head`) เช่น `#/check` (`ตารางเวลาเดินรถทุกจุดจอด`) และ `#/routes/:id` (แผนที่)
|
||||
|
||||
- ป้ายหัวข้อ (`.mu-zone-tag`) — แคปซูลสีอ่อนตามโทนของโซน (tag-purple / tag-sky / tag-pink / tag-yellow)
|
||||
- **บรรทัดข้อมูลต้องแยกเป็น "ชิ้น" (`.mu-zone-seg`)** ไม่ใช่สตริงยาว ๆ ที่ต่อด้วย `·` เอง
|
||||
- เหตุผล: ภาษาไทยไม่มีเว้นวรรค → ถ้าเป็นสตริงเดียว เบราว์เซอร์จะ **ตัดกลางชื่อสถานี**
|
||||
- แต่ละชิ้นเป็น flex item → ตัดบรรทัดเป็นหน่วย · ตัวคั่น `·` วาดด้วย `::after` (ท้ายชิ้น ไม่ขึ้นต้นบรรทัด)
|
||||
- ชิ้นที่เล็กลง (เช่น ชื่อสถานีในวงเล็บ `.mu-zone-at`) ช่วยให้บรรทัดจัดเรียงสวยขึ้น
|
||||
- **มือถือ (<768px)** — ป้ายหัวข้อบรรทัดบน · บรรทัดข้อมูลเต็มความกว้าง เรียงลงมา (flex + wrap)
|
||||
- **จอใหญ่ (≥768px)** — เปลี่ยนเป็น **grid 2 คอลัมน์**: ป้ายหัวข้อซ้าย · บรรทัดข้อมูลคอลัมน์ขวา
|
||||
· จำกัดความยาวบรรทัด `max-width: 82ch` (กันบรรทัดยาวเกินอ่านยาก)
|
||||
- ห้ามใช้ `flex` โดยไม่ใส่ `flex-wrap` ร่วมกับลูกที่เป็น `flex-basis:100%` (จะถูกบีบรวมแถวเดียว)
|
||||
|
||||
### แถบนำทาง (topbar)
|
||||
- พื้น `--paper` (ขาว) ตัวอักษร `--ink` ขอบล่าง `1px solid --line`
|
||||
- active menu = เส้นใต้ `--purple`
|
||||
@@ -159,3 +219,10 @@
|
||||
---
|
||||
|
||||
*ไฟล์นี้มีผลบังคับใช้กับทุกงานออกแบบในโปรเจกต์ — ถ้าอยากเปลี่ยนทิศทางศิลป์ ต้องแก้ไฟล์นี้ก่อน แล้วค่อยเขียนโค้ด*
|
||||
|
||||
---
|
||||
|
||||
## 9. รูปภาพ (Asset cache)
|
||||
|
||||
รูปทุกตัวเติม `?v=<เวอร์ชันแอป>` อัตโนมัติผ่าน `ui/imageurl.js` — เปลี่ยนรูปทับชื่อเดิมแล้ว
|
||||
ต้องรัน `python resource/tools/bump-version.py` เพื่อให้ทุกเครื่องเห็นของใหม่ (รายละเอียดใน AGENTS.md)
|
||||
@@ -63,7 +63,7 @@
|
||||
"offsets_min": [
|
||||
0,
|
||||
45,
|
||||
null,
|
||||
60,
|
||||
null
|
||||
]
|
||||
},
|
||||
@@ -110,16 +110,46 @@
|
||||
"longitude": [
|
||||
100.41580160519578,
|
||||
100.46123794436457
|
||||
],
|
||||
"offsets_min": [
|
||||
0,
|
||||
30
|
||||
]
|
||||
},
|
||||
{
|
||||
"route_id": "1101",
|
||||
"station_name_th": "วัดสีบัวทอง",
|
||||
"route_id": "1011",
|
||||
"station_name_th": [
|
||||
"วัดสีบัวทอง",
|
||||
"ตลาดแสวงหา",
|
||||
"ตลาดสดเทศบาลตำบลโพธิ์ทอง"
|
||||
],
|
||||
"city_th": "แสวงหา",
|
||||
"province_th": "อ่างทอง",
|
||||
"station_type": "local_stop",
|
||||
"latitude": 14.787802367428677,
|
||||
"longitude": 100.23218786664407
|
||||
"latitude": [
|
||||
14.787802367428677,
|
||||
14.749622456669288,
|
||||
14.661318107670693
|
||||
],
|
||||
"longitude": [
|
||||
100.23218786664407,
|
||||
100.32660174886443,
|
||||
100.40858605122014
|
||||
],
|
||||
"offsets_min": [
|
||||
0,
|
||||
25,
|
||||
55
|
||||
]
|
||||
},
|
||||
{
|
||||
"route_id": "641",
|
||||
"station_name_th": "7-11 บ้านแพรก",
|
||||
"city_th": "บ้านแพรก",
|
||||
"province_th": "อยุธยา",
|
||||
"station_type": "local_stop",
|
||||
"latitude": 14.648426896998021,
|
||||
"longitude": 100.57918677073818
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
> 📌 **ไฟล์นี้เป็นบันทึกของเจ้าของข้อมูล ไม่ใช่ข้อมูลสำหรับเว็บ** — เว็บอ่านเฉพาะ `8 other_stop.json`
|
||||
> ไฟล์นี้มีไว้กันการ "ช่วยเติมข้อมูล" ที่ไม่ได้รับอนุญาต (เช่น AI หรือผู้พัฒนาที่เข้ามาทีหลัง)
|
||||
|
||||
อัปเดตล่าสุด: **2026-09-26** · ผู้ตัดสินใจ: เจ้าของข้อมูล (ทีม Atroute)
|
||||
อัปเดตล่าสุด: **2026-10-05** · ผู้ตัดสินใจ: เจ้าของข้อมูล (ทีม Atroute)
|
||||
|
||||
---
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
ซึ่งเป็น**ชื่อรวม**ของทุกสายที่ไม่ได้ขึ้นที่สถานีหลัก — ของจริงของแต่ละสายอยู่ใน `8 other_stop.json` เช่น
|
||||
|
||||
```json
|
||||
{ "route_id": "1101", "station_name_th": "วัดสีบัวทอง", "city_th": "แสวงหา", "province_th": "อ่างทอง",
|
||||
"station_type": "local_stop", "latitude": 14.787802367428677, "longitude": 100.23218786664407 }
|
||||
{ "route_id": "2231", "station_name_th": "วัดมหานาม", "city_th": "ไชโย", "province_th": "อ่างทอง",
|
||||
"station_type": "local_stop", "latitude": 14.712584910077634, "longitude": 100.44760308824014 }
|
||||
```
|
||||
|
||||
หน้าเว็บ (`#/stops/other_stop?route=1011`) จะขึ้น **"จุดขึ้นรถประจำทางอื่นๆ · วัดสีบัวทอง"** โดยจับคู่จากไฟล์นี้
|
||||
@@ -22,56 +22,58 @@
|
||||
|
||||
---
|
||||
|
||||
## 2. ⛔ ห้ามเพิ่ม 7 สายนี้ (เจ้าของข้อมูลกำหนด)
|
||||
## 2. ⛔ ห้ามเพิ่ม 5 สายนี้ (เจ้าของข้อมูลกำหนด)
|
||||
|
||||
| สาย | ชื่อสาย | มี`station_id 8` ในเส้นทางไหม | สถานะข้อมูลของจุดนั้น | คำสั่ง |
|
||||
| ------------- | ------------------------------------------------ | --------------------------------------------- | ---------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
||||
| | | | | |
|
||||
| **952** | กรุงเทพ-วิเศษชัยชาญ | มี (จุดที่ 3/3) | มีเวลา 3 เที่ยว แต่ยังไม่ระบุชื่อจุดจริง | ⛔ ห้ามเพิ่ม entry (อย่าเพิ่มเพราะเห็นว่ามีเวลา) |
|
||||
| **641** | อ่างทอง-บ้านแพรก-ลพบุรี | มี (จุดที่ 3/3) | ยังไม่มีข้อมูลเวลาที่จุดนี้ | ⛔ ห้ามเพิ่ม entry |
|
||||
| **15** | กรุงเทพ-อ่างทอง สายใน | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
| **902** | กรุงเทพ-อ่างทอง สายเอเซีย | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
| **464** | สุพรรณ-อ่างทอง-สระบุรี | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
| **101** | อ่างทอง-ป่าโมก-อยุธยา | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
| สาย | ชื่อสาย | มี `station_id 8` ในเส้นทางไหม | สถานะข้อมูลของจุดนั้น | คำสั่ง |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| **952** | กรุงเทพ-วิเศษชัยชาญ | มี (จุดที่ 3/3) | มีเวลา 3 เที่ยว แต่ยังไม่ระบุชื่อจุดจริง | ⛔ ห้ามเพิ่ม entry (อย่าเพิ่มเพราะเห็นว่ามีเวลา) |
|
||||
| **15** | กรุงเทพ-อ่างทอง สายใน | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
| **902** | กรุงเทพ-อ่างทอง สายเอเซีย | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
| **464** | สุพรรณ-อ่างทอง-สระบุรี | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
| **101** | อ่างทอง-ป่าโมก-อยุธยา | ไม่มี | — | ⛔ ห้ามเพิ่ม — เพิ่มไปก็ไม่แสดงผล |
|
||||
|
||||
**ผลเมื่อไม่มี entry:** หน้าเว็บยังทำงานปกติ — แถวของสายนั้นจะแสดงตำแหน่งในเส้นทางแทน
|
||||
(เช่น `จุดจอดที่ 3/3` หรือ `Passing · 4/5`) **ไม่ใช่ข้อผิดพลาด** และไม่ต้องไปเติมให้ครบ
|
||||
|
||||
---
|
||||
|
||||
## 3. ✅ 6 รายการที่มีอยู่แล้ว — ห้ามลบ
|
||||
## 3. ✅ 8 รายการที่มีอยู่แล้ว — ห้ามลบ
|
||||
|
||||
| `route_id` ในไฟล์ | ใช้กับสาย | ชื่อจุดจริง | อำเภอ/จังหวัด |
|
||||
| ------------------------- | ------------------ | ------------------------ | -------------------------------------------------- |
|
||||
| `2231` | 2231 | วัดมหานาม | ไชโย · อ่างทอง |
|
||||
| `324` | 324 | วัดไชโย | ไชโย · อ่างทอง |
|
||||
| `954` | 954 | ตลาดท่าช้าง | เดิมบางนางบวช · สุพรรณบุรี |
|
||||
| `8` | 8 | ตลาดสรรคบุรี | สรรคบุรี · ชัยนาท |
|
||||
| `2194` | 2194 | วัดหัวเวียง | เสนา · อยุธยา |
|
||||
| **`1101`** | **1011** | วัดสีบัวทอง | แสวงหา · อ่างทอง |
|
||||
| `route_id` ในไฟล์ | ใช้กับสาย | ชื่อจุดจริง (จุดแรก) | อำเภอ/จังหวัด | จำนวนจุด · offsets_min |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| `2231` | 2231 | วัดมหานาม | ไชโย · อ่างทอง | 1 จุด |
|
||||
| `324` | 324 | วัดไชโย | ไชโย · อ่างทอง | 1 จุด |
|
||||
| `951` | 951 | ตลาดวิเศษชัยชาญ | เดิมบางนางบวช · สุพรรณบุรี (จุดแรก) | 2 จุด · ยังไม่ระบุ offset |
|
||||
| `954` | 954 | ตลาดท่าช้าง | เดิมบางนางบวช · สุพรรณบุรี | 4 จุด · offsets `[0, 45, 60, null]` |
|
||||
| `8` | 8 | ตลาดสรรคบุรี | สรรคบุรี · ชัยนาท (จุดแรก) | 3 จุด · ยังไม่ระบุ offset |
|
||||
| `2194` | 2194 | วัดหัวเวียง | เสนา · อยุธยา | 2 จุด · offsets `[0, 30]` |
|
||||
| `1011` | 1011 | วัดสีบัวทอง | แสวงหา · อ่างทอง | 3 จุด · offsets `[0, 25, 55]` |
|
||||
| `641` | 641 | 7-11 บ้านแพรก | บ้านแพรก · อยุธยา (จุดแรก) | 1 จุด |
|
||||
|
||||
> ⚠️ `1101` **ไม่ใช่รหัสสายจริง** — เป็นรหัสที่ระบบเดิมใช้แทนสาย **1011**
|
||||
> โค้ดรองรับไว้แล้ว (เทียบแบบ "ตัวเลขชุดเดียวกัน สลับตำแหน่ง" เฉพาะรหัส ≥3 หลัก และหาคู่ได้ไม่กำกวม)
|
||||
> จะแก้เป็น `"1011"` ก็ได้ (โค้ดรองรับทั้งสองแบบ) แต่ **ห้ามลบ** เพราะจุดนี้เป็นของสาย 1011
|
||||
**หมายเหตุ:** `route_id` ในไฟล์ **ตรงกับรหัสสายจริงทุกตัว** — เดิมมี `1101` ซึ่งเป็นรหัสเพี้ยนของสาย `1011` แก้เป็น `1011` แล้ว
|
||||
|
||||
---
|
||||
|
||||
## 4. กติกาที่โค้ดใช้จับคู่ (`ui/partials/otherStop.js`)
|
||||
|
||||
1. **ตรงตัวก่อน** — `route_id` ในไฟล์ตรงกับรหัสสายจริง → ใช้เลย
|
||||
2. **ไม่ตรง → เทียบแบบสลับตำแหน่งตัวเลข** เฉพาะรหัส **≥3 หลัก** และต้องหาคู่ได้ **ตัวเดียว** → `1101 → 1011` ✅
|
||||
2. **ไม่ตรง → เทียบแบบสลับตำแหน่งตัวเลข** เฉพาะรหัส **≥3 หลัก** และต้องหาคู่ได้ **ตัวเดียว**
|
||||
(ชั้นนี้เป็น "ตัวกันพลาด" สำหรับรหัสที่พิมพ์สลับหลักในอนาคต · ค่าจริงในไฟล์ใช้รหัสตรงแล้วทุกตัว)
|
||||
3. **ไม่รู้จัก / กำกวม → ไม่เดา** (คืนค่าว่าง แล้ว UI ถอยไปแสดงตำแหน่งในเส้นทาง) — เช่น `51` จะไม่ถูกจับเป็น `15`
|
||||
|
||||
## 5. ถ้าอนาคตจะเพิ่มรายการใหม่ (ต้องได้รับการยืนยันจากเจ้าของข้อมูลก่อน)
|
||||
|
||||
คีย์ที่ต้องมี: `route_id`, `station_name_th`, `city_th`, `province_th`, `station_type` (`local_stop`), `latitude`, `longitude` (+ `note` ถ้ามี)
|
||||
คีย์ที่ต้องมี: `route_id`, `station_name_th`, `city_th`, `province_th`, `station_type` (`local_stop`), `latitude`, `longitude`
|
||||
คีย์เพิ่มเติม: `offsets_min` (array · นาทีจากจุดแรก · `0` = จุดแรกเอง · `null` = ยังไม่ระบุ) · `note` (ถ้ามี)
|
||||
|
||||
หลังเพิ่ม: หน้า `#/stops/other_stop?route=<รหัสสาย>` ต้องขึ้นชื่อจุดนั้นทันที · และ `#/routes/<รหัสสาย>` จะแสดงจุดนั้นพร้อม กม. ตามเส้นทาง
|
||||
|
||||
**ข้อห้าม:** อย่าเพิ่มรายการเพราะ "เห็นว่ายังไม่มี" — ถ้าไม่มีในตาราง §3 แปลว่ายังไม่ได้รับข้อมูลจากเจ้าของ
|
||||
|
||||
## 6. กติกา "หลายจุดต่อสาย" (สำคัญ — เจ้าของข้อมูลกำหนด)
|
||||
|
||||
สายเดียวผ่านได้หลายจุด (เช่น **954** = ตลาดท่าช้าง · ตลาดสามโก้ · ตลาดวิเศษชัยชาญ · ตลาดอ่างทอง)
|
||||
สายเดียวผ่านได้หลายจุด (เช่น **954** = ตลาดท่าช้าง · ตลาดสามโก้ · ตลาดวิเศษชัยชาญ · ตลาดอ่างทอง
|
||||
หรือ **1011** = วัดสีบัวทอง · ตลาดแสวงหา · ตลาดสดเทศบาลตำบลโพธิ์ทอง)
|
||||
|
||||
```json
|
||||
"station_name_th": ["ตลาดท่าช้าง", "ตลาดสามโก้", "ตลาดวิเศษชัยชาญ", "ตลาดอ่างทอง"],
|
||||
@@ -84,9 +86,11 @@
|
||||
- ตัวอย่าง array: สาย 8 → `latitude: [15.0474, 14.7497, 14.6603]` + 4 ชื่อ → ชื่อที่ 4 (ตลาดอ่างทอง) ยังไม่มีพิกัด
|
||||
- **ชื่อที่เกินจำนวนพิกัด = ยังไม่มีพิกัด** → เว็บแสดงชื่อพร้อมป้าย "ยังไม่มีพิกัด" (ไม่ซ่อน ไม่เดา)
|
||||
- `city_th`/`province_th` ในไฟล์อธิบาย **จุดแรก** เท่านั้น (จุดอื่นไม่ทราบ)
|
||||
- `offsets_min` = **นาทีจากจุดแรก** (ไม่ใช่จากจุดก่อนหน้า) → จุดแรกเป็น `0` เสมอ
|
||||
|
||||
**การแสดงผล:** `#/stops/other_stop?route=954` → แสดง "จุดขึ้นรถประจำทางอื่นๆ · ตลาดท่าช้าง" (ชื่อย่อ = จุดแรก)
|
||||
+ รายการ **ทุกจุด** ของสายนั้น (แถวที่ไม่มีพิกัดขึ้นป้ายเตือน) · แผนที่ปักหมุดเฉพาะจุดที่มีพิกัด
|
||||
+ หน้า `#/check/<สาย>` แสดงการ์ดย่อยของแต่ละจุด พร้อมเวลาที่คำนวณจากจุดอ้างอิงตาม `offsets_min`
|
||||
|
||||
**ข้อสังเกตของเจ้าของข้อมูล (ยังไม่แก้ ต้องยืนยัน):**
|
||||
- สาย **951** และ **954** มีค่า `latitude/longitude` **เท่ากันเป๊ะ** (14.651061064977933, 100.14903762295052)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
|
||||
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@
|
||||
"route_id": "101",
|
||||
"vehicle_image": "car.jpeg",
|
||||
"qr_image": "101.png",
|
||||
"vehicle_title": "รถปรับอากาศ · ไม่สูบบุหรี่",
|
||||
"vehicle_desc": "40 ที่นั่ง · ให้บริการตลอดเส้นทางอ่างทอง–ป่าโมก–อยุธยา พร้อมที่วางสัมภาระและแอร์เย็นฉ่ำ",
|
||||
"line_note": "ติดตามข่าวสาย 101 · เลื่อนเวลา · ไม่มีรถ"
|
||||
"vehicle_title": "รถสองแถวประจำเส้นทาง",
|
||||
"vehicle_desc": "ประมาณ 30 ที่นั่ง · ให้บริการตลอดเส้นทางอ่างทอง–ป่าโมก–อยุธยา",
|
||||
"line_note": "ติดตามข่าวสาย 101 · รถออกก่อนเวลาบ่อยครั้ง · รถขาดช่วง"
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"route_id": "1011",
|
||||
"vehicle_image": "car.jpeg",
|
||||
"qr_image": "",
|
||||
"vehicle_title": "",
|
||||
"vehicle_desc": "",
|
||||
"vehicle_title": "รถเมล์ประจำเส้นทาง",
|
||||
"vehicle_desc": "รถเมล์ ประมาณ 30 ที่นั่ง รถมีเที่ยว เช้า เที่บง เย็น",
|
||||
"line_note": ""
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"route_id": "15",
|
||||
"vehicle_image": "car.jpg",
|
||||
"qr_image": "15.JPG",
|
||||
"vehicle_title": "",
|
||||
"vehicle_desc": "",
|
||||
"vehicle_title": "รถมินิบัส 20 ที่นั่ง",
|
||||
"vehicle_desc": "ปัจจุบันส่วนใหญ่วิ่งแค่ป่าโมก หมอชิตใหม่ เหลือแค่รถ เบอร์ 20 ที่กลับถึงอ่างทอง บขส.อ่างทองมีรถออกแค่เช้ามืดถึงโมงเช้า",
|
||||
"line_note": ""
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"route_id": "2194",
|
||||
"vehicle_image": "car.jpg",
|
||||
"qr_image": "",
|
||||
"vehicle_title": "",
|
||||
"vehicle_desc": "",
|
||||
"vehicle_title": "รถสองแถวประจำเส้นทาง",
|
||||
"vehicle_desc": "รถสองแถวเช้ามืดและเย็น ผ่านอ่างทองแค่สามแยกข้ามสะพานโผงเผงและวัดถนน",
|
||||
"line_note": ""
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"route_id": "2231",
|
||||
"vehicle_image": "car.jpg",
|
||||
"qr_image": "",
|
||||
"vehicle_title": "",
|
||||
"vehicle_desc": "",
|
||||
"vehicle_title": "รถสองแถวประจำเส้นทาง",
|
||||
"vehicle_desc": "มีเที่ยวเดียว เช้า-เย็น",
|
||||
"line_note": ""
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
"route_id": "324",
|
||||
"vehicle_image": "car.jpg",
|
||||
"qr_image": "",
|
||||
"vehicle_title": "",
|
||||
"vehicle_desc": "",
|
||||
"vehicle_title": "รถสองแถวประจำเส้นทาง",
|
||||
"vehicle_desc": "รถมีเที่ยว เช้า อย่างเดียว วิ่งสุดสายแค่วัดไชโย",
|
||||
"line_note": ""
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"route_id":"dream-Watcharapol"},"geometry":{"type":"LineString","coordinates":[[100.45187,14.59472],[100.44941,14.59352],[100.44782,14.59261],[100.44688,14.5919],[100.44638,14.5913],[100.44607,14.59074],[100.44577,14.59016],[100.44541,14.58959],[100.44499,14.58903],[100.44456,14.58855],[100.44424,14.58816],[100.44404,14.58783],[100.44391,14.58744],[100.44386,14.5869],[100.44393,14.58622],[100.44414,14.58538],[100.44447,14.58433],[100.44486,14.58301],[100.44525,14.58164],[100.44554,14.5806],[100.44568,14.58002],[100.44573,14.57958],[100.44577,14.579],[100.44584,14.57834],[100.44599,14.57778],[100.44621,14.57735],[100.44647,14.57702],[100.44678,14.57671],[100.44714,14.57627],[100.44755,14.57555],[100.448,14.57447],[100.44846,14.57296],[100.44879,14.57118],[100.44878,14.56944],[100.4483,14.56791],[100.44745,14.56651],[100.44635,14.56518],[100.44511,14.56394],[100.44387,14.56285],[100.44283,14.56182],[100.44222,14.56062],[100.44216,14.55913],[100.44251,14.55745],[100.44313,14.55572],[100.44376,14.55405],[100.44418,14.55257],[100.44429,14.55121],[100.44415,14.54981],[100.44384,14.54827],[100.44361,14.54677],[100.44367,14.5454],[100.44414,14.54391],[100.44508,14.54197],[100.44619,14.53958],[100.44687,14.53709],[100.44683,14.53474],[100.44649,14.53267],[100.44629,14.53091],[100.44631,14.52934],[100.44654,14.52775],[100.44718,14.52619],[100.4486,14.52492],[100.45091,14.52402],[100.4536,14.5232],[100.45612,14.52217],[100.45815,14.52095],[100.45945,14.51965],[100.45988,14.51823],[100.45941,14.51655],[100.45815,14.51459],[100.45656,14.51268],[100.4551,14.51111],[100.45389,14.50974],[100.45291,14.50826],[100.45205,14.50658],[100.45112,14.50485],[100.45004,14.50325],[100.449,14.5021],[100.4482,14.50164],[100.44765,14.50145],[100.4473,14.50087],[100.44719,14.49981],[100.44743,14.4987],[100.448,14.49781],[100.44857,14.49702],[100.44879,14.4962],[100.4486,14.49544],[100.44804,14.49495],[100.44725,14.49478],[100.44648,14.49493],[100.44593,14.49531],[100.44564,14.49571],[100.44562,14.49594],[100.44586,14.49597],[100.44629,14.49584],[100.44685,14.49564],[100.44749,14.49547],[100.44811,14.49545],[100.44846,14.49562],[100.44836,14.49602],[100.44783,14.49663],[100.447,14.49736],[100.44607,14.49811],[100.44538,14.49874],[100.44519,14.49914],[100.44571,14.49925],[100.44705,14.49904],[100.44893,14.49852],[100.45087,14.49775],[100.45259,14.49688],[100.45397,14.49616],[100.45501,14.49571],[100.45595,14.49535],[100.45703,14.49488],[100.45837,14.49429],[100.45999,14.49365],[100.46181,14.49302],[100.46361,14.49249],[100.46524,14.4921],[100.46675,14.49177],[100.46821,14.49145],[100.4697,14.49115],[100.47131,14.49091],[100.47315,14.49076],[100.47539,14.49066],[100.47803,14.49058],[100.48053,14.49051],[100.48233,14.49042],[100.48358,14.49032],[100.48475,14.49023],[100.4861,14.49014],[100.48756,14.49001],[100.48908,14.48981],[100.49064,14.48955],[100.49229,14.48924],[100.49435,14.48876],[100.49735,14.48793],[100.50121,14.48675],[100.50521,14.48546],[100.50871,14.4843],[100.51156,14.48335],[100.51375,14.48265],[100.51556,14.48211],[100.51745,14.48151],[100.51959,14.48088],[100.52184,14.4805],[100.524,14.48055],[100.52591,14.48089],[100.52743,14.48127],[100.52866,14.48106],[100.52985,14.47943],[100.53123,14.47619],[100.53305,14.47203],[100.53542,14.46756],[100.53801,14.46297],[100.54045,14.45836],[100.54262,14.45388],[100.54456,14.44967],[100.54653,14.44575],[100.54908,14.44188],[100.55261,14.43786],[100.55694,14.43374],[100.56176,14.42958],[100.56659,14.42549],[100.57087,14.42154],[100.57438,14.41782],[100.57738,14.41441],[100.58021,14.41129],[100.58323,14.40805],[100.5868,14.40423],[100.59075,14.39997],[100.59461,14.39578],[100.59804,14.39195],[100.60095,14.38853],[100.6033,14.38544],[100.60531,14.38245],[100.60722,14.3793],[100.60913,14.37611],[100.61104,14.37326],[100.61283,14.37077],[100.6142,14.36813],[100.61497,14.36488],[100.61533,14.3608],[100.61557,14.35582],[100.61578,14.35034],[100.61591,14.34505],[100.61598,14.33998],[100.61606,14.3341],[100.61623,14.32669],[100.6165,14.31889],[100.61687,14.31214],[100.61722,14.30586],[100.61739,14.2981],[100.61732,14.28866],[100.61718,14.28024],[100.6171,14.27504],[100.61709,14.27196],[100.61708,14.2691],[100.61701,14.26583],[100.61675,14.26241],[100.61631,14.25887],[100.61585,14.2549],[100.61549,14.25036],[100.6152,14.24599],[100.61489,14.24275],[100.61454,14.24043],[100.61413,14.23806],[100.61368,14.23516],[100.61323,14.23223],[100.61279,14.22975],[100.61237,14.22774],[100.61195,14.226],[100.61157,14.22414],[100.61128,14.22154],[100.61109,14.21801],[100.61096,14.21411],[100.61084,14.2104],[100.61075,14.20698],[100.61069,14.20379],[100.61069,14.20094],[100.61074,14.19858],[100.61082,14.19667],[100.61092,14.19479],[100.611,14.19258],[100.61107,14.19023],[100.61113,14.18806],[100.61121,14.18617],[100.61137,14.18447],[100.61165,14.18286],[100.61213,14.18136],[100.61286,14.17998],[100.61379,14.17887],[100.61483,14.17821],[100.Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"route_id":"dream-ayutthaya-hsr"},"geometry":{"type":"LineString","coordinates":[[100.4517,14.59442],[100.45327,14.59087],[100.45425,14.58831],[100.45477,14.58656],[100.45491,14.58544],[100.45481,14.58477],[100.45456,14.58439],[100.45427,14.58411],[100.45401,14.58384],[100.45379,14.58355],[100.4536,14.58323],[100.45345,14.58287],[100.45334,14.58244],[100.45328,14.58193],[100.45327,14.58133],[100.4533,14.58064],[100.45336,14.57989],[100.45345,14.5791],[100.45355,14.57828],[100.45366,14.57745],[100.45377,14.57662],[100.45387,14.57582],[100.45395,14.57504],[100.45403,14.5743],[100.4541,14.5736],[100.45415,14.57293],[100.45418,14.57232],[100.4542,14.57176],[100.4542,14.57125],[100.45418,14.57079],[100.45414,14.57036],[100.45408,14.56997],[100.454,14.56961],[100.45389,14.56927],[100.45376,14.56896],[100.45361,14.56865],[100.45343,14.56836],[100.45323,14.56807],[100.453,14.56778],[100.45275,14.56749],[100.45248,14.56719],[100.45218,14.56688],[100.45188,14.56655],[100.45158,14.56621],[100.45128,14.56584],[100.45099,14.56544],[100.45072,14.56502],[100.45048,14.56456],[100.45026,14.56407],[100.45008,14.56356],[100.44992,14.56303],[100.4498,14.5625],[100.4497,14.56196],[100.44965,14.56141],[100.44962,14.56088],[100.44962,14.56034],[100.44964,14.55981],[100.44967,14.55927],[100.44971,14.55874],[100.44974,14.55821],[100.44977,14.55767],[100.44979,14.55713],[100.44981,14.55659],[100.44981,14.55603],[100.44979,14.55547],[100.44976,14.55488],[100.44972,14.55428],[100.44965,14.55367],[100.44958,14.55305],[100.44951,14.55243],[100.44945,14.55183],[100.44941,14.55125],[100.4494,14.55071],[100.44942,14.5502],[100.44949,14.5497],[100.4496,14.54917],[100.44976,14.54856],[100.44999,14.54785],[100.45029,14.54699],[100.45066,14.54595],[100.4511,14.54473],[100.45159,14.54341],[100.45211,14.54204],[100.45264,14.54069],[100.45316,14.53943],[100.45365,14.53833],[100.4541,14.53742],[100.45452,14.53669],[100.45494,14.53608],[100.45539,14.53554],[100.45591,14.53502],[100.45651,14.53446],[100.45723,14.53381],[100.45807,14.53305],[100.45898,14.53221],[100.45993,14.53133],[100.46086,14.53044],[100.46174,14.52957],[100.46253,14.52877],[100.46318,14.52806],[100.46369,14.52744],[100.4641,14.52689],[100.46442,14.52639],[100.46467,14.52591],[100.46488,14.52545],[100.46506,14.52498],[100.46523,14.52447],[100.46539,14.52391],[100.46553,14.52327],[100.46566,14.52251],[100.46576,14.52162],[100.46583,14.52056],[100.46588,14.51932],[100.46591,14.51793],[100.46591,14.51646],[100.46589,14.51497],[100.46586,14.51353],[100.46582,14.51221],[100.46577,14.51107],[100.4657,14.51016],[100.46561,14.50941],[100.46546,14.50876],[100.46522,14.50816],[100.46489,14.50755],[100.46443,14.50686],[100.46382,14.50604],[100.46308,14.50508],[100.46224,14.50405],[100.46134,14.50298],[100.46043,14.50193],[100.45954,14.50094],[100.4587,14.50006],[100.45795,14.49933],[100.45725,14.49875],[100.45658,14.49831],[100.45589,14.49799],[100.45515,14.4978],[100.45434,14.49773],[100.45341,14.49776],[100.45238,14.49788],[100.45129,14.49805],[100.45021,14.49823],[100.44917,14.49841],[100.44823,14.49853],[100.44744,14.49857],[100.44683,14.49851],[100.4464,14.49836],[100.44613,14.49815],[100.44597,14.49791],[100.44593,14.49768],[100.44596,14.49747],[100.44604,14.49732],[100.44617,14.49723],[100.44632,14.4972],[100.4465,14.49722],[100.4467,14.49727],[100.44691,14.49734],[100.44713,14.49743],[100.44735,14.49751],[100.44758,14.49759],[100.44786,14.49765],[100.4482,14.49768],[100.44863,14.49768],[100.44916,14.49763],[100.44983,14.49752],[100.45063,14.49736],[100.45154,14.49713],[100.45253,14.49685],[100.45358,14.4965],[100.45465,14.4961],[100.45572,14.49564],[100.45676,14.49513],[100.45777,14.49458],[100.45873,14.49401],[100.45965,14.49345],[100.46052,14.49292],[100.46133,14.49243],[100.46208,14.49202],[100.4628,14.49169],[100.46355,14.49144],[100.46441,14.49124],[100.46546,14.49109],[100.46677,14.49097],[100.46841,14.49087],[100.47045,14.49078],[100.47282,14.49069],[100.47541,14.4906],[100.47807,14.49051],[100.48069,14.49042],[100.48314,14.49033],[100.48528,14.49024],[100.48706,14.49014],[100.48859,14.49],[100.49003,14.48979],[100.49152,14.48948],[100.49319,14.48905],[100.49518,14.48846],[100.49763,14.4877],[100.5005,14.48677],[100.50363,14.48575],[100.50686,14.4847],[100.51003,14.48368],[100.51298,14.48276],[100.51556,14.48199],[100.51766,14.48142],[100.51932,14.48105],[100.52064,14.48083],[100.5217,14.48076],[100.52258,14.4808],[100.52337,14.48093],[100.52414,14.48114],[100.52492,14.48139],[100.52571,14.48165],[100.52647,14.4819],[100.5272,14.4821],[100.52787,14.48223],[100.52846,14.48226],[100.52897,14.48215],[100.52943,14.48184],[100.52988,14.48126],[100.53037,14.48034],[100.53094,14.479],[100.53164,14.47718],[100.5325,14.47481],[100.53353,14.47192],[100.53468,14.46865],[100.53589,14.46515],[100.53711,14.46155],[100.53829,14.45802],[100.53937,14.45469],[100.54031,14.45169],[100.54113,14.44901],[100.54187,14.44663],[1Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"route_id":"dream-ayutthaya-redline"},"geometry":{"type":"LineString","coordinates":[[100.45154,14.59393],[100.45284,14.59075],[100.45381,14.58853],[100.45445,14.58704],[100.45476,14.58605],[100.45478,14.58536],[100.45458,14.58485],[100.45425,14.58443],[100.45389,14.58403],[100.45359,14.58357],[100.45335,14.58301],[100.45318,14.58235],[100.45308,14.58157],[100.45304,14.58066],[100.45307,14.57966],[100.45314,14.5786],[100.45325,14.57754],[100.45341,14.57651],[100.45357,14.57549],[100.45373,14.57448],[100.45385,14.57344],[100.4539,14.57234],[100.45386,14.57121],[100.4537,14.57006],[100.4534,14.56892],[100.45293,14.56781],[100.45234,14.5667],[100.4517,14.56554],[100.45109,14.56427],[100.45058,14.56286],[100.45019,14.56133],[100.4499,14.55977],[100.4497,14.55825],[100.44957,14.55685],[100.4495,14.55555],[100.44949,14.55426],[100.44952,14.55289],[100.4496,14.55135],[100.44971,14.54968],[100.44988,14.54799],[100.45012,14.54638],[100.45043,14.54498],[100.45082,14.54379],[100.45127,14.54276],[100.45176,14.54181],[100.45228,14.54089],[100.45281,14.53996],[100.45338,14.53898],[100.45399,14.53795],[100.45464,14.53683],[100.45537,14.53563],[100.4562,14.53436],[100.45718,14.53303],[100.45836,14.53165],[100.45968,14.53025],[100.46106,14.52889],[100.46235,14.52761],[100.46345,14.52647],[100.4643,14.52547],[100.46492,14.52452],[100.46537,14.52353],[100.46566,14.52243],[100.46585,14.52114],[100.46593,14.51969],[100.46592,14.51808],[100.46583,14.51631],[100.46567,14.51442],[100.46543,14.5125],[100.4651,14.51063],[100.46468,14.50889],[100.46416,14.50735],[100.46353,14.50594],[100.46281,14.50463],[100.46198,14.50335],[100.46106,14.5021],[100.46012,14.50094],[100.4592,14.49991],[100.45838,14.49911],[100.45767,14.49856],[100.45698,14.49823],[100.4562,14.49808],[100.45522,14.49807],[100.45398,14.49815],[100.45256,14.49829],[100.45108,14.49844],[100.44963,14.49856],[100.44833,14.49862],[100.44723,14.4986],[100.44639,14.49847],[100.44587,14.49822],[100.44572,14.49784],[100.44593,14.49741],[100.44648,14.49699],[100.44738,14.49668],[100.44857,14.49652],[100.44993,14.49648],[100.45129,14.49651],[100.45249,14.49653],[100.45339,14.4965],[100.45404,14.49641],[100.45455,14.49625],[100.455,14.49603],[100.45547,14.49573],[100.4559,14.49536],[100.45616,14.4949],[100.45614,14.49434],[100.45574,14.49367],[100.45507,14.49289],[100.45429,14.49199],[100.4536,14.49098],[100.45314,14.48987],[100.45295,14.48871],[100.45296,14.48757],[100.45313,14.48652],[100.45342,14.48562],[100.4538,14.48481],[100.45429,14.48396],[100.45491,14.48295],[100.45566,14.48165],[100.45656,14.48007],[100.4576,14.47827],[100.4588,14.47632],[100.46017,14.47427],[100.46165,14.47214],[100.46316,14.46989],[100.4646,14.46751],[100.46591,14.46495],[100.46709,14.46227],[100.46819,14.45952],[100.46929,14.4568],[100.47045,14.45417],[100.47167,14.45167],[100.47292,14.44929],[100.47413,14.44702],[100.47526,14.44485],[100.47633,14.44281],[100.4774,14.44093],[100.47853,14.43927],[100.47978,14.43786],[100.48115,14.43669],[100.48256,14.43568],[100.48391,14.43476],[100.48513,14.43384],[100.48627,14.43285],[100.48752,14.43169],[100.48912,14.4303],[100.49127,14.42859],[100.49396,14.42659],[100.49688,14.42444],[100.49972,14.42233],[100.50213,14.42042],[100.50399,14.41877],[100.50543,14.4173],[100.50663,14.41592],[100.50775,14.41451],[100.5089,14.41306],[100.51006,14.41165],[100.51122,14.41039],[100.51235,14.40938],[100.51345,14.40866],[100.51458,14.40816],[100.51578,14.40778],[100.51712,14.40743],[100.51859,14.40705],[100.52013,14.40662],[100.52164,14.40613],[100.52304,14.40557],[100.52426,14.40494],[100.52532,14.40425],[100.52623,14.40353],[100.527,14.40278],[100.52766,14.40203],[100.52826,14.40126],[100.52885,14.40049],[100.52947,14.39971],[100.53017,14.39891],[100.53092,14.39805],[100.53168,14.39706],[100.53244,14.39591],[100.53316,14.39455],[100.53382,14.39305],[100.53443,14.3915],[100.53497,14.38998],[100.53544,14.38856],[100.53589,14.38721],[100.53636,14.38589],[100.53691,14.38455],[100.53759,14.38316],[100.53841,14.38176],[100.53938,14.3804],[100.54049,14.37914],[100.54175,14.37803],[100.54311,14.37704],[100.5445,14.37613],[100.54588,14.37523],[100.54717,14.37432],[100.54836,14.3734],[100.54942,14.37248],[100.55035,14.3716],[100.55114,14.37076],[100.55178,14.36994],[100.55228,14.36909],[100.55267,14.36816],[100.55296,14.36711],[100.55316,14.36597],[100.55329,14.36479],[100.55337,14.36364],[100.55341,14.36258],[100.55346,14.36165],[100.55355,14.36088],[100.55371,14.36029],[100.55397,14.35993],[100.55433,14.35976],[100.55476,14.35975],[100.55522,14.35984],[100.55569,14.35999],[100.55616,14.36017],[100.55663,14.36034],[100.55712,14.36049],[100.55764,14.36059],[100.55819,14.36062],[100.55876,14.36061],[100.55934,14.36055],[100.55992,14.36045],[100.5605,14.36034],[100.56106,14.36023],[100.56159,14.36012],[100.56207,14.36005],[100.56252,14.36001],[100.56294,14.36001],[100.56338,14.36005],[100.56384,14.36013],[100.56433,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"route_id":"dream-banchang"},"geometry":{"type":"LineString","coordinates":[[100.45183,14.5947],[100.45203,14.59406],[100.45236,14.59319],[100.45279,14.59214],[100.45328,14.59101],[100.45379,14.58985],[100.45428,14.58874],[100.45472,14.58777],[100.45506,14.58698],[100.45531,14.58639],[100.45547,14.58598],[100.45555,14.5857],[100.45557,14.58552],[100.45552,14.58541],[100.45544,14.58535],[100.45531,14.58528],[100.45517,14.58521],[100.455,14.58511],[100.45482,14.58501],[100.45463,14.58489],[100.45444,14.58476],[100.45426,14.58463],[100.45408,14.58449],[100.45393,14.58434],[100.45378,14.5842],[100.45366,14.58404],[100.45355,14.58388],[100.45345,14.5837],[100.45337,14.58352],[100.45331,14.58333],[100.45326,14.58312],[100.45322,14.58289],[100.45319,14.58265],[100.45318,14.58238],[100.45317,14.58208],[100.45317,14.58175],[100.45318,14.58138],[100.45319,14.58096],[100.4532,14.58051],[100.45321,14.58],[100.45323,14.57946],[100.45326,14.57887],[100.4533,14.57823],[100.45334,14.57755],[100.4534,14.57683],[100.45346,14.57607],[100.45354,14.57527],[100.45361,14.57446],[100.45367,14.57366],[100.45372,14.57287],[100.45375,14.57211],[100.45375,14.5714],[100.45372,14.57075],[100.45365,14.57017],[100.45356,14.56965],[100.45344,14.56919],[100.4533,14.56877],[100.45315,14.56839],[100.45298,14.56805],[100.45281,14.56774],[100.45263,14.56745],[100.45244,14.56717],[100.45224,14.56687],[100.45202,14.56654],[100.45179,14.56616],[100.45153,14.56572],[100.45125,14.5652],[100.45094,14.56459],[100.45061,14.56388],[100.45029,14.56308],[100.44998,14.5622],[100.4497,14.56124],[100.44947,14.56021],[100.4493,14.55911],[100.44921,14.55796],[100.4492,14.55675],[100.44927,14.55549],[100.44941,14.55419],[100.4496,14.55284],[100.44985,14.55145],[100.45015,14.55002],[100.45048,14.54856],[100.45084,14.54707],[100.45126,14.54556],[100.45173,14.54404],[100.45229,14.54252],[100.45293,14.541],[100.45368,14.53949],[100.45455,14.538],[100.45555,14.53653],[100.45665,14.5351],[100.45781,14.53371],[100.45898,14.53237],[100.46013,14.53107],[100.46122,14.52982],[100.46219,14.52863],[100.46302,14.52751],[100.46368,14.52644],[100.4642,14.5254],[100.4646,14.52437],[100.46489,14.52332],[100.4651,14.52224],[100.46524,14.5211],[100.46534,14.51987],[100.4654,14.51856],[100.46543,14.51717],[100.46542,14.51575],[100.46536,14.51431],[100.46525,14.5129],[100.46508,14.51154],[100.46485,14.51025],[100.46454,14.50907],[100.46417,14.50799],[100.46374,14.50699],[100.46325,14.50606],[100.46272,14.50517],[100.46215,14.50431],[100.46155,14.50346],[100.46093,14.50259],[100.46028,14.50173],[100.4596,14.50088],[100.45887,14.50008],[100.4581,14.49937],[100.45727,14.49876],[100.45637,14.49829],[100.45539,14.49799],[100.45435,14.49787],[100.45325,14.4979],[100.45215,14.49804],[100.45107,14.49825],[100.45004,14.4985],[100.44911,14.49875],[100.44831,14.49896],[100.44765,14.4991],[100.44716,14.49915],[100.44679,14.49913],[100.44653,14.49905],[100.44635,14.49891],[100.44624,14.49872],[100.44618,14.4985],[100.44614,14.49824],[100.44612,14.49797],[100.4461,14.49769],[100.44612,14.49742],[100.44615,14.49718],[100.44621,14.49698],[100.44631,14.49683],[100.44644,14.49675],[100.44662,14.49675],[100.44685,14.4968],[100.44713,14.4969],[100.44747,14.49701],[100.44788,14.49711],[100.44838,14.49719],[100.44895,14.49723],[100.44961,14.49719],[100.45036,14.49709],[100.45117,14.49692],[100.45204,14.49669],[100.45293,14.4964],[100.45385,14.49607],[100.45478,14.49569],[100.45569,14.49527],[100.45661,14.49482],[100.45757,14.49435],[100.45864,14.49388],[100.45987,14.49341],[100.4613,14.49295],[100.46299,14.49253],[100.465,14.49214],[100.46736,14.49179],[100.47006,14.49147],[100.47308,14.49112],[100.4764,14.49074],[100.47999,14.49027],[100.48383,14.48969],[100.4879,14.48897],[100.49218,14.48808],[100.49657,14.48705],[100.50099,14.48593],[100.50533,14.4848],[100.50948,14.48371],[100.51333,14.48273],[100.51679,14.48192],[100.51974,14.48134],[100.52215,14.48102],[100.52409,14.48092],[100.52563,14.48099],[100.52685,14.4812],[100.52783,14.4815],[100.52866,14.48185],[100.52939,14.48221],[100.53011,14.48254],[100.53083,14.48283],[100.53154,14.48308],[100.53226,14.48329],[100.53299,14.48345],[100.53372,14.48356],[100.53445,14.48362],[100.53521,14.48362],[100.53596,14.48357],[100.53672,14.48347],[100.53747,14.48333],[100.53819,14.48316],[100.53889,14.48296],[100.53956,14.48273],[100.54017,14.48249],[100.54074,14.48223],[100.54128,14.48194],[100.54178,14.48161],[100.54227,14.48121],[100.54276,14.48074],[100.54325,14.48017],[100.54376,14.4795],[100.54429,14.47871],[100.54485,14.47782],[100.54541,14.47684],[100.54599,14.47581],[100.54656,14.47475],[100.54713,14.47367],[100.54767,14.47261],[100.5482,14.47157],[100.54871,14.47059],[100.54921,14.46967],[100.54974,14.46883],[100.55029,14.46808],[100.5509,14.46743],[100.55157,14.46691],[100.55232,14.46651],[100.55317,14.46625],[100.5541,14.46609],[100.5551,14.466],[100.55616,14.46595],[100.55728,14.4Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"route_id":"dream-muangthong"},"geometry":{"type":"LineString","coordinates":[[100.45127,14.59401],[100.44858,14.59299],[100.4469,14.59218],[100.44609,14.59122],[100.4458,14.59017],[100.44556,14.58927],[100.44521,14.58856],[100.4448,14.58788],[100.44441,14.58716],[100.44414,14.5864],[100.44407,14.5856],[100.44424,14.58468],[100.44462,14.58363],[100.44503,14.58255],[100.44529,14.58153],[100.44551,14.58051],[100.44589,14.57938],[100.44642,14.57806],[100.44693,14.57651],[100.44734,14.57482],[100.44767,14.5732],[100.44785,14.57171],[100.44759,14.57002],[100.44673,14.56793],[100.44553,14.56576],[100.44434,14.56383],[100.44342,14.56201],[100.44296,14.55996],[100.44298,14.55768],[100.44334,14.55538],[100.44379,14.55322],[100.44394,14.55133],[100.44363,14.54982],[100.4432,14.54875],[100.44296,14.5481],[100.44298,14.54749],[100.44327,14.54657],[100.44384,14.54529],[100.44463,14.54371],[100.44546,14.54202],[100.44606,14.54045],[100.44642,14.53898],[100.44675,14.53732],[100.44716,14.53537],[100.44751,14.53333],[100.44769,14.5314],[100.44778,14.52977],[100.4479,14.52854],[100.44848,14.52751],[100.44995,14.52641],[100.45211,14.52527],[100.45441,14.52432],[100.45642,14.52362],[100.45788,14.52305],[100.45866,14.52243],[100.45889,14.52146],[100.45871,14.51994],[100.45811,14.518],[100.45716,14.51585],[100.45613,14.51399],[100.45536,14.51291],[100.45487,14.51219],[100.45455,14.51096],[100.45423,14.50915],[100.4537,14.5074],[100.45283,14.50608],[100.4516,14.50504],[100.4501,14.50412],[100.44874,14.50329],[100.44788,14.5025],[100.44743,14.50165],[100.44723,14.50067],[100.44733,14.49966],[100.44786,14.49885],[100.44857,14.49823],[100.44893,14.49762],[100.44865,14.497],[100.44782,14.49656],[100.44669,14.49637],[100.44575,14.49611],[100.4454,14.49552],[100.44529,14.49483],[100.44497,14.49436],[100.44438,14.49413],[100.44365,14.494],[100.44293,14.49385],[100.44236,14.49354],[100.44201,14.49285],[100.44177,14.49152],[100.44166,14.48949],[100.44195,14.48717],[100.44295,14.4849],[100.4449,14.4825],[100.4479,14.4797],[100.45113,14.47665],[100.45346,14.47369],[100.4547,14.47084],[100.45541,14.46791],[100.45591,14.46501],[100.45626,14.46265],[100.4565,14.46114],[100.45666,14.4602],[100.45676,14.45947],[100.45682,14.45849],[100.45682,14.45683],[100.45662,14.45465],[100.456,14.45234],[100.45481,14.45025],[100.45289,14.44877],[100.45048,14.44794],[100.4482,14.44748],[100.44648,14.44716],[100.44522,14.44691],[100.4443,14.44662],[100.44353,14.44608],[100.44275,14.44513],[100.44196,14.44381],[100.4412,14.44232],[100.44044,14.44074],[100.43959,14.43908],[100.43869,14.43745],[100.43791,14.436],[100.43735,14.43479],[100.43695,14.43362],[100.43667,14.43235],[100.43658,14.43094],[100.43676,14.42945],[100.43724,14.428],[100.43805,14.4268],[100.43901,14.42588],[100.43984,14.42523],[100.44044,14.42471],[100.44093,14.42407],[100.44132,14.42322],[100.44149,14.42225],[100.44134,14.42128],[100.44103,14.4204],[100.44072,14.41967],[100.44039,14.41908],[100.43995,14.4186],[100.43942,14.41819],[100.43887,14.41775],[100.43872,14.41705],[100.43975,14.41571],[100.4423,14.41352],[100.44601,14.41048],[100.45042,14.40679],[100.45488,14.40307],[100.45881,14.39989],[100.462,14.39712],[100.46439,14.39444],[100.46606,14.39176],[100.46716,14.38912],[100.4679,14.38663],[100.46851,14.38445],[100.46923,14.38251],[100.47027,14.3804],[100.47172,14.3779],[100.47323,14.37526],[100.47449,14.37282],[100.4757,14.3708],[100.47711,14.36935],[100.47869,14.36833],[100.4802,14.36746],[100.48152,14.36657],[100.48262,14.36556],[100.48353,14.36447],[100.48442,14.36352],[100.48534,14.36287],[100.48611,14.36248],[100.48659,14.36229],[100.48691,14.36226],[100.48728,14.36235],[100.4878,14.36249],[100.48853,14.36262],[100.48947,14.3627],[100.49056,14.36268],[100.49191,14.36261],[100.49391,14.36262],[100.49659,14.36279],[100.4992,14.36301],[100.50112,14.3632],[100.50256,14.36333],[100.50391,14.36341],[100.50509,14.36344],[100.5059,14.36346],[100.50668,14.36343],[100.50817,14.36333],[100.51042,14.36317],[100.51265,14.36305],[100.51435,14.363],[100.51578,14.36299],[100.51717,14.36303],[100.51827,14.36331],[100.51883,14.36399],[100.51925,14.36482],[100.52014,14.36542],[100.52153,14.36574],[100.52306,14.36602],[100.52456,14.36631],[100.52606,14.36648],[100.52749,14.36646],[100.52855,14.36629],[100.52902,14.36599],[100.5291,14.36538],[100.52906,14.36423],[100.52904,14.36218],[100.52915,14.35885],[100.52937,14.35466],[100.52963,14.35051],[100.52991,14.34686],[100.53027,14.34372],[100.53069,14.34097],[100.53102,14.33823],[100.53115,14.33529],[100.53107,14.33245],[100.53083,14.33002],[100.53056,14.32768],[100.53039,14.32492],[100.53027,14.32168],[100.53001,14.31812],[100.52953,14.31444],[100.52882,14.31084],[100.52795,14.30743],[100.52712,14.30418],[100.52651,14.30102],[100.52622,14.29783],[100.52632,14.29452],[100.52683,14.29118],[100.52772,14.28796],[100.52877,14.28506],[100.52965,14.28265],[100.53025,14.28025],[100.53066,14.2Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"route_id":"dream-pakkret"},"geometry":{"type":"LineString","coordinates":[[100.4519,14.59465],[100.45076,14.59403],[100.44969,14.59371],[100.44886,14.59351],[100.44823,14.5933],[100.44764,14.59292],[100.44702,14.59228],[100.44641,14.59131],[100.44584,14.59011],[100.44529,14.58908],[100.44478,14.58846],[100.44435,14.58806],[100.44402,14.58763],[100.44383,14.58701],[100.44381,14.58606],[100.44395,14.58493],[100.44421,14.58392],[100.44451,14.58305],[100.44475,14.58203],[100.44489,14.5807],[100.44504,14.57926],[100.44531,14.57791],[100.44567,14.57681],[100.44607,14.57607],[100.4465,14.57555],[100.44699,14.57499],[100.44752,14.57429],[100.44806,14.57344],[100.44853,14.57248],[100.44885,14.57142],[100.44893,14.5703],[100.44874,14.56916],[100.44825,14.56809],[100.44754,14.56714],[100.44672,14.56636],[100.44585,14.56566],[100.445,14.56486],[100.44422,14.56395],[100.44352,14.56311],[100.44291,14.5624],[100.44239,14.56171],[100.44197,14.56087],[100.44181,14.5598],[100.44206,14.55842],[100.44257,14.55676],[100.44303,14.5549],[100.44329,14.55307],[100.44337,14.55165],[100.44328,14.55074],[100.44304,14.54995],[100.44272,14.54904],[100.44241,14.54808],[100.44225,14.5472],[100.4423,14.54631],[100.44264,14.54526],[100.44331,14.54396],[100.44437,14.54243],[100.44563,14.54078],[100.44668,14.53924],[100.44727,14.5379],[100.44745,14.53651],[100.44734,14.53485],[100.44703,14.53305],[100.44665,14.53132],[100.44633,14.5298],[100.44619,14.52862],[100.44636,14.52778],[100.44694,14.52719],[100.44793,14.52673],[100.44916,14.52632],[100.45051,14.52587],[100.45199,14.52541],[100.45362,14.52498],[100.4552,14.52452],[100.45651,14.52397],[100.45751,14.5233],[100.4583,14.52254],[100.45886,14.52163],[100.45903,14.52053],[100.45874,14.51926],[100.45816,14.51804],[100.45747,14.51707],[100.4566,14.51618],[100.4555,14.51515],[100.4544,14.51413],[100.45368,14.51342],[100.45342,14.51289],[100.45348,14.51206],[100.45365,14.51074],[100.45375,14.50919],[100.45357,14.50766],[100.45301,14.50637],[100.45198,14.50542],[100.45073,14.50467],[100.44957,14.50385],[100.44861,14.50293],[100.44779,14.50199],[100.44711,14.50109],[100.44665,14.50024],[100.44649,14.49948],[100.44672,14.49889],[100.44739,14.49852],[100.44822,14.49821],[100.44889,14.49781],[100.44922,14.49733],[100.4491,14.49688],[100.44858,14.49653],[100.44781,14.4963],[100.44696,14.49617],[100.44618,14.49609],[100.44555,14.49597],[100.44497,14.49567],[100.44435,14.49508],[100.44363,14.49443],[100.44284,14.494],[100.44208,14.49368],[100.4415,14.49306],[100.44116,14.49209],[100.44097,14.49109],[100.44088,14.49021],[100.44089,14.48932],[100.44099,14.48827],[100.44112,14.48722],[100.44121,14.48633],[100.44137,14.48558],[100.44179,14.48484],[100.44247,14.48411],[100.4432,14.48356],[100.4441,14.48294],[100.4458,14.48148],[100.44856,14.47876],[100.45151,14.47559],[100.45377,14.47284],[100.45534,14.47033],[100.45656,14.4676],[100.45748,14.46474],[100.458,14.46217],[100.45815,14.45997],[100.45807,14.45787],[100.45775,14.45562],[100.45689,14.45317],[100.45523,14.4506],[100.45292,14.44839],[100.4502,14.447],[100.44733,14.44633],[100.44453,14.44595],[100.4421,14.44529],[100.44039,14.44368],[100.43943,14.44098],[100.43877,14.43789],[100.43806,14.435],[100.43743,14.43237],[100.43707,14.42997],[100.43716,14.42785],[100.43789,14.42604],[100.43899,14.42445],[100.43997,14.42288],[100.44049,14.42122],[100.44042,14.41955],[100.43983,14.41796],[100.43919,14.41663],[100.43903,14.41565],[100.44,14.41461],[100.44264,14.41305],[100.44623,14.41114],[100.44949,14.4093],[100.45201,14.40773],[100.4541,14.40636],[100.45612,14.40496],[100.45843,14.40306],[100.46118,14.40043],[100.46391,14.39771],[100.46609,14.39553],[100.4676,14.39373],[100.46843,14.39189],[100.46863,14.3897],[100.46827,14.38691],[100.46782,14.38359],[100.46823,14.38011],[100.46997,14.37676],[100.47248,14.37358],[100.47515,14.37062],[100.47766,14.36814],[100.47982,14.36641],[100.48181,14.36524],[100.48397,14.36427],[100.48644,14.36333],[100.48921,14.36249],[100.49228,14.3618],[100.49564,14.36132],[100.49925,14.36107],[100.50286,14.36104],[100.50623,14.36121],[100.50935,14.36159],[100.5123,14.3622],[100.51501,14.36296],[100.51732,14.36372],[100.51935,14.36448],[100.52144,14.36539],[100.5237,14.36643],[100.52564,14.36726],[100.52685,14.3675],[100.5275,14.36698],[100.52786,14.36558],[100.52807,14.36347],[100.52819,14.36092],[100.52829,14.35823],[100.5284,14.35577],[100.52857,14.35376],[100.52875,14.35224],[100.52892,14.35103],[100.52897,14.34948],[100.52883,14.3468],[100.52859,14.34201],[100.52836,14.33419],[100.52821,14.32416],[100.52812,14.31383],[100.52797,14.30447],[100.52747,14.29667],[100.52664,14.29056],[100.52605,14.28546],[100.52622,14.28069],[100.52715,14.2761],[100.52864,14.27158],[100.53031,14.26658],[100.53166,14.26042],[100.53272,14.25296],[100.53392,14.24458],[100.53558,14.236],[100.53775,14.2284],[100.54038,14.22254],[100.54313,14.21777],[100.54564,14.21318],[100.54791,14.20Line truncated
|
||||
@@ -8,7 +8,7 @@
|
||||
"route_group_id": 2,
|
||||
"province_ids": [1, 2, 3, 4],
|
||||
"phone": ["+6684 337 7376", "+6662 381 5828"],
|
||||
"web_url": "https://www.facebook.com/profile.php?id=100063523693753",
|
||||
"web_url": ["facebook","https://www.facebook.com/profile.php?id=100063523693753"],
|
||||
"station_ids": [1, 15, 6]
|
||||
},
|
||||
{
|
||||
@@ -19,7 +19,7 @@
|
||||
"route_group_id": 2,
|
||||
"province_ids": [1, 2, 3, 4],
|
||||
"phone": ["+6693 249 5788"],
|
||||
"web_url": "https://www.facebook.com/groups/1355821444815052",
|
||||
"web_url": ["line","https://line.me/ti/g2/tAJzKxqg-CLv1PJ06PRxlPohHAd3rMOWrVAgMA?utm_source=invitation&utm_medium=link_copy&utm_campaign=default"],
|
||||
"station_ids": [1, 2, 4, 5, 6]
|
||||
},
|
||||
{
|
||||
@@ -30,7 +30,7 @@
|
||||
"route_group_id": 2,
|
||||
"province_ids": [1, 5, 4],
|
||||
"phone": ["+6686 099 4250"],
|
||||
"web_url": "https://www.facebook.com/groups/1323166441639529",
|
||||
"web_url": ["facebook","https://www.facebook.com/groups/1323166441639529"],
|
||||
"station_ids": [9, 5, 6, 8 ]
|
||||
},
|
||||
{
|
||||
@@ -52,7 +52,7 @@
|
||||
"route_group_id": 2,
|
||||
"province_ids": [1, 2, 3, 4, 5],
|
||||
"phone": ["+6690 140 3636"],
|
||||
"web_url": "https://shorturl.asia/Qe0s3",
|
||||
"web_url": ["facebook","https://shorturl.asia/Qe0s3"],
|
||||
"station_ids": [ 5, 6, 8]
|
||||
},
|
||||
{
|
||||
@@ -63,7 +63,7 @@
|
||||
"route_group_id": 2,
|
||||
"province_ids": [1, 2, 3, 4, 8, 9],
|
||||
"phone": ["+6656-412264", "+6686-4491276", "+6688-2716613"],
|
||||
"web_url": "https://linevoom.line.me/user/_ddH8YAybarByo7eVApp-6f0teYGaM0bXI4CLBhE",
|
||||
"web_url": ["www","https://www.chainattour.com/th-th/timetables"],
|
||||
"station_ids": [5, 6, 8, 13]
|
||||
},
|
||||
{
|
||||
@@ -74,7 +74,7 @@
|
||||
"route_group_id": 3,
|
||||
"province_ids": [1, 2],
|
||||
"phone": ["+6664 963 9025"],
|
||||
"web_url": null,
|
||||
"web_url": ["line","https://line.me/ti/g2/u1QdJvWSUV20awFiXVw70AgGIwxXTHuq2W1Vfg?utm_source=invitation&utm_medium=link_copy&utm_campaign=default"],
|
||||
"station_ids": [1, 2, 3]
|
||||
},
|
||||
{
|
||||
@@ -85,7 +85,7 @@
|
||||
"route_group_id": 3,
|
||||
"province_ids": [1, 2, 5, 6],
|
||||
"phone": ["+6699 039 3343", "+6692 482 4781"],
|
||||
"web_url": "https://line.me/ti/g2/tXBwCvja_Ign9PlboFugqx_NJWbxVb31J1TSMQ",
|
||||
"web_url": ["line","https://line.me/ti/g2/tXBwCvja_Ign9PlboFugqx_NJWbxVb31J1TSMQ"],
|
||||
"station_ids": [1, 9, 10]
|
||||
},
|
||||
{
|
||||
@@ -123,7 +123,7 @@
|
||||
},
|
||||
{
|
||||
"route_id": "1011",
|
||||
"route_name_th": "อ่างทอง-สีบัวทอง",
|
||||
"route_name_th": "อ่างทอง-แสวงหา-สีบัวทอง",
|
||||
"vehicle_type": "bus",
|
||||
"route_group": "in_province",
|
||||
"route_group_id": 4,
|
||||
|
||||
@@ -312,17 +312,17 @@
|
||||
if (t - lastSnapAt > 1200) { lastSnapAt = t; snap(); }
|
||||
}
|
||||
|
||||
/* ตรวจจับว่าทิศนี้เป็นตารางของวันไหน (อ่านจาก dir_label + dir_note/note ของทุกจุด)
|
||||
/* ตรวจจับว่าทิศนี้เป็นตารางของวันไหน (อ่านจาก direction_label + direction_note/note ของทุกจุด)
|
||||
- เจอคำฝ่ายเดียว → เสนอตั้ง service ให้ (ไม่ตั้งเอง)
|
||||
- เจอทั้งฝ่ายวันทำงานและวันหยุดในทิศเดียว → เตือนว่าควรแยกเป็นคนละทิศ */
|
||||
var HOLIDAY_WORDS = ['วันหยุด', 'นักขัตฤกษ์', 'เสาร์อาทิตย์', 'เสาร์-อาทิตย์', 'ส-อา', 'ส–อา', 'weekend', 'holiday'];
|
||||
var WEEKDAY_WORDS = ['วันทำงาน', 'จ-ศ', 'จ–ศ', 'จันทร์ถึงศุกร์', 'weekday', 'workday'];
|
||||
function scanWords(d) {
|
||||
var texts = [];
|
||||
if (d.dir_label) texts.push(String(d.dir_label));
|
||||
if (d.direction_label) texts.push(String(d.direction_label));
|
||||
(d.stops || []).forEach(function (s) {
|
||||
if (s.note) texts.push(String(s.note));
|
||||
if (s.dir_note) texts.push(String(s.dir_note));
|
||||
if (s.direction_note) texts.push(String(s.direction_note));
|
||||
});
|
||||
var joined = texts.join(' | ');
|
||||
var low = joined.toLowerCase();
|
||||
@@ -423,7 +423,7 @@
|
||||
var max = known.reduce(function (a, b) { return b.k > a ? b.k : a; }, known[0].k);
|
||||
rel = abs.map(function (k) { return typeof k === 'number' ? (forward ? k : (max - k)) : null; });
|
||||
}
|
||||
return { dir_id: d.dir_id, dir_label: d.dir_label, baseEnd: d.baseEnd, travelMin: d.travelMin, speedKmh: d.speedKmh,
|
||||
return { direction_id: d.direction_id, direction_label: d.direction_label, baseEnd: d.baseEnd, travelMin: d.travelMin, speedKmh: d.speedKmh,
|
||||
autoTimes: d.autoTimes, service: d.service,
|
||||
stops: (d.stops || []).map(function (s, i) {
|
||||
var c = {}; for (var k in s) c[k] = s[k];
|
||||
@@ -646,12 +646,12 @@
|
||||
var rows = [[stationName2(d.stops && d.stops[0] ? d.stops[0].station_id : '') === '—' ? '' : '']];
|
||||
var header = ['station_id', 'station_name'];
|
||||
for (var i = 1; i <= n; i++) header.push('t' + i);
|
||||
header.push('dir_note', 'note');
|
||||
header.push('direction_note', 'note');
|
||||
var out = [header.join(',')];
|
||||
(d.stops || []).forEach(function (s) {
|
||||
var row = [s.station_id, csvCell(stationName2(s.station_id, rid))];
|
||||
for (var i = 0; i < n; i++) row.push(csvCell((s.times || [])[i] || ''));
|
||||
row.push(csvCell(s.dir_note || ''));
|
||||
row.push(csvCell(s.direction_note || ''));
|
||||
row.push(csvCell(s.note || ''));
|
||||
out.push(row.join(','));
|
||||
});
|
||||
@@ -681,7 +681,7 @@
|
||||
var rows = parseCSV(text);
|
||||
if (rows.length < 2) return null;
|
||||
var head = rows[0].map(function (h) { return String(h).trim().toLowerCase(); });
|
||||
var iSid = head.indexOf('station_id'), iNote = head.indexOf('note'), iDir = head.indexOf('dir_note');
|
||||
var iSid = head.indexOf('station_id'), iNote = head.indexOf('note'), iDir = head.indexOf('direction_note');
|
||||
var timeCols = [];
|
||||
head.forEach(function (h, i) { if (/^t\d+$/.test(h)) timeCols.push(i); });
|
||||
if (iSid < 0 || !timeCols.length) return null;
|
||||
@@ -693,7 +693,7 @@
|
||||
var times = timeCols.map(function (i) { return String(row[i] || '').trim(); })
|
||||
.filter(function (x) { return /^\d{1,2}:\d{2}$/.test(x); });
|
||||
stops.push({ station_id: sid, times: times,
|
||||
dir_note: (iDir >= 0 ? (String(row[iDir] || '').trim() || null) : null),
|
||||
direction_note: (iDir >= 0 ? (String(row[iDir] || '').trim() || null) : null),
|
||||
note: (iNote >= 0 ? (String(row[iNote] || '').trim() || null) : null) });
|
||||
}
|
||||
return stops.length ? stops : null;
|
||||
@@ -705,7 +705,7 @@
|
||||
var n = tableMaxCols(d);
|
||||
var head = '<tr><th class="rh">จุดจอด (station_id)</th><th class="rh">กม.</th><th class="rh">ที่มา</th>';
|
||||
for (var c = 1; c <= n; c++) head += '<th class="ch">t' + c + '<button class="mini x" data-act="col-del" data-di="' + di + '" data-col="' + c + '" title="ลบคอลัมน์นี้">×</button></th>';
|
||||
head += '<th class="rh">dir_note</th><th class="rh">note</th><th class="rh">จัดการ</th></tr>';
|
||||
head += '<th class="rh">direction_note</th><th class="rh">note</th><th class="rh">จัดการ</th></tr>';
|
||||
var body = (d.stops || []).map(function (s, si) {
|
||||
var km = (ann.stops[si] || {}).km;
|
||||
var src = (s.times || []).filter(Boolean).length ? 'ตารางจริง' : (d.autoTimes ? 'คำนวณอัตโนมัติ' : 'ว่าง');
|
||||
@@ -719,7 +719,7 @@
|
||||
'<td class="rh"><select data-act="cell-sid" data-di="' + di + '" data-si="' + si + '">' + stationOptions(s.station_id, routeObj(S.routeId)) + '</select></td>' +
|
||||
'<td class="mono ck">' + (typeof km === 'number' ? km : '—') + '</td>' +
|
||||
'<td class="src">' + src + '</td>' + tds +
|
||||
'<td><input data-act="cell-dirnote" data-di="' + di + '" data-si="' + si + '" value="' + esc(s.dir_note || '') + '"></td>' +
|
||||
'<td><input data-act="cell-dirnote" data-di="' + di + '" data-si="' + si + '" value="' + esc(s.direction_note || '') + '"></td>' +
|
||||
'<td><input data-act="cell-note" data-di="' + di + '" data-si="' + si + '" value="' + esc(s.note || '') + '"></td>' +
|
||||
'<td class="ops"><button class="mini" data-act="row-up" data-di="' + di + '" data-si="' + si + '">↑</button>' +
|
||||
'<button class="mini" data-act="row-dn" data-di="' + di + '" data-si="' + si + '">↓</button>' +
|
||||
@@ -743,8 +743,8 @@
|
||||
if (!r) return '<p class="empty">เลือกสายจากด้านซ้าย</p>';
|
||||
return (r.directions || []).map(function (d, di) {
|
||||
return '<section class="tbl-sec">' +
|
||||
'<div class="tbl-head"><strong>ทิศ ' + esc(d.dir_id || ('#' + (di + 1))) + '</strong>' +
|
||||
(d.dir_label ? '<span class="f">' + esc(d.dir_label) + '</span>' : '') +
|
||||
'<div class="tbl-head"><strong>ทิศ ' + esc(d.direction_id || ('#' + (di + 1))) + '</strong>' +
|
||||
(d.direction_label ? '<span class="f">' + esc(d.direction_label) + '</span>' : '') +
|
||||
'<span class="f">' + (d.stops || []).length + ' จุด · ' + trips(d) + ' เที่ยว</span>' +
|
||||
'<span class="f">ใช้กับวัน: ' + esc(d.service || 'ทุกวัน') + '</span>' +
|
||||
(d.autoTimes ? '<span class="chip on">คำนวณอัตโนมัติ</span>' : '') +
|
||||
@@ -998,7 +998,7 @@
|
||||
'<td>' + chips + '</td><td class="f">' + esc(r.note) + '</td></tr>';
|
||||
}).join('');
|
||||
return '<div class="modal" data-act="calc-close"><div class="modal-box" data-stop="1">' +
|
||||
'<div class="modal-head"><strong>ตารางที่คำนวณได้ — สาย ' + esc(S.routeId) + ' · ทิศ ' + esc(d.dir_id || '-') + '</strong>' +
|
||||
'<div class="modal-head"><strong>ตารางที่คำนวณได้ — สาย ' + esc(S.routeId) + ' · ทิศ ' + esc(d.direction_id || '-') + '</strong>' +
|
||||
'<button class="mini" data-act="calc-close">ปิด</button></div>' +
|
||||
'<p class="msg">ใช้เวลาจริงจาก <b>' + esc(stationName(res.base.station_id)) + '</b> (' + res.base.times.length + ' เที่ยว) · ' +
|
||||
'เวลาเดินทาง ' + esc(hm(Number(res.travelMin) || 0)) + ' · ความเร็วที่ได้ ≈ ' + (Math.round(res.kmh * 10) / 10) + ' กม./ชม.' +
|
||||
@@ -1057,7 +1057,7 @@
|
||||
|
||||
function dirHeadLetter(di) { return String.fromCharCode(65 + di); }
|
||||
function colTitle(d) {
|
||||
return (d.dir_label && String(d.dir_label).trim()) ? String(d.dir_label).trim() : (d.dir_id || ('ทิศ ' + dirHeadLetter(d.directions_index || 0)));
|
||||
return (d.direction_label && String(d.direction_label).trim()) ? String(d.direction_label).trim() : (d.direction_id || ('ทิศ ' + dirHeadLetter(d.directions_index || 0)));
|
||||
}
|
||||
function timesToText(times) { return (times || []).join(' '); }
|
||||
|
||||
@@ -1075,7 +1075,7 @@
|
||||
var head = '<tr><th class="rh">จุดจอด (station_order)</th><th class="rh2">กม.</th>' +
|
||||
dirs.map(function (d, di) {
|
||||
return '<th class="ch"><div>' + esc(colTitle(d)) + '</div>' +
|
||||
'<div class="ch-sub">' + esc(d.dir_id || '') + ' · ' + trips(d) + ' เที่ยว' +
|
||||
'<div class="ch-sub">' + esc(d.direction_id || '') + ' · ' + trips(d) + ' เที่ยว' +
|
||||
(d.autoTimes ? ' · คำนวณอัตโนมัติ' : '') + (d.service && d.service !== 'all' ? ' · ' + esc(d.service) : '') + '</div></th>';
|
||||
}).join('') + '<th class="ch ops">จัดการ</th></tr>';
|
||||
|
||||
@@ -1121,8 +1121,8 @@
|
||||
var svc = (d.service || 'all').toLowerCase();
|
||||
return '<div class="dirtool" data-di="' + di + '">' +
|
||||
'<span class="dt-letter">' + dirHeadLetter(di) + '</span>' +
|
||||
'<input class="mono" style="width:120px" data-act="dir-label" data-di="' + di + '" value="' + esc(d.dir_label || '') + '" placeholder="ชื่อคอลัมน์">' +
|
||||
'<input class="mono" style="width:104px" data-act="dir-id" data-di="' + di + '" value="' + esc(d.dir_id || '') + '" placeholder="dir_id">' +
|
||||
'<input class="mono" style="width:120px" data-act="dir-label" data-di="' + di + '" value="' + esc(d.direction_label || '') + '" placeholder="ชื่อคอลัมน์">' +
|
||||
'<input class="mono" style="width:104px" data-act="dir-id" data-di="' + di + '" value="' + esc(d.direction_id || '') + '" placeholder="direction_id">' +
|
||||
'<select data-act="dir-service" data-di="' + di + '">' +
|
||||
'<option value="all"' + (svc === 'all' ? ' selected' : '') + '>ทุกวัน</option>' +
|
||||
'<option value="weekday"' + (svc === 'weekday' ? ' selected' : '') + '>วันทำงาน</option>' +
|
||||
@@ -1229,16 +1229,16 @@
|
||||
function directionHtml(r, d, di) {
|
||||
var t = trips(d);
|
||||
var svc = (d.service || 'all').toLowerCase();
|
||||
var guess = guessService(d); /* เดาจากคำใน dir_label/note ว่าตารางนี้สำหรับวันไหน */
|
||||
var guess = guessService(d); /* เดาจากคำใน direction_label/note ว่าตารางนี้สำหรับวันไหน */
|
||||
var counts = (d.stops || []).map(function (s) { return (s.times || []).length; });
|
||||
var uneven = counts.length > 1 && new Set(counts).size > 1;
|
||||
return '' +
|
||||
'<div class="dir" data-di="' + di + '">' +
|
||||
'<div class="dir-head">' +
|
||||
'<div class="f-id" style="width:150px"><label class="f">dir_id</label>' +
|
||||
'<input class="mono" data-act="dir-id" data-di="' + di + '" value="' + esc(d.dir_id || '') + '"></div>' +
|
||||
'<div class="grow"><label class="f">dir_label (ชื่อทิศที่แสดง เช่น ไปอยุธยา — เว้นว่างได้)</label>' +
|
||||
'<input data-act="dir-label" data-di="' + di + '" value="' + esc(d.dir_label || '') + '"></div>' +
|
||||
'<div class="f-id" style="width:150px"><label class="f">direction_id</label>' +
|
||||
'<input class="mono" data-act="dir-id" data-di="' + di + '" value="' + esc(d.direction_id || '') + '"></div>' +
|
||||
'<div class="grow"><label class="f">direction_label (ชื่อทิศที่แสดง เช่น ไปอยุธยา — เว้นว่างได้)</label>' +
|
||||
'<input data-act="dir-label" data-di="' + di + '" value="' + esc(d.direction_label || '') + '"></div>' +
|
||||
'<div class="f-svc"><label class="f">ใช้กับวัน (service)</label>' +
|
||||
'<select data-act="dir-service" data-di="' + di + '">' +
|
||||
'<option value="all"' + (svc === 'all' ? ' selected' : '') + '>ทุกวัน</option>' +
|
||||
@@ -1286,8 +1286,8 @@
|
||||
'<div class="stop-head">' +
|
||||
'<div class="f-id"><label class="f">จุดจอด (station_id)' + (typeof s.km === 'number' ? ' · กม. ' + s.km : ' · ยังไม่มี กม.') + '</label>' +
|
||||
'<select data-act="stop-sid" data-di="' + di + '" data-si="' + si + '">' + stationOptions(s.station_id, r) + '</select></div>' +
|
||||
'<div class="f-dir"><label class="f">dir_note (ทิศของจุดนี้ — เว้นว่างได้)</label>' +
|
||||
'<input data-act="stop-dirnote" data-di="' + di + '" data-si="' + si + '" value="' + esc(s.dir_note || '') + '"></div>' +
|
||||
'<div class="f-dir"><label class="f">direction_note (ทิศของจุดนี้ — เว้นว่างได้)</label>' +
|
||||
'<input data-act="stop-dirnote" data-di="' + di + '" data-si="' + si + '" value="' + esc(s.direction_note || '') + '"></div>' +
|
||||
'<div class="f-note"><label class="f">note (เงื่อนไข เช่น ไม่วิ่งวันหยุด)</label>' +
|
||||
'<input data-act="stop-note" data-di="' + di + '" data-si="' + si + '" value="' + esc(s.note || '') + '"></div>' +
|
||||
'<button class="mini" data-act="stop-up" data-di="' + di + '" data-si="' + si + '" title="เลื่อนขึ้น">↑</button>' +
|
||||
@@ -1337,24 +1337,24 @@
|
||||
}
|
||||
var seenStops = {};
|
||||
(r.directions || []).forEach(function (d, di) {
|
||||
if (!(d.stops || []).length) out.push({ lv: 'e', rid: rid, msg: 'ทิศ ' + (d.dir_id || di) + ': ไม่มีจุดจอด' });
|
||||
if (!(d.stops || []).length) out.push({ lv: 'e', rid: rid, msg: 'ทิศ ' + (d.direction_id || di) + ': ไม่มีจุดจอด' });
|
||||
var counts = {};
|
||||
(d.stops || []).forEach(function (s, si) {
|
||||
var key = d.dir_id + '#' + s.station_id;
|
||||
if (seenStops[key]) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.dir_id + ': จุด ' + s.station_id + ' (' + stationName(s.station_id) + ') ซ้ำในทิศเดียวกัน' });
|
||||
var key = d.direction_id + '#' + s.station_id;
|
||||
if (seenStops[key]) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.direction_id + ': จุด ' + s.station_id + ' (' + stationName(s.station_id) + ') ซ้ำในทิศเดียวกัน' });
|
||||
seenStops[key] = 1;
|
||||
var p = parseTimes(fmtList(s.times));
|
||||
if (p.bad.length) out.push({ lv: 'e', rid: rid, msg: 'ทิศ ' + d.dir_id + ' จุด ' + s.station_id + ': เวลาผิดรูปแบบ ' + p.bad.join(', ') });
|
||||
if (p.bad.length) out.push({ lv: 'e', rid: rid, msg: 'ทิศ ' + d.direction_id + ' จุด ' + s.station_id + ': เวลาผิดรูปแบบ ' + p.bad.join(', ') });
|
||||
var dup = {}, dd = [];
|
||||
p.ok.forEach(function (t) { if (dup[t] && dd.indexOf(t) === -1) dd.push(t); dup[t] = 1; });
|
||||
if (dd.length) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.dir_id + ' จุด ' + s.station_id + ': เวลาซ้ำ ' + dd.join(', ') });
|
||||
if (!p.ok.length) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.dir_id + ' จุด ' + s.station_id + ' (' + stationName(s.station_id) + '): ยังไม่มีเวลา (เว็บจะขึ้น "ยังไม่มีข้อมูล")' });
|
||||
if (dd.length) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.direction_id + ' จุด ' + s.station_id + ': เวลาซ้ำ ' + dd.join(', ') });
|
||||
if (!p.ok.length) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.direction_id + ' จุด ' + s.station_id + ' (' + stationName(s.station_id) + '): ยังไม่มีเวลา (เว็บจะขึ้น "ยังไม่มีข้อมูล")' });
|
||||
var inOrder = (r.station_order || []).indexOf(Number(s.station_id)) !== -1;
|
||||
if (!inOrder) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.dir_id + ' จุด ' + s.station_id + ': ไม่อยู่ใน station_order' });
|
||||
if (!inOrder) out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + d.direction_id + ' จุด ' + s.station_id + ': ไม่อยู่ใน station_order' });
|
||||
counts[(s.times || []).length] = 1;
|
||||
});
|
||||
if (Object.keys(counts).length > 1) {
|
||||
out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + (d.dir_label || d.dir_id) + ': จำนวนเที่ยวไม่เท่ากันข้ามจุด (' + (d.stops || []).map(function (x) { return x.station_id + '×' + (x.times || []).length; }).join(' · ') + ') — อาจยังแยกทิศไม่ครบ' });
|
||||
out.push({ lv: 'w', rid: rid, msg: 'ทิศ ' + (d.direction_label || d.direction_id) + ': จำนวนเที่ยวไม่เท่ากันข้ามจุด (' + (d.stops || []).map(function (x) { return x.station_id + '×' + (x.times || []).length; }).join(' · ') + ') — อาจยังแยกทิศไม่ครบ' });
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1443,7 +1443,7 @@
|
||||
var r = routeObj(S.routeId);
|
||||
var src = r.directions[+t.dataset.di];
|
||||
var copy = JSON.parse(JSON.stringify(src)); /* คัดลอกทั้งทิศ (จุดจอด + เวลา + หมายเหตุ) */
|
||||
copy.dir_id = (src.dir_id || 'dir') + '-copy';
|
||||
copy.direction_id = (src.direction_id || 'dir') + '-copy';
|
||||
delete copy.service; /* ให้ผู้ใช้เลือกวันเอง ไม่เดาให้ */
|
||||
r.directions.splice(+t.dataset.di + 1, 0, copy);
|
||||
toast('ทำสำเนาทิศแล้ว — อย่าลืมตั้ง "ใช้กับวัน" ของทั้งสองทิศ');
|
||||
@@ -1461,13 +1461,13 @@
|
||||
'dir-add': function () {
|
||||
var r = routeObj(S.routeId); snap();
|
||||
r.directions = r.directions || [];
|
||||
r.directions.push({ dir_id: 'new-' + (r.directions.length + 1), dir_label: null, stops: [] });
|
||||
r.directions.push({ direction_id: 'new-' + (r.directions.length + 1), direction_label: null, stops: [] });
|
||||
},
|
||||
'dir-del': function (t) { var r = routeObj(S.routeId); snap(); r.directions.splice(+t.dataset.di, 1); },
|
||||
'dir-up': function (t) { moveDir(+t.dataset.di, -1); },
|
||||
'dir-dn': function (t) { moveDir(+t.dataset.di, 1); },
|
||||
'dir-id': function (t) { var r = routeObj(S.routeId); r.directions[+t.dataset.di].dir_id = t.value; },
|
||||
'dir-label': function (t) { var r = routeObj(S.routeId); var v = t.value.trim(); r.directions[+t.dataset.di].dir_label = v || null; },
|
||||
'dir-id': function (t) { var r = routeObj(S.routeId); r.directions[+t.dataset.di].direction_id = t.value; },
|
||||
'dir-label': function (t) { var r = routeObj(S.routeId); var v = t.value.trim(); r.directions[+t.dataset.di].direction_label = v || null; },
|
||||
'stop-add': function (t) {
|
||||
var r = routeObj(S.routeId); snap();
|
||||
var d = r.directions[+t.dataset.di];
|
||||
@@ -1479,7 +1479,7 @@
|
||||
'stop-up': function (t) { moveStop(+t.dataset.di, +t.dataset.si, -1); },
|
||||
'stop-dn': function (t) { moveStop(+t.dataset.di, +t.dataset.si, 1); },
|
||||
'stop-sid': function (t) { var s = stop(t); s.station_id = Number(t.value); },
|
||||
'stop-dirnote': function (t) { var s = stop(t); var v = t.value.trim(); s.dir_note = v || null; },
|
||||
'stop-dirnote': function (t) { var s = stop(t); var v = t.value.trim(); s.direction_note = v || null; },
|
||||
'stop-note': function (t) { var s = stop(t); var v = t.value.trim(); s.note = v || null; },
|
||||
'stop-times': function (t, quiet) {
|
||||
var s = stop(t);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"schema": 3,
|
||||
"route_id": "101",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"route_name": "อ่างทอง-ป่าโมก-อยุธยา",
|
||||
"station_order": [
|
||||
1,
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "1011",
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
1,
|
||||
8
|
||||
8,
|
||||
1
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-1",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-1",
|
||||
"direction_label": "จากบขส.อ่างทอง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
@@ -17,13 +18,15 @@
|
||||
"12:00",
|
||||
"16:00",
|
||||
"17:00"
|
||||
]
|
||||
],
|
||||
"direction_note": "บขส.อ่างทอง → โพธิ์ทอง → แสวงหา → วัดสีบัวทอง"
|
||||
}
|
||||
]
|
||||
],
|
||||
"direction_note": "บขส.อ่างทอง → โพธิ์ทอง → แสวงหา → วัดสีบัวทอง"
|
||||
},
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": "จากวัดสีบัวทอง",
|
||||
"direction_id": "dir-1",
|
||||
"direction_label": "จากวัดสีบัวทอง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
@@ -32,9 +35,10 @@
|
||||
"06:30",
|
||||
"14:30"
|
||||
],
|
||||
"dir_note": "จากวัดสีบัวทอง"
|
||||
"direction_note": "วัดสีบัวทอง → แสวงหา → โพธิ์ทอง → บขส.อ่างทอง"
|
||||
}
|
||||
]
|
||||
],
|
||||
"direction_note": "วัดสีบัวทอง → แสวงหา → โพธิ์ทอง → บขส.อ่างทอง"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "15",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
1,
|
||||
@@ -11,8 +13,8 @@
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-1",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-1",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
@@ -26,8 +28,8 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "all",
|
||||
"dir_label": null,
|
||||
"direction_id": "all",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 2,
|
||||
@@ -60,8 +62,8 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "new-3",
|
||||
"dir_label": null,
|
||||
"direction_id": "new-3",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 5,
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "2194",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
4,
|
||||
8
|
||||
8,
|
||||
4
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": "จากวัดหัวเวียง",
|
||||
"direction_id": "dir-1",
|
||||
"direction_label": "ออกจากวัดหัวเวียง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
@@ -18,13 +20,13 @@
|
||||
"06:00",
|
||||
"07:00"
|
||||
],
|
||||
"dir_note": "จากวัดหัวเวียง"
|
||||
"direction_note": "ออกจากวัดหัวเวียง"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "from-4",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-4",
|
||||
"direction_label": "ออกจากตลาดเจ้าพรหม",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 4,
|
||||
@@ -32,7 +34,8 @@
|
||||
"16:00",
|
||||
"17:00",
|
||||
"18:00"
|
||||
]
|
||||
],
|
||||
"direction_note": "ออกจากตลาดเจ้าพรหม"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "2231",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
1,
|
||||
8
|
||||
8,
|
||||
1
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-1",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-1",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
@@ -20,15 +22,15 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": "จากวัดมหานาม",
|
||||
"direction_id": "dir-1",
|
||||
"direction_label": "จากวัดมหานาม",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
"times": [
|
||||
"08:00"
|
||||
],
|
||||
"dir_note": "จากวัดมหานาม"
|
||||
"direction_note": "จากวัดมหานาม"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "324",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
1,
|
||||
8
|
||||
8,
|
||||
1
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-1",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-1",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
@@ -20,15 +22,15 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": "จากวัดไชโยวรวิหาร",
|
||||
"direction_id": "dir-1",
|
||||
"direction_label": "จากวัดไชโยวรวิหาร",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
"times": [
|
||||
"08:00"
|
||||
],
|
||||
"dir_note": "จากวัดไชโยวรวิหาร"
|
||||
"direction_note": "จากวัดไชโยวรวิหาร"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "464",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
1,
|
||||
9,
|
||||
1,
|
||||
10
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "all",
|
||||
"dir_label": null,
|
||||
"direction_id": "all",
|
||||
"direction_label": "จากบขส.สุพรรณบุรี / บขส.สระบุรี",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 9,
|
||||
@@ -69,71 +71,35 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": "ไปสุพรรณบุรี",
|
||||
"direction_id": "dir-1",
|
||||
"direction_label": "ออกจากอ่างทอง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
"times": [
|
||||
"06:30",
|
||||
"07:10",
|
||||
"07:50",
|
||||
"08:40",
|
||||
"09:30",
|
||||
"10:10",
|
||||
"10:50",
|
||||
"11:30",
|
||||
"12:10",
|
||||
"12:50",
|
||||
"13:30",
|
||||
"14:10",
|
||||
"14:50",
|
||||
"15:30",
|
||||
"16:10",
|
||||
"16:50",
|
||||
"17:30",
|
||||
"18:10",
|
||||
"18:50",
|
||||
"19:30"
|
||||
],
|
||||
"dir_note": "ไปสุพรรณบุรี"
|
||||
"times": [],
|
||||
"direction_note": "ไปสุพรรณบุรี",
|
||||
"derive": {
|
||||
"from_station_id": 10,
|
||||
"offset_min": 90,
|
||||
"note": "ถึงอ่างทองหลังรถออกจาก บขส.สระบุรี 90 นาที"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "dir-2",
|
||||
"dir_label": "ไปสระบุรี",
|
||||
"direction_id": "dir-2",
|
||||
"direction_label": "ออกจากอ่างทอง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
"times": [
|
||||
"05:40",
|
||||
"06:10",
|
||||
"06:40",
|
||||
"07:10",
|
||||
"07:40",
|
||||
"08:10",
|
||||
"08:40",
|
||||
"09:15",
|
||||
"09:50",
|
||||
"10:25",
|
||||
"11:00",
|
||||
"11:35",
|
||||
"12:10",
|
||||
"12:45",
|
||||
"13:20",
|
||||
"13:55",
|
||||
"14:30",
|
||||
"15:05",
|
||||
"15:40",
|
||||
"16:15",
|
||||
"16:50",
|
||||
"17:25",
|
||||
"18:00",
|
||||
"18:40"
|
||||
],
|
||||
"dir_note": "ไปสระบุรี",
|
||||
"note": null
|
||||
"times": [],
|
||||
"direction_note": "ไปสระบุรี",
|
||||
"note": null,
|
||||
"derive": {
|
||||
"from_station_id": 9,
|
||||
"offset_min": 60,
|
||||
"note": "ถึงอ่างทองหลังรถออกจาก บขส.สุพรรณบุรี 60 นาที"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "641",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
1,
|
||||
7,
|
||||
8
|
||||
8,
|
||||
7
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-1",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-1",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
@@ -24,13 +26,14 @@
|
||||
"13:30",
|
||||
"14:30",
|
||||
"16:30"
|
||||
]
|
||||
],
|
||||
"note": "10:00 และ 13:30 ไม่ได้มีทุกวัน"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "all",
|
||||
"dir_label": null,
|
||||
"direction_id": "all",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 7,
|
||||
@@ -48,6 +51,38 @@
|
||||
"note": "10:00 และ 13:30 ไม่ได้มีทุกวัน"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"direction_id": "new-3",
|
||||
"direction_label": "7-11บ้านแพรกไปลพบุรี",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
"derive": {
|
||||
"from_station_id": 1,
|
||||
"offset_min": 25,
|
||||
"note": null
|
||||
},
|
||||
"times": []
|
||||
}
|
||||
],
|
||||
"autoTimes": true
|
||||
},
|
||||
{
|
||||
"direction_id": "new-3",
|
||||
"direction_label": "7-11บ้านแพรกไปอ่างทอง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
"derive": {
|
||||
"from_station_id": 7,
|
||||
"offset_min": 25,
|
||||
"note": "อ่างทอง"
|
||||
},
|
||||
"times": []
|
||||
}
|
||||
],
|
||||
"autoTimes": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "8",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
13,
|
||||
@@ -11,8 +13,8 @@
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "all",
|
||||
"dir_label": null,
|
||||
"direction_id": "all",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 13,
|
||||
@@ -25,8 +27,8 @@
|
||||
"speedKmh": 60
|
||||
},
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": null,
|
||||
"direction_id": "dir-1",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 6,
|
||||
@@ -34,14 +36,14 @@
|
||||
"10:00",
|
||||
"13:00"
|
||||
],
|
||||
"dir_note": null,
|
||||
"direction_note": null,
|
||||
"note": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "rungsit",
|
||||
"dir_label": "ตลาดแสวงหา",
|
||||
"direction_id": "rungsit",
|
||||
"direction_label": "ตลาดแสวงหา",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
@@ -55,8 +57,8 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "rungsit",
|
||||
"dir_label": "ตลาดสดเทศบาลตำบลโพธิ์ทอง",
|
||||
"direction_id": "rungsit",
|
||||
"direction_label": "ตลาดสดเทศบาลตำบลโพธิ์ทอง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
@@ -70,8 +72,8 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "rungsit",
|
||||
"dir_label": null,
|
||||
"direction_id": "rungsit",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 5,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "902",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
1,
|
||||
@@ -9,8 +11,8 @@
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-1",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-1",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 1,
|
||||
@@ -48,8 +50,8 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "rungsit",
|
||||
"dir_label": null,
|
||||
"direction_id": "rungsit",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 15,
|
||||
@@ -63,8 +65,8 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "all",
|
||||
"dir_label": null,
|
||||
"direction_id": "all",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 6,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "951",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
9,
|
||||
@@ -10,8 +12,8 @@
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-9",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-9",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 9,
|
||||
@@ -64,20 +66,20 @@
|
||||
{
|
||||
"station_id": 8,
|
||||
"times": [],
|
||||
"dir_note": "ตลาดวิเศษชัยชาญ",
|
||||
"direction_note": "ตลาดวิเศษชัยชาญ",
|
||||
"note": "ตลาดวิเศษชัยชาญ"
|
||||
},
|
||||
{
|
||||
"station_id": 8,
|
||||
"times": [],
|
||||
"dir_note": "ตลาดอ่างทอง",
|
||||
"direction_note": "ตลาดอ่างทอง",
|
||||
"note": "ตลาดอ่างทอง"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "new-2",
|
||||
"dir_label": null,
|
||||
"direction_id": "new-2",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 6,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "952",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
11,
|
||||
@@ -8,8 +10,8 @@
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": "จากตลาดวิเศษ",
|
||||
"direction_id": "dir-1",
|
||||
"direction_label": "จากตลาดวิเศษ",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 11,
|
||||
@@ -18,14 +20,14 @@
|
||||
"10:00",
|
||||
"15:00"
|
||||
],
|
||||
"dir_note": "จากตลาดวิเศษ",
|
||||
"direction_note": "จากตลาดวิเศษ",
|
||||
"note": "10:00 มีเฉพาะวันหยุด"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "all",
|
||||
"dir_label": null,
|
||||
"direction_id": "all",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 12,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "954",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
8,
|
||||
@@ -9,8 +11,8 @@
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "dir-1",
|
||||
"dir_label": "จากตลาดท่าช้าง",
|
||||
"direction_id": "to-bkk",
|
||||
"direction_label": "ไปกรุงเทพ (จตุจักร)",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 8,
|
||||
@@ -20,8 +22,18 @@
|
||||
"10:20",
|
||||
"12:40"
|
||||
],
|
||||
"dir_note": "จากตลาดท่าช้าง"
|
||||
"direction_note": "ตลาดท่าช้าง"
|
||||
},
|
||||
{
|
||||
"station_id": 6,
|
||||
"times": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"direction_id": "to-thachang",
|
||||
"direction_label": "ไปท่าช้าง",
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 6,
|
||||
"times": [
|
||||
@@ -29,37 +41,19 @@
|
||||
"09:00",
|
||||
"14:00",
|
||||
"16:00"
|
||||
],
|
||||
"dir_note": null
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "rungsit",
|
||||
"dir_label": null,
|
||||
"stops": [
|
||||
]
|
||||
},
|
||||
{
|
||||
"station_id": 5,
|
||||
"times": [],
|
||||
"derive": {
|
||||
"from_station_id": 6,
|
||||
"offset_min": 30,
|
||||
"note": ""
|
||||
},
|
||||
"times": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"dir_id": "rungsit",
|
||||
"dir_label": "ตลาดสามโก้",
|
||||
"stops": [
|
||||
"note": "ผ่านรังสิตหลังรถออกจากจตุจักร 30 นาที"
|
||||
}
|
||||
},
|
||||
{
|
||||
"station_id": 8,
|
||||
"derive": {
|
||||
"from_station_id": 8,
|
||||
"offset_min": 45,
|
||||
"note": "จากตลาดสามโก้"
|
||||
},
|
||||
"times": []
|
||||
}
|
||||
]
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
{
|
||||
"schema": 2,
|
||||
"route_id": "999",
|
||||
|
||||
"updated": "2026-10-04",
|
||||
"generated_from": "schedules.json",
|
||||
"station_order": [
|
||||
14
|
||||
],
|
||||
"directions": [
|
||||
{
|
||||
"dir_id": "from-14",
|
||||
"dir_label": null,
|
||||
"direction_id": "from-14",
|
||||
"direction_label": null,
|
||||
"stops": [
|
||||
{
|
||||
"station_id": 14,
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""bump-version.py — เพิ่มเวอร์ชันแอป (cache busting) ให้ตรงกันทุกที่ในคำสั่งเดียว
|
||||
|
||||
ทำอะไร:
|
||||
1) ui/sw.js const VERSION = "..." ← ตัวจริง (cache-first ใช้ค่านี้)
|
||||
2) ui/index.html <meta name="app-version" ...> ← ให้ ImgURL.of() ใช้
|
||||
3) ui/index.html โลโก้/ไอคอน ?v=... (static) ← รูปที่ฝังใน HTML
|
||||
|
||||
วิธีใช้:
|
||||
python resource/tools/bump-version.py # +1 รอบ (เช่น 2026.09.27.23 → .24)
|
||||
python resource/tools/bump-version.py 2026.10.01 # ตั้งค่าเอง (จะได้ 2026.10.01.1)
|
||||
python resource/tools/bump-version.py --show # แค่แสดงเวอร์ชันปัจจุบัน (ไม่เขียน)
|
||||
python resource/tools/bump-version.py --sync # ไม่เพิ่มเลข แค่ทำให้ทุกที่ตรงกับ sw.js
|
||||
|
||||
หลังอัปรูป: รันคำสั่งนี้ แล้วให้ผู้ใช้กด Ctrl+Shift+R ครั้งเดียว = เห็นรูปใหม่ทั้งหมด
|
||||
"""
|
||||
import argparse
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
UI = ROOT / "ui"
|
||||
SW = UI / "sw.js"
|
||||
INDEX = UI / "index.html"
|
||||
|
||||
VER_RE = re.compile(r'const VERSION = "([^"]+)";')
|
||||
|
||||
|
||||
def read_version():
|
||||
m = VER_RE.search(SW.read_text(encoding="utf-8"))
|
||||
if not m:
|
||||
sys.exit("ไม่พบ const VERSION ใน ui/sw.js")
|
||||
return m.group(1)
|
||||
|
||||
|
||||
def next_version(cur, base=None):
|
||||
"""cur = '2026.09.27.23' → '2026.09.27.24' · base='2026.10.01' → '2026.10.01.1'"""
|
||||
if base:
|
||||
m = re.match(r"^(\d{4}\.\d{2}\.\d{2})(?:\.(\d+))?$", base.strip())
|
||||
if not m:
|
||||
sys.exit(f"รูปแบบวันที่ไม่ถูกต้อง: {base} (ต้องเป็น YYYY.MM.DD)")
|
||||
n = int(m.group(2) or 0) + 1
|
||||
return f"{m.group(1)}.{n}"
|
||||
parts = cur.split(".")
|
||||
if len(parts) < 4 or not parts[-1].isdigit():
|
||||
return cur + ".1"
|
||||
return ".".join(parts[:-1] + [str(int(parts[-1]) + 1)])
|
||||
|
||||
|
||||
def apply(ver, dry=False):
|
||||
changed = []
|
||||
|
||||
# 1) sw.js
|
||||
sw = SW.read_text(encoding="utf-8")
|
||||
sw2 = VER_RE.sub(f'const VERSION = "{ver}";', sw, count=1)
|
||||
if sw2 != sw:
|
||||
if not dry:
|
||||
SW.write_text(sw2, encoding="utf-8")
|
||||
changed.append("ui/sw.js")
|
||||
|
||||
# 2) index.html — meta + โลโก้ static (?v=)
|
||||
idx = INDEX.read_text(encoding="utf-8")
|
||||
idx2 = re.sub(r'(<meta name="app-version" content=")[^"]*(">)', rf"\g<1>{ver}\g<2>", idx)
|
||||
idx2 = re.sub(r'(\.image/icons/[^"?]+\.(?:png|jpg|jpeg|webp|svg))\?v=[^"&]*', rf"\g<1>?v={ver}", idx2)
|
||||
if idx2 != idx:
|
||||
if not dry:
|
||||
INDEX.write_text(idx2, encoding="utf-8")
|
||||
changed.append("ui/index.html")
|
||||
|
||||
return changed
|
||||
|
||||
|
||||
def report(ver, changed, dry=False):
|
||||
n_img = len(re.findall(r"\.image/[^\"]+\?v=", INDEX.read_text(encoding="utf-8")))
|
||||
print(f"เวอร์ชัน: {ver}" + (" [dry-run]" if dry else ""))
|
||||
print(f" แก้ไฟล์: {', '.join(changed) if changed else 'ไม่มี (ตรงกันอยู่แล้ว)'}")
|
||||
print(f" รูป static ที่เติม ?v= ใน index.html: {n_img} จุด")
|
||||
print(f" รูป dynamic (routes/qrcode/stations/stops): เติมอัตโนมัติผ่าน ImgURL.of()")
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser()
|
||||
ap.add_argument("base", nargs="?", help="วันที่ฐาน YYYY.MM.DD (ไม่ใส่ = เพิ่มเลขรอบเดิม)")
|
||||
ap.add_argument("--show", action="store_true", help="แสดงเวอร์ชันปัจจุบัน")
|
||||
ap.add_argument("--sync", action="store_true", help="ทำให้ทุกที่ตรงกับ sw.js (ไม่เพิ่มเลข)")
|
||||
ap.add_argument("--check", action="store_true", help="ตรวจว่าทุกที่ตรงกันไหม (exit 1 ถ้าไม่ตรง)")
|
||||
args = ap.parse_args()
|
||||
|
||||
cur = read_version()
|
||||
|
||||
if args.show:
|
||||
print(f"เวอร์ชันปัจจุบัน: {cur}")
|
||||
return 0
|
||||
|
||||
if args.check:
|
||||
idx = INDEX.read_text(encoding="utf-8")
|
||||
m = re.search(r'<meta name="app-version" content="([^"]*)"', idx)
|
||||
meta = m.group(1) if m else None
|
||||
logos = set(re.findall(r"\.image/icons/[^\"]+?\?v=([^\"&]+)", idx))
|
||||
ok = (meta == cur) and (logos == {cur} or not logos)
|
||||
print(f"sw.js VERSION = {cur}")
|
||||
print(f"meta app-version= {meta} {'✓' if meta == cur else '✗ ไม่ตรง'}")
|
||||
print(f"โลโก้ ?v= = {sorted(logos) or '-'} {'✓' if (logos == {cur} or not logos) else '✗ ไม่ตรง'}")
|
||||
return 0 if ok else 1
|
||||
|
||||
ver = cur if args.sync else next_version(cur, args.base)
|
||||
changed = apply(ver, dry=False)
|
||||
report(ver, changed)
|
||||
print("\nขั้นตอนถัดไป: ให้ผู้ใช้กด Ctrl+Shift+R ครั้งเดียว (รูปทั้งหมดจะโหลดใหม่)")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
@@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""check-i18n.py — ตรวจความครบถ้วนของคำแปล (ui/locales/<lang>.json)
|
||||
|
||||
ตรวจ 5 เรื่อง:
|
||||
1. คีย์ที่ขาดในภาษาใดภาษาหนึ่ง → ERROR (โหมดนั้นจะถอยไปใช้ภาษาตั้งต้น = คำไทยโผล่ในหน้า EN)
|
||||
2. คีย์ซ้ำภายในไฟล์ภาษาเดียวกัน → ERROR (JSON เก็บตัวหลังเงียบ ๆ — เคยทำให้ค่าอังกฤษทับค่าไทย)
|
||||
3. ไฟล์ภาษาไม่ตรงกับ SUPPORTED ใน i18n.js → ERROR
|
||||
4. ค่าที่ว่างเปล่า → WARN (อาจตั้งใจ เช่น home.provincePrefix ของ EN)
|
||||
5. คีย์ที่ไม่พบที่ใช้ → WARN (อาจใช้แบบไดนามิกก็ได้)
|
||||
|
||||
ใช้:
|
||||
python resource/tools/check-i18n.py
|
||||
python resource/tools/check-i18n.py --quiet (แสดงเฉพาะที่มีปัญหา)
|
||||
"""
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
R = Path(__file__).resolve().parents[2]
|
||||
LOCALES = R / "ui/locales"
|
||||
BASE = "th" # ภาษาตั้งต้น — ใช้เทียบว่าคีย์ครบไหม
|
||||
quiet = "--quiet" in sys.argv
|
||||
|
||||
errors, warns = [], []
|
||||
|
||||
# ── 1) อ่านไฟล์ภาษาทั้งหมด (จับคีย์ซ้ำด้วย object_pairs_hook) ──
|
||||
files = sorted(LOCALES.glob("*.json"))
|
||||
if not files:
|
||||
print(f"!! ไม่พบไฟล์ภาษาใน {LOCALES.relative_to(R)}")
|
||||
sys.exit(1)
|
||||
|
||||
dicts, dups = {}, {}
|
||||
for p in files:
|
||||
lg = p.stem
|
||||
found = []
|
||||
|
||||
def hook(pairs, _found=found):
|
||||
seen = {}
|
||||
for k, v in pairs:
|
||||
if k in seen:
|
||||
_found.append(k)
|
||||
seen[k] = v
|
||||
return seen
|
||||
|
||||
try:
|
||||
dicts[lg] = json.loads(p.read_text(encoding="utf-8"), object_pairs_hook=hook)
|
||||
except Exception as e:
|
||||
errors.append((f"อ่านไฟล์ {p.name} ไม่ได้", [str(e)[:70]]))
|
||||
continue
|
||||
if found:
|
||||
dups[lg] = found
|
||||
|
||||
langs = sorted(dicts)
|
||||
if BASE not in dicts:
|
||||
errors.append((f"ไม่พบภาษาตั้งต้น '{BASE}'", [str(l) for l in langs]))
|
||||
|
||||
# ── 2) ไฟล์ภาษาต้องตรงกับ SUPPORTED ใน i18n.js ──
|
||||
src = (R / "ui/i18n.js").read_text(encoding="utf-8")
|
||||
m = re.search(r"var SUPPORTED\s*=\s*\[([^\]]*)\]", src)
|
||||
supported = re.findall(r"'([\w-]+)'", m.group(1)) if m else []
|
||||
if supported and sorted(supported) != langs:
|
||||
errors.append(("SUPPORTED ใน i18n.js ไม่ตรงกับไฟล์ภาษา",
|
||||
[f"js={supported}", f"files={langs}"]))
|
||||
|
||||
# ── 3) คีย์ขาด / คีย์ซ้ำ ──
|
||||
base_keys = list(dicts.get(BASE, {}))
|
||||
for lg in langs:
|
||||
if lg == BASE:
|
||||
continue
|
||||
missing = [k for k in base_keys if k not in dicts[lg]]
|
||||
if missing:
|
||||
errors.append((f"คีย์ขาดใน '{lg}' ({len(missing)})", missing))
|
||||
extra = [k for k in dicts[lg] if k not in dicts[BASE]]
|
||||
if extra:
|
||||
warns.append((f"คีย์ที่มีใน '{lg}' แต่ไม่มีใน '{BASE}' ({len(extra)})", extra))
|
||||
for lg in sorted(dups):
|
||||
errors.append((f"คีย์ซ้ำในไฟล์ '{lg}.json' ({len(set(dups[lg]))})", sorted(set(dups[lg]))))
|
||||
|
||||
# ── 4) ค่าที่ว่างเปล่า ──
|
||||
empty = [f"{lg}:{k}" for lg in langs for k, v in dicts[lg].items() if not str(v).strip()]
|
||||
if empty:
|
||||
warns.append((f"ค่าที่ว่างเปล่า ({len(empty)}) — อาจตั้งใจ", empty))
|
||||
|
||||
# ── 5) คีย์ที่ไม่พบที่ใช้ ──
|
||||
# ตรงตัว: t('key') · data-i18n="key" · data-i18n-attr="attr:key"
|
||||
# ไดนามิก: literal ที่ลงท้ายด้วย '.' เป็นคำนำหน้าคีย์ (เช่น 'check.day' + type)
|
||||
used, all_lits = set(), set()
|
||||
for f in list((R / "ui").rglob("*.js")) + list((R / "ui").rglob("*.html")):
|
||||
if "vendor" in str(f) or f.name == "i18n.js":
|
||||
continue
|
||||
txt = f.read_text(encoding="utf-8", errors="ignore")
|
||||
used |= set(re.findall(r"""tr?\('([\w.]+)'""", txt))
|
||||
used |= set(re.findall(r'data-i18n(?:-n)?="([\w.]+)"', txt))
|
||||
used |= set(re.findall(r'data-i18n-attr="[^":]+:([\w.]+)"', txt))
|
||||
all_lits |= set(re.findall(r"'([\w.]{2,80})'", txt))
|
||||
prefixes = {x for x in all_lits if x.endswith(".")}
|
||||
unused = sorted(k for k in base_keys
|
||||
if k not in used and k not in all_lits
|
||||
and not any(k.startswith(p) for p in prefixes))
|
||||
if unused:
|
||||
warns.append((f"ไม่พบที่ใช้ ({len(unused)}) — อาจใช้แบบไดนามิกก็ได้", unused))
|
||||
|
||||
# ── รายงาน ──
|
||||
if not quiet:
|
||||
print("i18n: ui/locales/ · " + " · ".join(f"{lg}={len(dicts[lg])}" for lg in langs) +
|
||||
f" · ภาษาตั้งต้น={BASE} · ไฟล์ที่ใช้จริง {LOCALES.relative_to(R)}")
|
||||
for title, items in errors:
|
||||
print(f"[ERROR] {title}: {', '.join(str(i) for i in items[:12])}" + (" …" if len(items) > 12 else ""))
|
||||
for title, items in warns:
|
||||
print(f"[WARN ] {title}: {', '.join(str(i) for i in items[:12])}" + (" …" if len(items) > 12 else ""))
|
||||
|
||||
if errors:
|
||||
print(f"\nผลลัพธ์: ไม่ผ่าน — {len(errors)} เรื่องต้องแก้")
|
||||
sys.exit(1)
|
||||
print(f"\nผลลัพธ์: ผ่าน — ทุกคีย์มีครบทั้ง {len(langs)} ภาษา ไม่มีคีย์ซ้ำ" +
|
||||
(f" (มี {len(warns)} คำเตือน)" if warns else ""))
|
||||
sys.exit(0)
|
||||
@@ -72,7 +72,7 @@ def all_times(sub, station_id):
|
||||
for d in sub.get("directions", []):
|
||||
for s in d.get("stops", []):
|
||||
if int(s["station_id"]) == int(station_id) and (s.get("times") or []):
|
||||
return s["times"], d.get("dir_id")
|
||||
return s["times"], d.get("direction_id")
|
||||
return [], None
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ def main():
|
||||
for st in d.get("stops", []):
|
||||
t = tuple(st.get("times") or [])
|
||||
if t:
|
||||
sig.setdefault(t, []).append((d.get("dir_id"), st["station_id"], st.get("derive")))
|
||||
sig.setdefault(t, []).append((d.get("direction_id"), st["station_id"], st.get("derive")))
|
||||
for times, who in sig.items():
|
||||
if len(who) < 2:
|
||||
continue
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
แหล่งข้อมูล 2 ทาง (ค่าเริ่มต้น = shapefile เพราะวิธีทำงานจริงคือแก้ใน QGIS แล้วกด Save):
|
||||
python resource/tools/qgis-to-web.py # อ่าน <รหัสสาย>.shp ตามตาราง SHP_MAP (แนะนำ)
|
||||
python resource/tools/qgis-to-web.py --from geojson # อ่าน GeoJSON-2/*.geojson (เส้นทางเดิม)
|
||||
python resource/tools/qgis-to-web.py --from gpkg # อ่าน angthongtoanytrain/*.gpkg (เส้นทางที่เสนอ/ความฝัน)
|
||||
|
||||
ธงอื่น:
|
||||
--check ตรวจเทียบกับไฟล์ปัจจุบัน ไม่เขียนไฟล์
|
||||
@@ -29,7 +30,20 @@ from pathlib import Path
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
QDIR = ROOT / "resource" / "data" / "QGIS Project"
|
||||
SRC_GEOJSON = QDIR / "GeoJSON-2"
|
||||
SRC_GPKG = QDIR / "angthongtoanytrain" # เส้นทางที่เสนอ (ยังไม่มีจริง) — 1 ไฟล์ = 1 เส้นทาง
|
||||
DST = ROOT / "resource" / "data" / "geojson-web"
|
||||
|
||||
# ── ตารางจับคู่ "ชื่อไฟล์ .gpkg → route_id" (เส้นทางที่เสนอ) ──────────────────
|
||||
# route_id ต้องไม่ชนกับสายจริง (902/15/951/952/954/8/101/464/641/2194/324/1011/2231/999)
|
||||
# ชื่อไฟล์ .gpkg เป็นภาษาไทยได้ — คีย์คือชื่อ stem (ไม่รวม .gpkg)
|
||||
GPKG_MAP = {
|
||||
"อ่างทอง-บ้านภาชี(สายสีแดงเข้ม)": "dream-banchang",
|
||||
"อ่างทอง-รถไฟฟ้าชานเมืองอยุธยา(สายสีแดงเข้ม)": "dream-ayutthaya-redline",
|
||||
"อ่างทอง-สถานีรถไฟความเร็วสูงอยุธยา": "dream-ayutthaya-hsr",
|
||||
"อ่างทอง-เมืองทองธานี": "dream-muangthong",
|
||||
"อ่างทอง-แยกปากเกร็ด": "dream-pakkret",
|
||||
"อ่างทอง-วัชรพล": "dream-Watcharapol",
|
||||
}
|
||||
BBOX = (97.0, 103.0, 12.0, 17.5) # lng_min, lng_max, lat_min, lat_max
|
||||
|
||||
# ── ตารางจับคู่ "รหัสสาย → ไฟล์ .shp ในโปรเจกต์ QGIS" ─────────────────────────
|
||||
@@ -112,6 +126,85 @@ def looks_like_utm(lines):
|
||||
return max(abs(min(xs)), abs(max(xs))) > 1000
|
||||
|
||||
|
||||
# ── อ่าน GeoPackage (.gpkg = SQLite) — ไม่ต้องพึ่ง GDAL/geopandas ──
|
||||
def read_gpkg(path):
|
||||
"""คืน (lines, srs_id, ชื่อชั้น) — รองรับ LineString/MultiLineString · พิกัด (lng, lat)
|
||||
GPKG geometry blob = 'GP' + ver(1) + flags(1) + srs_id(4) + envelope(ตาม flags) + WKB"""
|
||||
import sqlite3
|
||||
con = sqlite3.connect(f"file:{path}?mode=ro", uri=True)
|
||||
try:
|
||||
cur = con.cursor()
|
||||
row = cur.execute(
|
||||
"SELECT table_name FROM gpkg_contents WHERE data_type='features' LIMIT 1").fetchone()
|
||||
if not row:
|
||||
return None, None, None
|
||||
table = row[0]
|
||||
srs = cur.execute("SELECT srs_id FROM gpkg_geometry_columns WHERE table_name=?",
|
||||
(table,)).fetchone()
|
||||
blob = cur.execute(f'SELECT geometry FROM "{table}" LIMIT 1').fetchone()[0]
|
||||
finally:
|
||||
con.close()
|
||||
return _parse_gpkg_blob(blob), (srs[0] if srs else None), table
|
||||
|
||||
|
||||
def _parse_gpkg_blob(blob):
|
||||
"""ถอด WKB จาก GPKG blob → list ของเส้น; แต่ละเส้น = list ของ [lng, lat]"""
|
||||
if not blob or blob[:2] != b"GP":
|
||||
return []
|
||||
flags = blob[3]
|
||||
env = {0: 0, 1: 4, 2: 6, 3: 6, 4: 8}.get((flags >> 1) & 0x07, 0)
|
||||
o = 8 + env * 8
|
||||
order = blob[o]
|
||||
E = "<" if order == 1 else ">"
|
||||
gtype = struct.unpack(E + "I", blob[o + 1:o + 5])[0]
|
||||
o += 5
|
||||
lines = []
|
||||
if gtype == 2: # LineString
|
||||
n = struct.unpack(E + "I", blob[o:o + 4])[0]
|
||||
o += 4
|
||||
lines.append([list(struct.unpack(E + "dd", blob[o + 16 * i:o + 16 * i + 16]))
|
||||
for i in range(n)])
|
||||
elif gtype == 5: # MultiLineString
|
||||
n = struct.unpack(E + "I", blob[o:o + 4])[0]
|
||||
o += 4
|
||||
for _ in range(n):
|
||||
E2 = "<" if blob[o] == 1 else ">"
|
||||
m = struct.unpack(E2 + "I", blob[o + 5:o + 9])[0]
|
||||
o += 9
|
||||
lines.append([list(struct.unpack(E2 + "dd", blob[o + 16 * i:o + 16 * i + 16]))
|
||||
for i in range(m)])
|
||||
o += 16 * m
|
||||
return [l for l in lines if len(l) >= 2]
|
||||
|
||||
|
||||
def from_gpkg(route_id):
|
||||
"""คืน (features, รายงาน) จาก angthongtoanytrain/<ชื่อ>.gpkg ตาม GPKG_MAP"""
|
||||
stem = next((k for k, v in GPKG_MAP.items() if v == route_id), None)
|
||||
if stem is None:
|
||||
return None, ["ไม่มีในตาราง GPKG_MAP — ข้าม"]
|
||||
path = SRC_GPKG / f"{stem}.gpkg"
|
||||
if not path.exists():
|
||||
return None, [f"ไม่พบไฟล์ {path.name} (ชื่อเปลี่ยน? แก้ GPKG_MAP)"]
|
||||
lines, srs, table = read_gpkg(path)
|
||||
if not lines:
|
||||
return None, ["ไม่มีเส้นในไฟล์ (หรือชนิด geometry ไม่รองรับ)"]
|
||||
if srs not in (None, 4326):
|
||||
return None, [f"SRS = {srs} (ไม่ใช่ EPSG:4326) — บันทึกใหม่ใน QGIS"]
|
||||
if looks_like_utm(lines):
|
||||
return None, ["พิกัดเป็น UTM (ไม่ใช่ WGS84) — บันทึกใหม่โดยตั้ง CRS = EPSG:4326"]
|
||||
|
||||
kept, dropped = clean_lines(lines)
|
||||
if not kept:
|
||||
return None, ["หลังกรองแล้วไม่มีเส้นเหลือ — ข้าม"]
|
||||
geom = ("MultiLineString" if len(kept) > 1 else "LineString")
|
||||
feat = {"type": "Feature", "properties": {"route_id": route_id},
|
||||
"geometry": {"type": geom, "coordinates": (kept if len(kept) > 1 else kept[0])}}
|
||||
notes = [f"ชั้น '{table}' · srs={srs}"]
|
||||
if dropped:
|
||||
notes.append(f"ตัด {dropped} ช่วงที่สั้น/หลุดกรอบ")
|
||||
return [feat], notes
|
||||
|
||||
|
||||
def from_shp(route_id):
|
||||
"""คืน (features, รายงาน) จาก shapefile ตาม SHP_MAP"""
|
||||
stem = SHP_MAP.get(route_id)
|
||||
@@ -193,12 +286,14 @@ def targets(mode):
|
||||
"""รายการ route_id ที่จะสร้าง (จากตาราง SHP_MAP หรือไฟล์ GeoJSON-2)"""
|
||||
if mode == "shp":
|
||||
return sorted(SHP_MAP)
|
||||
if mode == "gpkg":
|
||||
return sorted(GPKG_MAP.values())
|
||||
return sorted(p.stem for p in SRC_GEOJSON.glob("*.geojson"))
|
||||
|
||||
|
||||
def main():
|
||||
ap = argparse.ArgumentParser(description="QGIS (shapefile/GeoJSON) → resource/data/geojson-web/")
|
||||
ap.add_argument("--from", dest="src", choices=["shp", "geojson"], default="shp",
|
||||
ap.add_argument("--from", dest="src", choices=["shp", "geojson", "gpkg"], default="shp",
|
||||
help="แหล่งข้อมูล (ค่าเริ่มต้น shp)")
|
||||
ap.add_argument("--check", action="store_true", help="ตรวจอย่างเดียว ไม่เขียนไฟล์")
|
||||
ap.add_argument("--list", action="store_true", help="แสดงตารางจับคู่ + สถานะไฟล์")
|
||||
@@ -216,7 +311,9 @@ def main():
|
||||
return
|
||||
|
||||
from_shp_source = args.src == "shp"
|
||||
label = "shapefile (QGIS Project/*.shp)" if from_shp_source else "GeoJSON-2/*.geojson"
|
||||
label = {"shp": "shapefile (QGIS Project/*.shp)",
|
||||
"geojson": "GeoJSON-2/*.geojson",
|
||||
"gpkg": "angthongtoanytrain/*.gpkg (เส้นทางที่เสนอ)"}[args.src]
|
||||
print(f"ต้นทาง : {label} ({len(ids)} สาย)")
|
||||
print(f"ปลายทาง: {DST.relative_to(ROOT)}" + (" [--check: ไม่เขียนไฟล์]\n" if args.check else "\n"))
|
||||
DST.mkdir(parents=True, exist_ok=True)
|
||||
@@ -224,8 +321,14 @@ def main():
|
||||
print(f"{'สาย':<8}{'จุด':<7}{'ไฟล์เดิม':<10}สถานะ")
|
||||
written = skipped = unchanged = 0
|
||||
for rid in ids:
|
||||
rid = re.sub(r"[^0-9A-Za-z]", "", rid) or rid
|
||||
feats, notes = (from_shp(rid) if from_shp_source else from_geojson(rid))
|
||||
if args.src != "gpkg": # dream-* มี "-" ต้องคงไว้
|
||||
rid = re.sub(r"[^0-9A-Za-z]", "", rid) or rid
|
||||
if args.src == "shp":
|
||||
feats, notes = from_shp(rid)
|
||||
elif args.src == "gpkg":
|
||||
feats, notes = from_gpkg(rid)
|
||||
else:
|
||||
feats, notes = from_geojson(rid)
|
||||
if feats is None:
|
||||
print(f"{rid:<8}{'-':<7}{'-':<10}ข้าม — {'; '.join(notes)}")
|
||||
skipped += 1
|
||||
|
||||
@@ -11,16 +11,16 @@
|
||||
stops[] จุดจอดในทิศนั้น
|
||||
station_id
|
||||
times[] เวลาออกของจุดนี้
|
||||
dir_note ถ้อยคำทิศเดิมจากเจ้าของข้อมูล (เก็บไว้ ไม่แปลง)
|
||||
direction_note ถ้อยคำทิศเดิมจากเจ้าของข้อมูล (เก็บไว้ ไม่แปลง)
|
||||
note เงื่อนไขเวลาเดิมจากเจ้าของข้อมูล (เก็บไว้ ไม่แปลง)
|
||||
groups[] (อนาคต) ใช้เมื่อเวลาชุดเดียวกันแยกตามวัน เช่น 10:00 เฉพาะวันหยุด
|
||||
|
||||
กติกาการแยกทิศ (ยึดข้อมูลจริง):
|
||||
- "จุดแยกทิศ" = จุดที่มี record หลายทิศ = จุดที่รถแยกทาง (เช่น สาย 101 จุด 2 ป่าโมก มีทั้ง 'ไปอยุธยา'/'ไปออ่างทอง')
|
||||
- record ที่ไม่ระบุทิศ → ใช้ทิศของจุดแยกทิศที่อยู่ก่อนหน้าในลำดับ (จุดที่รถผ่านมาก่อน)
|
||||
- สายที่ไม่ระบุทิศเลย → ทิศเดียว dir_id = "all"
|
||||
- สายที่ไม่ระบุทิศเลย → ทิศเดียว direction_id = "all"
|
||||
|
||||
หมายเหตุ: เลิกใช้ schedule_id (ไม่มีโค้ดไหนอ้างถึง) — กุญแจคือ route_id + dir_id + station_id
|
||||
หมายเหตุ: เลิกใช้ schedule_id (ไม่มีโค้ดไหนอ้างถึง) — กุญแจคือ route_id + direction_id + station_id
|
||||
"""
|
||||
import argparse
|
||||
import json
|
||||
@@ -95,8 +95,8 @@ def orient_order(rid, order, stations):
|
||||
def direction_of(rec, first_station):
|
||||
"""ทิศของ record ตามข้อมูลที่ระบุไว้จริง
|
||||
- มี direction_note → ทิศนั้น (แยกเป็น directions[] ของตัวเอง)
|
||||
- ไม่มี note + เป็นจุดต้นทาง (station_order[0]) → 'ออกจากต้นทาง' (dir_id = from-<station>)
|
||||
- ไม่มี note + จุดอื่น → ทิศทางเดียว (dir_id = "all")
|
||||
- ไม่มี note + เป็นจุดต้นทาง (station_order[0]) → 'ออกจากต้นทาง' (direction_id = from-<station>)
|
||||
- ไม่มี note + จุดอื่น → ทิศทางเดียว (direction_id = "all")
|
||||
ไม่พยายามเดาว่าจุดปลายทางอยู่ขาไหน (ข้อมูลเดิมขัดกันเอง — ต้องให้เจ้าของข้อมูลยืนยัน)
|
||||
"""
|
||||
label = rec.get("direction_note")
|
||||
@@ -146,17 +146,17 @@ def main():
|
||||
for rec in sorted(d["recs"], key=lambda r: r["station_id"]):
|
||||
entry = {"station_id": rec["station_id"], "times": rec.get("departure_times") or []}
|
||||
if rec.get("direction_note"):
|
||||
entry["dir_note"] = rec["direction_note"]
|
||||
entry["direction_note"] = rec["direction_note"]
|
||||
if rec.get("schedule_note"):
|
||||
entry["note"] = rec["schedule_note"]
|
||||
stops.append(entry)
|
||||
stops.sort(key=lambda x: (order.index(x["station_id"]) if x["station_id"] in order else 999))
|
||||
dir_id = "all" if kind == "all" else (("from-%s" % val) if kind == "start" else "dir-%d" % dir_seq)
|
||||
direction_id = "all" if kind == "all" else (("from-%s" % val) if kind == "start" else "dir-%d" % dir_seq)
|
||||
if kind == "label":
|
||||
dir_seq += 1
|
||||
dir_list.append({
|
||||
"dir_id": dir_id,
|
||||
"dir_label": d["label"],
|
||||
"direction_id": direction_id,
|
||||
"direction_label": d["label"],
|
||||
"stops": stops,
|
||||
})
|
||||
n_dup += sum(len(s["times"]) for s in stops)
|
||||
@@ -166,7 +166,7 @@ def main():
|
||||
counts = {s["station_id"]: len(s["times"]) for s in dl["stops"] if s["times"]}
|
||||
if len(set(counts.values())) > 1:
|
||||
warnings.append(
|
||||
f"สาย {rid} ทิศ '{dl['dir_label'] or 'ไม่แยกทิศ'}': จำนวนเที่ยวไม่เท่ากันข้ามจุด {counts} "
|
||||
f"สาย {rid} ทิศ '{dl['direction_label'] or 'ไม่แยกทิศ'}': จำนวนเที่ยวไม่เท่ากันข้ามจุด {counts} "
|
||||
f"— อาจยังแยกทิศไม่ครบ (ต้องให้เจ้าของข้อมูลยืนยัน)")
|
||||
|
||||
# เตือนจุดจอดที่ไม่มีเวลา (ไม่สร้างข้อมูลปลอม — UI จะขึ้น "ยังไม่มีข้อมูล")
|
||||
@@ -191,7 +191,7 @@ def main():
|
||||
for r in out_routes:
|
||||
for d in r["directions"]:
|
||||
cells = ", ".join(f"{s['station_id']}×{len(s['times'])}" for s in d["stops"])
|
||||
print(f"{r['route_id']:<7}{(d['dir_label'] or '(ไม่แยกทิศ)')[:22]:<24}{len(d['stops']):<5}"
|
||||
print(f"{r['route_id']:<7}{(d.get('direction_label') or '(ไม่แยกทิศ)')[:22]:<24}{len(d['stops']):<5}"
|
||||
f"{sum(len(s['times']) for s in d['stops']):<7}{cells}")
|
||||
|
||||
if warnings:
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""stamp-schedules.py — เติม/อัปเดตฟิลด์ "updated" (ISO YYYY-MM-DD) ใน scheduleslist/*.json
|
||||
|
||||
ที่มา: หน้า #/check แสดง "อัปเดตล่าสุด ... ที่แล้ว" โดยนับจากฟิลด์ "updated" ในไฟล์ตาราง
|
||||
เบราว์เซอร์อ่าน Last-Modified ของไฟล์ไม่ได้ (CORS) → ต้องบันทึกวันลงในไฟล์เอง
|
||||
|
||||
หลักการ:
|
||||
- วันที่ = mtime ของไฟล์จริง (เวลาแก้ไขล่าสุดบนดิสก์) แปลงเป็นเวลาไทย UTC+7
|
||||
- --check : ดูอย่างเดียว ไม่เขียนอะไร (dry run)
|
||||
- ไม่มี flag: เขียนไฟล์ที่ต้องแก้ (คง CRLF เดิมไว้)
|
||||
|
||||
ใช้:
|
||||
python resource/tools/stamp-schedules.py --check
|
||||
python resource/tools/stamp-schedules.py
|
||||
"""
|
||||
import datetime
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
R = Path(__file__).resolve().parents[2]
|
||||
D = R / "resource/data/scheduleslist"
|
||||
TZ_OFFSET = datetime.timedelta(hours=7) # เวลาไทย
|
||||
|
||||
dry = "--check" in sys.argv
|
||||
|
||||
|
||||
def today_th():
|
||||
return (datetime.datetime.now(datetime.timezone.utc) + TZ_OFFSET).date()
|
||||
|
||||
|
||||
def mtime_date(p):
|
||||
return (datetime.datetime.fromtimestamp(p.stat().st_mtime, datetime.timezone.utc) + TZ_OFFSET).date()
|
||||
|
||||
|
||||
def stamp_file(p):
|
||||
"""เติม/แก้ 'updated' หลัง route_id · คงรูปแบบ/CRLF เดิม · คืน (old, new, changed)"""
|
||||
raw = p.read_bytes()
|
||||
eol = b"\r\n" if b"\r\n" in raw[:4000] else b"\n"
|
||||
txt = raw.decode("utf-8")
|
||||
d = json.loads(txt)
|
||||
|
||||
if not isinstance(d, dict) or "route_id" not in d:
|
||||
return None, None, False
|
||||
|
||||
want = mtime_date(p).isoformat()
|
||||
have = str(d.get("updated") or "")
|
||||
if have == want:
|
||||
return have, want, False
|
||||
|
||||
if re.search(r'^\s*"updated"\s*:\s*"[^"]*",\s*$', txt, re.M):
|
||||
new = re.sub(r'(^\s*"updated"\s*:\s*")[^"]*(",\s*$)', lambda m: m.group(1) + want + m.group(2),
|
||||
txt, count=1, flags=re.M)
|
||||
else:
|
||||
# แทรกหลังบรรทัด route_id (คงการเยื้องเดิม)
|
||||
m = re.search(r'^(\s*)"route_id"\s*:\s*("[^"]*"\s*,?\s*)$', txt, re.M)
|
||||
if not m:
|
||||
return have, want, False
|
||||
indent = m.group(1)
|
||||
new = txt[:m.end(1) + len(m.group(0)) - len(m.group(0).lstrip())] # กันพลาด
|
||||
ins = m.group(0) if m.group(0).rstrip().endswith(",") else m.group(0).rstrip() + ","
|
||||
eol_s = eol.decode()
|
||||
new = txt.replace(m.group(0), ins + eol_s + indent + '"updated": "' + want + '",', 1)
|
||||
|
||||
try:
|
||||
json.loads(new)
|
||||
except Exception as e:
|
||||
print(f" !! JSON พังหลังแก้ — ข้ามไฟล์นี้ ({e})")
|
||||
return have, want, False
|
||||
|
||||
if not dry:
|
||||
p.write_bytes(new.encode("utf-8"))
|
||||
return have, want, True
|
||||
|
||||
|
||||
def main():
|
||||
files = sorted(D.glob("schedules*.json"))
|
||||
if not files:
|
||||
print(f"ไม่พบไฟล์ใน {D}")
|
||||
return 1
|
||||
print(f"สแกน {len(files)} ไฟล์ · วันที่อ้างอิง = mtime ของไฟล์ (เวลาไทย UTC+7)")
|
||||
print("ไฟล์ เดิม → ใหม่ สถานะ")
|
||||
print("-" * 68)
|
||||
n_chg = 0
|
||||
for p in files:
|
||||
old, new, changed = stamp_file(p)
|
||||
if new is None:
|
||||
print(f"{p.name:<24} (ไม่มี route_id — ข้าม)")
|
||||
continue
|
||||
mark = "แก้ไข" if changed else "ตรงแล้ว"
|
||||
if changed:
|
||||
n_chg += 1
|
||||
print(f"{p.name:<24} {old or '(ไม่มี)':<12} → {new:<12} {mark}")
|
||||
print("-" * 68)
|
||||
if dry:
|
||||
print(f"รวมจะแก้ {n_chg} ไฟล์ (dry run — ยังไม่เขียนจริง) · รันโดยไม่ใส่ --check เพื่อเขียน")
|
||||
else:
|
||||
print(f"เขียนแล้ว {n_chg} ไฟล์")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
+14
-12
@@ -189,13 +189,13 @@
|
||||
|
||||
/* ---------- Rich shared footer ---------- */
|
||||
.mu-site-footer {
|
||||
margin-top: 48px;
|
||||
margin-top: 34px;
|
||||
background:
|
||||
radial-gradient(circle at 0% 0%, rgba(122, 76, 192, .35), transparent 35%),
|
||||
radial-gradient(circle at 100% 10%, rgba(48, 113, 184, .35), transparent 35%),
|
||||
linear-gradient(180deg, #1a1830 0%, #0f1126 100%);
|
||||
color: #cfd5ec;
|
||||
padding: 48px 0 0;
|
||||
padding: 34px 0 0;
|
||||
}
|
||||
.mu-site-footer .mu-container {
|
||||
max-width: 1200px;
|
||||
@@ -205,12 +205,12 @@
|
||||
.mu-footer-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
|
||||
gap: 28px;
|
||||
gap: 20px;
|
||||
}
|
||||
.mu-footer-brand {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
gap: 10px;
|
||||
}
|
||||
.mu-footer-brand-row {
|
||||
display: flex;
|
||||
@@ -245,7 +245,7 @@
|
||||
line-height: 1.6;
|
||||
}
|
||||
.mu-footer-col h4 {
|
||||
margin: 0 0 14px;
|
||||
margin: 0 0 10px;
|
||||
color: #fff;
|
||||
font-size: .9rem;
|
||||
font-weight: 800;
|
||||
@@ -258,12 +258,13 @@
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
gap: 3px;
|
||||
}
|
||||
.mu-footer-col ul a {
|
||||
color: #cfd5ec;
|
||||
text-decoration: none;
|
||||
font-size: .9rem;
|
||||
line-height: 1.5;
|
||||
transition: color .15s ease;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
@@ -284,12 +285,12 @@
|
||||
text-decoration: none;
|
||||
font-size: .88rem;
|
||||
}
|
||||
.mu-footer-contact .row { margin-bottom: 8px; }
|
||||
.mu-footer-contact .row { margin-bottom: 4px; }
|
||||
|
||||
/* ---------- Sponsor strip inside footer ---------- */
|
||||
.mu-footer-sponsors {
|
||||
margin-top: 36px;
|
||||
padding-top: 28px;
|
||||
margin-top: 22px;
|
||||
padding-top: 16px;
|
||||
border-top: 1px solid rgba(255, 255, 255, .08);
|
||||
}
|
||||
.mu-footer-sponsors h4 {
|
||||
@@ -302,6 +303,7 @@
|
||||
margin: 0 0 18px;
|
||||
color: #9aa3c3;
|
||||
font-size: .85rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
.mu-sponsor-strip {
|
||||
display: grid;
|
||||
@@ -334,8 +336,8 @@
|
||||
|
||||
/* ---------- Footer bottom bar ---------- */
|
||||
.mu-footer-bottom {
|
||||
margin-top: 36px;
|
||||
padding: 18px 0 22px;
|
||||
margin-top: 20px;
|
||||
padding: 12px 0 14px;
|
||||
border-top: 1px solid rgba(255, 255, 255, .08);
|
||||
text-align: center;
|
||||
}
|
||||
@@ -364,7 +366,7 @@ body:has(.mu-site-footer) .mu-footer { display: none; }
|
||||
}
|
||||
@media (max-width: 640px) {
|
||||
.mu-footer-grid { grid-template-columns: 1fr; }
|
||||
.mu-site-footer { padding: 36px 0 0; }
|
||||
.mu-site-footer { padding: 28px 0 0; }
|
||||
}
|
||||
|
||||
/* =========================================================
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="th">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>ตารางขยาย | Atroute</title>
|
||||
<script>
|
||||
location.replace('./index.html#/routes/expanded');
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<noscript><a href="./index.html">เปิด Atroute</a></noscript>
|
||||
</body>
|
||||
</html>
|
||||
+51
-524
@@ -1,528 +1,33 @@
|
||||
/* ============================================================
|
||||
Atroute — ระบบหลายภาษา (i18n)
|
||||
------------------------------------------------------------
|
||||
คำแปลแยกเป็นไฟล์ต่อภาษา: ui/locales/<รหัสภาษา>.json (แบน: "key": "ข้อความ")
|
||||
เพิ่มภาษาใหม่ = วางไฟล์ + เพิ่มรหัสใน SUPPORTED (ไม่ต้องแก้โค้ดอื่น)
|
||||
|
||||
วิธีใช้:
|
||||
1. ใส่ data-i18n="key" บน element ที่เป็นข้อความ
|
||||
<span data-i18n="nav.home">หน้าแรก</span>
|
||||
2. attribute (placeholder/aria-label/title):
|
||||
data-i18n-attr="placeholder:search.ph,aria-label:search.ph"
|
||||
3. ภาษา: ตรวจจาก localStorage('at_lang') → ถ้าไม่มี ใช้ภาษา browser
|
||||
ปุ่มสลับ: <button data-i18n-switch="en">EN</button>
|
||||
4. เพิ่มคำแปลใหม่: เติมใน DICT.th / DICT.en ข้างล่าง
|
||||
1. ข้อความใน HTML: <span data-i18n="nav.home">หน้าแรก</span>
|
||||
(ข้อความในแท็ก = fallback ถ้าโหลดไฟล์ภาษาไม่สำเร็จ)
|
||||
2. attribute: data-i18n-attr="placeholder:search.ph,aria-label:search.ph"
|
||||
ใส่ html: data-i18n-attr="html:key" (ระวัง — เป็น innerHTML)
|
||||
ตัวเลขในข้อความ: data-i18n-n="3" + คำแปลมี {n}
|
||||
3. ใน JS: I18N.t('key') · I18N.t('key', { n: 3 })
|
||||
4. ปุ่มสลับภาษา: <button data-i18n-switch="en">EN</button>
|
||||
|
||||
ลำดับการโหลด: รอ I18N.ready ก่อนวาดหน้าแรก (router ทำให้แล้ว)
|
||||
ถ้าโหลดไม่สำเร็จ: คงข้อความ fallback ใน HTML ไว้ (ไม่เขียนทับด้วย key)
|
||||
============================================================ */
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var LS_KEY = 'at_lang';
|
||||
var SUPPORTED = ['th', 'en'];
|
||||
var BASE = 'th'; /* ภาษาตั้งต้น — ใช้เมื่อคีย์ขาดในภาษาปัจจุบัน */
|
||||
var DIR = './locales/';
|
||||
|
||||
var DICT = {
|
||||
/* ============ ภาษาไทย (ค่าเริ่มต้น) ============ */
|
||||
th: {
|
||||
// topbar / footer
|
||||
'brand.subtitle': 'สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง',
|
||||
'nav.home': 'หน้าแรก',
|
||||
'nav.stops': 'ป้ายหยุดรถ',
|
||||
'nav.routes': 'รายละเอียดสายรถ',
|
||||
'nav.expanded': 'ตารางขยาย',
|
||||
'nav.credits': 'เครดิต',
|
||||
'nav.about': 'เกี่ยวกับเรา',
|
||||
'nav.blog': 'บ่นไปเรื่อย',
|
||||
'about.title': 'เกี่ยวกับเรา',
|
||||
'about.brand': 'เมื่อไหร่รถจะมา',
|
||||
'about.lead': 'เรื่องราวและที่มาของเว็บนี้ — อ่านเรียงตามบล็อกด้านล่างได้เลย',
|
||||
'blog.title': 'บ่นไปเรื่อย',
|
||||
'blog.subtitle': 'ข่าวสาร & ความรู้การเดินทาง',
|
||||
'blog.lead': 'รวมข่าวเส้นทาง อัปเดตตารางรถ และเกร็ดความรู้ — สลับมุมมองตาราง/รายการได้ตามถนัด',
|
||||
'blog.viewGrid': 'ตาราง',
|
||||
'blog.viewList': 'รายการ',
|
||||
'blog.count': 'บ่นไปเรื่อยทั้งหมด',
|
||||
'blog.items': 'เรื่อง',
|
||||
'blog.minRead': 'นาที',
|
||||
'blog.readMore': 'อ่านต่อ',
|
||||
'blog.backList': 'กลับไปรายการบ่นไปเรื่อย',
|
||||
'blog.empty': 'ยังไม่มีเรื่องบ่น — เพิ่มไฟล์ใน ui/partials/blog-data/ ได้เลย',
|
||||
'blog.notFound': 'ไม่พบเรื่องบ่นนี้',
|
||||
// คำอธิบายสีการ์ดตามหมวดเส้นทาง
|
||||
'legend.title': 'คำอธิบายสีการ์ดตามหมวดเส้นทาง',
|
||||
'legend.bangkok': 'หมวดเส้นทางเข้ากรุงเทพฯ — การ์ดสีน้ำเงิน',
|
||||
'legend.interprov': 'หมวดเส้นทางระหว่างจังหวัด — การ์ดสีม่วง',
|
||||
'legend.inprov': 'หมวดเส้นทางภายในจังหวัด — การ์ดสีชมพู',
|
||||
'legend.municipal': 'หมวดเส้นทางภายในเทศบาล — การ์ดสีเหลืองอ่อน',
|
||||
'legend.empty': 'ยังไม่มีข้อมูล — การ์ดสีเทา แสดง N/A แทนเลขสาย',
|
||||
'legend.note': 'อ่างทองยังไม่มีรถหมวด 1 (เส้นทางภายในเทศบาล) จึงแสดงการ์ดสีเทาและใช้ N/A แทนตัวเลขสายเส้นทาง',
|
||||
'zone.municipal': 'หมวดเส้นทางภายในเทศบาล',
|
||||
'zone.municipalDesc': 'เส้นทางภายในเขตเทศบาล',
|
||||
'zone.municipalNA': 'ยังไม่มีเส้นทางหมวดเทศบาลในอ่างทอง',
|
||||
'card.noData': 'ยังไม่มีข้อมูล',
|
||||
// แผนที่เส้นทาง (Leaflet + GeoJSON)
|
||||
'route.mapDesc': 'เส้นทางจริงจากข้อมูล GIS · ป้ายหยุดรถตามเส้นทาง',
|
||||
'map.origin': 'ต้นทาง',
|
||||
'map.destination': 'ปลายทาง',
|
||||
'map.offline': 'ออฟไลน์ — แสดงเฉพาะเส้นทาง',
|
||||
'map.empty': 'ยังไม่มีข้อมูลเส้นทางสายนี้ในระบบ',
|
||||
'map.legendRoute': 'เส้นทาง',
|
||||
'map.legendStop': 'ป้ายหยุดรถ',
|
||||
'map.legendTerminal': 'สถานีขนส่ง',
|
||||
'map.route': 'สาย',
|
||||
'map.noStationPin': 'พิกัดป้ายนี้ยังไม่มีในระบบ — แสดงเส้นทางที่ผ่าน',
|
||||
'map.captionRoute': 'ความยาวเส้นทาง {km} กม. · ป้ายตามเส้นทาง {n} แห่ง',
|
||||
'map.captionStop': 'เส้นทางที่ผ่านป้ายนี้ {r} · ป้ายตามเส้นทาง {n} แห่ง',
|
||||
'map.stations': 'สถานีขนส่งตามเส้นทาง',
|
||||
'map.stationPinned': 'ปักหมุดตำแหน่งป้ายแล้ว',
|
||||
'map.thisStop': 'ป้ายที่กำลังดูอยู่',
|
||||
'map.legendHere': 'ป้ายที่กำลังดู',
|
||||
'map.noRoutesHere': 'ยังไม่มีข้อมูลสายรถที่ผ่านป้ายนี้ในระบบ',
|
||||
'map.servedBy': 'สายที่ผ่าน',
|
||||
'map.openInMaps': 'เปิดใน Google Maps',
|
||||
'map.viewStopPage': 'ดูรายละเอียดป้ายนี้',
|
||||
'map.km': 'กม.',
|
||||
'map.offRoute': 'นอกเส้นทาง',
|
||||
'map.alongRoute': 'จุดจอดตามเส้นทาง (กม. จากต้นทาง)',
|
||||
'map.useMyLocation': 'ป้ายใกล้ฉัน',
|
||||
'map.locating': 'กำลังหาตำแหน่งของคุณ…',
|
||||
'map.geoDenied': 'ไม่ได้รับอนุญาตให้เข้าถึงตำแหน่ง — เปิดสิทธิ์ตำแหน่งในเบราว์เซอร์แล้วลองใหม่',
|
||||
'map.noGeo': 'เบราว์เซอร์นี้ไม่รองรับการระบุตำแหน่ง',
|
||||
'map.nearestTitle': 'ป้ายที่ใกล้คุณที่สุด',
|
||||
'map.youAreHere': 'ตำแหน่งของคุณ',
|
||||
'cta.check': 'เช็กเวลาเดินรถ',
|
||||
'footer.menu': 'เมนู',
|
||||
'footer.popular': 'สายที่ค้นหาบ่อยที่สุด',
|
||||
'footer.popstops': 'ป้ายยอดนิยม',
|
||||
'footer.contact': 'ติดต่อ',
|
||||
'footer.about': 'รวมป้ายขึ้น-ลงรถทุกจุดในจังหวัดอ่างทองและจังหวัดใกล้เคียง พร้อมตำแหน่งและสายรถที่ผ่าน',
|
||||
'footer.sponsors': 'ผู้สนับสนุน & พาร์ทเนอร์',
|
||||
'footer.sponsorsLead': 'จองตั๋ว · สั่งของ · เช็กของฝาก ที่ร้านค้าและบริการพันธมิตรของเรา',
|
||||
|
||||
// หน้าแรก
|
||||
'home.welcome': 'ยินดีต้อนรับ',
|
||||
'home.title1': 'สถานีขนส่งผู้โดยสารภายใน',
|
||||
'home.provincePrefix': 'จังหวัด',
|
||||
'home.lead': 'ดูสายรถ, ค้นหาป้าย และเปิดตัวอย่างเส้นทางได้ทันทีจากหน้าแรก',
|
||||
'home.chooseProvince': 'เลือกจังหวัด',
|
||||
'home.chooseStation': 'เลือกสถานีขนส่งผู้โดยสาร',
|
||||
'share.label': 'แชร์ลิงก์สั้น',
|
||||
'share.copied': 'คัดลอกลิงก์แล้ว',
|
||||
'share.short': 'ลิงก์สั้น',
|
||||
'share.line': 'แชร์ผ่าน LINE',
|
||||
'home.stationEmpty': '— ยังไม่มีสถานีขนส่งในจังหวัดนี้ —',
|
||||
'home.stationEmptyHint': 'ยังไม่มีสถานีขนส่งผู้โดยสารในจังหวัด',
|
||||
'home.stationCount': 'มี <b>{n}</b> สถานีขนส่งในจังหวัด',
|
||||
'zone.bangkok': 'หมวดเส้นทางเข้ากรุงเทพฯ',
|
||||
'zone.bangkokDesc': 'เส้นทางเชื่อมต่อกรุงเทพมหานคร',
|
||||
'zone.interprov': 'หมวดเส้นทางระหว่างจังหวัด',
|
||||
'zone.interprovDesc': 'เส้นทางเชื่อมต่อจังหวัดใกล้เคียง',
|
||||
'zone.inprov': 'หมวดเส้นทางภายในจังหวัด',
|
||||
'zone.inprovDesc': 'เส้นทางภายในจังหวัดอ่างทอง',
|
||||
'card.schedule': 'ดูตาราง',
|
||||
'card.nextTrip': 'เที่ยวถัดไป',
|
||||
'card.noSchedule': 'ยังไม่มีตาราง',
|
||||
|
||||
// ป้ายหยุดรถ
|
||||
'stops.title': 'ค้นหาป้ายหยุดรถแบบรวดเร็ว',
|
||||
'stops.subtitle': 'รวมสถานีขนส่งหลัก จุดจอดท้องถิ่น สถานีรถตู้ และจุดเอกชน — ใช้งานได้ทั้งบนมือถือและเดสก์ท็อป',
|
||||
'stops.kpi.total': 'จำนวนจุดทั้งหมด',
|
||||
'stops.kpi.coverage': 'ครอบคลุม',
|
||||
'stops.kpi.types': 'ประเภทหลัก',
|
||||
'stops.kpi.routes': 'เที่ยวใช้งานบ่อย',
|
||||
'stops.searchPh': 'ค้นหาชื่อสถานที่ เช่น บขส.อ่างทอง',
|
||||
'stops.filterProvince': 'กรองตามจังหวัด',
|
||||
'stops.allProvinces': 'ทุกจังหวัด',
|
||||
'stops.allTypes': 'ทุกประเภท',
|
||||
'stops.mapTitle': 'แผนที่ย่อของเครือข่ายป้าย',
|
||||
'stops.onMap': 'บนแผนที่',
|
||||
'stops.kpi.places': 'สถานที่สำคัญ',
|
||||
'stops.kpi.buses': 'สายที่ผ่านมากสุด',
|
||||
'stops.unitPoints': 'จุด',
|
||||
'stops.unitPlaces': 'แห่ง',
|
||||
'stops.unitTypes': 'ประเภท',
|
||||
'stops.unitRoutes': 'สายทางหลวง',
|
||||
'stops.highway': 'ทางหลวง',
|
||||
'stops.busPrefix': 'สาย',
|
||||
'stops.viewSchedule': 'ดูตารางเวลาสาย {n}',
|
||||
'stops.viewRoute': 'ดูรายละเอียดสาย {n}',
|
||||
'stops.noBusLine': 'ยังไม่ระบุสายรถ',
|
||||
'stops.modeCode': 'ค้นหาด้วยรหัสป้าย',
|
||||
'stops.modePlace': 'ค้นหาด้วยชื่อสถานที่',
|
||||
'stops.codePh': '3+000',
|
||||
'stops.codeHint': 'พิมพ์ตัวเลข 4 หลัก ระบบจะเติมเครื่องหมาย + ให้อัตโนมัติ (เช่น 3000 → 3+000)',
|
||||
'stops.codeHintBox': 'พิมพ์ตัวเลขในช่อง ระบบจะเติม 0 ให้อัตโนมัติเมื่อเว้นว่าง และถ้าเจอรหัส 4 หลัก เช่น 8+591 ให้กรอก 08+591',
|
||||
'stops.codeFull': 'รหัสป้าย:',
|
||||
'stops.placePh': 'โรงพยาบาลอ่างทอง',
|
||||
'stops.placeHint': 'พิมพ์ชื่อสถานที่สำคัญ เช่น โรงพยาบาล สำนักงานที่ดิน แล้วเลือกรายการที่ตรงกัน',
|
||||
'stops.padDelete': 'ลบ',
|
||||
'stops.reset': 'ล้างค่า',
|
||||
'stops.section': 'ตอน',
|
||||
'stops.showing': 'แสดง {a} จาก {b} ป้าย',
|
||||
'stops.showAll': 'แสดงป้ายทั้งหมด',
|
||||
'stops.noResult': 'ไม่พบป้ายหยุดรถที่ตรงกับเงื่อนไข',
|
||||
'stops.loading': 'กำลังโหลดข้อมูลป้าย…',
|
||||
'type.terminal': 'สถานีขนส่งผู้โดยสาร',
|
||||
'type.station': 'ป้ายหลัก',
|
||||
'type.pickup': 'จุดรับส่ง',
|
||||
'type.market': 'ตลาด/ชุมชน',
|
||||
'type.landmark': 'จุดสังเกต',
|
||||
|
||||
// รายละเอียดสายรถ / ตารางขยาย
|
||||
'route.badge': 'สายระหว่างจังหวัด',
|
||||
'route.kpiProvince': 'จังหวัด',
|
||||
'route.kpiStops': 'จุดจอด',
|
||||
'route.kpiTrips': 'รอบเวลา',
|
||||
'route.overview': 'ภาพรวมของสาย',
|
||||
'route.contact': 'ติดต่อผู้ประกอบการ',
|
||||
'route.call': 'โทรสอบถาม',
|
||||
'route.openLink': 'เปิดลิงก์',
|
||||
'route.link.facebook': 'Facebook',
|
||||
'route.link.line': 'LINE Official',
|
||||
'route.link.www': 'เว็บไซต์',
|
||||
'route.vehicle': 'รถบัสประจำสาย',
|
||||
'route.mapTitle': 'เส้นทางเดินรถ',
|
||||
'route.photos': 'รูปรถประจำเส้นทางในเครือข่าย',
|
||||
'route.stopsTitle': 'จุดจอดสำคัญบนเส้นทาง',
|
||||
'route.scheduleTitle': 'ตารางเวลา',
|
||||
'route.selectRoute': 'เลือกสายรถ',
|
||||
'route.selectStation': 'เลือกสถานี',
|
||||
'route.origin': 'ต้นทาง',
|
||||
'route.transfer': 'จุดเปลี่ยน',
|
||||
'route.pass': 'ผ่านทาง',
|
||||
'route.destination': 'ปลายทาง',
|
||||
'route.direction': 'ทุกทิศทาง',
|
||||
'route.empty': 'ยังไม่มีข้อมูลตารางเวลา',
|
||||
'route.noSchedule': '— ยังไม่มีรอบ —',
|
||||
'route.seeOther': 'เลือกสายรถอื่น',
|
||||
|
||||
// ป้ายรายละเอียด
|
||||
'stop.code': 'รหัส:',
|
||||
'stop.nearby': 'ใกล้เคียงป้าย',
|
||||
'stop.routes': 'สายรถที่ผ่านจุดนี้',
|
||||
'stop.searchRoute': 'ค้นหาสายรถหรือปลายทาง',
|
||||
'stop.showing': 'แสดง {a} จาก {b} สาย',
|
||||
'stop.mapInfo': 'แผนที่และข้อมูลป้าย',
|
||||
'stop.nextArrival': 'เที่ยวถัดไป',
|
||||
'stop.subGeneric': 'จุดจอดใน{city} · ดูเวลารถทุกสายที่ผ่านป้ายนี้ได้ในหน้าเดียว',
|
||||
'stop.thisStop': 'ป้ายนี้',
|
||||
'stop.statRoutes': 'จำนวนสายรถ',
|
||||
'stop.statTrips': 'เที่ยวต่อวัน',
|
||||
'stop.statHours': 'เวลาบริการ',
|
||||
'stop.statType': 'ประเภท',
|
||||
'stop.nRoutes': '{n} สาย',
|
||||
'stop.tripsPerDay': '{n} รอบ/วัน',
|
||||
'stop.tripsPerDay1': '{n} รอบ/วัน',
|
||||
'stop.nRoutes1': '{n} สาย',
|
||||
'stop.noRoutes': 'ยังไม่มีสายรถที่บันทึกว่าผ่านป้ายนี้',
|
||||
'stop.noTimes': 'ยังไม่มีข้อมูลเวลาเดินรถที่ป้ายนี้',
|
||||
'stop.tomorrow': 'พรุ่งนี้',
|
||||
'stop.nextAt': 'ถัดไป',
|
||||
'stop.notFound': 'ไม่พบป้ายนี้',
|
||||
'stop.notFoundSub': 'ไม่พบรหัสป้าย “{code}” ในระบบ — ตรวจรหัสหรือกลับไปหน้ารายการป้าย',
|
||||
'stop.nearbySub': 'สถานที่น่าสนใจและจุดแวะระหว่างรอรถ',
|
||||
'stop.otherStopsTitle': 'จุดขึ้นรถประจำทางอื่นๆ · สาย {n} ({m} จุด)',
|
||||
'stop.otherMore': '(+{n} จุด)',
|
||||
'stop.otherStopsAll': 'จุดขึ้นรถประจำทางอื่นๆ ทั้งหมด ({m} จุด)',
|
||||
'stop.noCoord': 'ยังไม่มีพิกัด',
|
||||
'stop.open': 'เปิด',
|
||||
'stop.close': 'ปิด',
|
||||
'stop.nowAtStop': 'เวลาปัจจุบัน ณ ป้ายนี้',
|
||||
'stop.autoNext': 'กำลังคำนวณเที่ยวถัดไปอัตโนมัติ',
|
||||
|
||||
// ทั่วไป
|
||||
'common.backHome': '← กลับหน้าแรก',
|
||||
'common.backStops': '← กลับไปยังรายการป้าย',
|
||||
'common.search': 'ค้นหา',
|
||||
'common.details': 'ดูรายละเอียด',
|
||||
'common.bus': 'รถบัส',
|
||||
'common.phone': 'โทร:',
|
||||
'common.noWebsite': 'ยังไม่ระบุเว็บไซต์',
|
||||
'type.van': 'สถานีรถตู้',
|
||||
'type.local': 'จุดจอดท้องถิ่น',
|
||||
'type.busstop': 'ศาลารอรถ หรือป้ายหยุดรถ',
|
||||
'type.startlocalpoint': 'ต้นทางรถสายท้องถิ่น',
|
||||
|
||||
'type.other': 'จุดขึ้นรถประจำทางอื่นๆ',
|
||||
'type.marketOpt': 'ตลาด/จุดเอกชน',
|
||||
'route.mapTitleN': 'เส้นทางเดินรถสาย {n}',
|
||||
'expanded.title': 'ตารางเวลาแบบขยายทุกจุดจอด',
|
||||
'stop.viewScheduleN': 'ดูตารางเวลาสายรถ {n}',
|
||||
'stop.openRoute': 'เปิดหน้ารายละเอียดสายรถนี้',
|
||||
'credits.title': 'เครดิตและแหล่งที่มา',
|
||||
'credits.icons': 'ไอคอน — Lucide',
|
||||
'credits.fonts': 'ฟอนต์ — Google Fonts',
|
||||
'credits.map': 'แผนที่',
|
||||
'common.back': 'ย้อนกลับ',
|
||||
'check.scheduleAll': 'ตารางเวลาเดินรถทุกจุดจอด',
|
||||
'check.title': 'ตารางเวลาเดินรถ',
|
||||
'check.lead': 'เลือกสายรถ แล้วดูรอบรถทุกจุดจอดในหน้าเดียว',
|
||||
'check.kpiStops': 'จุดจอดหลัก',
|
||||
'check.kpiProvince': 'จังหวัดที่ผ่าน',
|
||||
'check.kpiTrips': 'รอบต่อวัน',
|
||||
'check.kpiNext': 'รอบถัดไป',
|
||||
'check.direction': 'ทิศทาง',
|
||||
'check.atStop': 'ตารางเดินรถ ณ',
|
||||
'check.dayWeekday': 'Weekday timetable (Mon–Fri)',
|
||||
'check.dayHoliday': 'Weekend/holiday timetable',
|
||||
'check.dayMixed': 'This direction mixes weekday and holiday times — not split by day yet',
|
||||
'check.dayUnknown': 'Timetable day not specified (showing all days)',
|
||||
'check.dayOfWeek': 'today is',
|
||||
'time.estimated': '~ Estimated from the origin (not an operator timetable)',
|
||||
'time.derived': '~ ตารางจากการคำนวณ (จาก {base} {n} นาที) — อาจเปลี่ยนแปลงตามการจราจรจริง',
|
||||
'check.dayWeekday': 'ตารางวันทำงาน (จ–ศ)',
|
||||
'check.dayHoliday': 'ตารางวันหยุด (ส–อา/นักขัตฤกษ์)',
|
||||
'check.dayMixed': 'ทิศนี้มีทั้งตารางวันทำงานและวันหยุดในตัวเดียวกัน — ยังไม่แยกตามวัน',
|
||||
'check.dayUnknown': 'ยังไม่ระบุวันของตาราง (แสดงทุกวัน)',
|
||||
'check.dayOfWeek': 'วันนี้',
|
||||
'time.estimated': '~ เวลาคำนวณจากต้นทาง (ประมาณ — ไม่ใช่ตารางของผู้ประกอบการ)',
|
||||
'time.derived': '~ Computed timetable (from {base} {n} min) — may change with real traffic conditions',
|
||||
'check.now': 'เวลาปัจจุบัน',
|
||||
'check.nextAt': 'เที่ยวถัดไป',
|
||||
'check.noMoreToday': 'ไม่มีรถเหลือในวันนี้แล้ว',
|
||||
'check.stopsCount': 'จุดจอด',
|
||||
'check.toStopDetail': 'ไปหน้ารายละเอียดจุดจอด',
|
||||
'common.routes': 'เส้นทาง',
|
||||
},
|
||||
|
||||
/* ============ English ============ */
|
||||
en: {
|
||||
'brand.subtitle': 'Ang Thong Provincial Bus Terminal',
|
||||
'nav.home': 'Home',
|
||||
'nav.stops': 'Bus Stops',
|
||||
'nav.routes': 'Route Details',
|
||||
'nav.expanded': 'Expanded',
|
||||
'nav.credits': 'Credits',
|
||||
'nav.about': 'About',
|
||||
'nav.blog': 'Blog',
|
||||
'about.title': 'About Us',
|
||||
'about.brand': 'When will the bus come?',
|
||||
'about.lead': 'Our story — read through the blocks below.',
|
||||
'blog.title': 'Blog',
|
||||
'blog.subtitle': 'News & travel know-how',
|
||||
'blog.lead': 'Route news, timetable updates and useful tips — switch between grid and list view.',
|
||||
'blog.viewGrid': 'Grid',
|
||||
'blog.viewList': 'List',
|
||||
'blog.count': 'All posts',
|
||||
'blog.items': 'posts',
|
||||
'blog.minRead': 'min read',
|
||||
'blog.readMore': 'Read more',
|
||||
'blog.backList': 'Back to all posts',
|
||||
'blog.empty': 'No posts yet — add files under ui/partials/blog-data/',
|
||||
'blog.notFound': 'Post not found',
|
||||
// Card colours by route group
|
||||
'legend.title': 'Card colours by route group',
|
||||
'legend.bangkok': 'Bangkok routes — blue card',
|
||||
'legend.interprov': 'Inter-provincial routes — purple card',
|
||||
'legend.inprov': 'In-province routes — pink card',
|
||||
'legend.municipal': 'Municipal routes — light yellow card',
|
||||
'legend.empty': 'No data yet — grey card showing N/A instead of a route number',
|
||||
'legend.note': 'Ang Thong has no group 1 (municipal) services yet, so the card is grey and shows N/A in place of the route number',
|
||||
'zone.municipal': 'Municipal routes',
|
||||
'zone.municipalDesc': 'Routes inside municipal areas',
|
||||
'zone.municipalNA': 'No municipal routes in Ang Thong yet',
|
||||
'card.noData': 'No data yet',
|
||||
// Route map (Leaflet + GeoJSON)
|
||||
'route.mapDesc': 'Real geometry from our GIS data · stops along the route',
|
||||
'map.origin': 'Origin',
|
||||
'map.destination': 'Destination',
|
||||
'map.offline': 'Offline — route only',
|
||||
'map.empty': 'No route geometry for this service yet',
|
||||
'map.legendRoute': 'Route',
|
||||
'map.legendStop': 'Bus stop',
|
||||
'map.legendTerminal': 'Bus terminal',
|
||||
'map.route': 'Route',
|
||||
'map.noStationPin': 'stop coordinates not in the system yet — showing serving routes',
|
||||
'map.captionRoute': 'Route length {km} km · {n} stops along the route',
|
||||
'map.captionStop': 'Routes serving this stop: {r} · {n} stops along the route',
|
||||
'map.stations': 'terminals along route',
|
||||
'map.stationPinned': 'stop location pinned on the map',
|
||||
'map.thisStop': 'the stop you are viewing',
|
||||
'map.legendHere': 'This stop',
|
||||
'map.noRoutesHere': 'No routes recorded for this stop yet',
|
||||
'map.servedBy': 'Routes served',
|
||||
'map.openInMaps': 'Open in Google Maps',
|
||||
'map.viewStopPage': 'View this stop',
|
||||
'map.km': 'km',
|
||||
'map.offRoute': 'off route',
|
||||
'map.alongRoute': 'Stops along the route (km from origin)',
|
||||
'map.useMyLocation': 'Stops near me',
|
||||
'map.locating': 'Finding your location…',
|
||||
'map.geoDenied': 'Location permission denied — allow it in your browser and try again',
|
||||
'map.noGeo': 'This browser does not support geolocation',
|
||||
'map.nearestTitle': 'Stops closest to you',
|
||||
'map.youAreHere': 'Your location',
|
||||
'cta.check': 'Check Schedules',
|
||||
'footer.menu': 'Menu',
|
||||
'footer.popular': 'Most Searched Routes',
|
||||
'footer.popstops': 'Popular Stops',
|
||||
'footer.contact': 'Contact',
|
||||
'footer.about': 'Every bus stop in Ang Thong and nearby provinces — locations and routes served.',
|
||||
'footer.sponsors': 'Sponsors & Partners',
|
||||
'footer.sponsorsLead': 'Book tickets · shop · grab souvenirs at our partner stores',
|
||||
|
||||
'home.welcome': 'Welcome',
|
||||
'home.title1': 'Ang Thong Provincial',
|
||||
'home.provincePrefix': '',
|
||||
'home.lead': 'Browse routes, find stops, and preview a route right from this page',
|
||||
'home.chooseProvince': 'Select Province',
|
||||
'home.chooseStation': 'Select Terminal',
|
||||
'share.label': 'Share short link',
|
||||
'share.copied': 'Link copied',
|
||||
'share.short': 'Short link',
|
||||
'share.line': 'Share on LINE',
|
||||
'home.stationEmpty': '— No terminals in this province —',
|
||||
'home.stationEmptyHint': 'No bus terminal in',
|
||||
'home.stationCount': '<b>{n}</b> terminals in',
|
||||
'zone.bangkok': 'To Bangkok',
|
||||
'zone.bangkokDesc': 'Routes to Bangkok',
|
||||
'zone.interprov': 'Inter-province',
|
||||
'zone.interprovDesc': 'Routes to nearby provinces',
|
||||
'zone.inprov': 'Within Ang Thong',
|
||||
'zone.inprovDesc': 'Routes inside Ang Thong',
|
||||
'card.schedule': 'Schedule',
|
||||
'card.nextTrip': 'Next trip',
|
||||
'card.noSchedule': 'No schedule',
|
||||
|
||||
'stops.title': 'Find bus stops quickly and easily',
|
||||
'stops.subtitle': 'All major terminals, local stops, van stations and private stops — mobile and desktop friendly',
|
||||
'stops.kpi.total': 'Total stops',
|
||||
'stops.kpi.coverage': 'Coverage',
|
||||
'stops.kpi.types': 'Main types',
|
||||
'stops.kpi.routes': 'Popular departures',
|
||||
'stops.searchPh': 'Search a place, e.g. Ang Thong terminal',
|
||||
'stops.filterProvince': 'Filter by province',
|
||||
'stops.allProvinces': 'All provinces',
|
||||
'stops.allTypes': 'All types',
|
||||
'stops.mapTitle': 'Stop network map',
|
||||
'stops.onMap': 'On map',
|
||||
'stops.kpi.places': 'Key places',
|
||||
'stops.kpi.buses': 'Busiest bus line',
|
||||
'stops.unitPoints': 'stops',
|
||||
'stops.unitPlaces': 'places',
|
||||
'stops.unitTypes': 'types',
|
||||
'stops.unitRoutes': 'highways',
|
||||
'stops.highway': 'Highway',
|
||||
'stops.busPrefix': 'Route',
|
||||
'stops.viewSchedule': 'View schedule for route {n}',
|
||||
'stops.viewRoute': 'View route {n}',
|
||||
'stops.noBusLine': 'No bus line listed',
|
||||
'stops.modeCode': 'Search by stop code',
|
||||
'stops.modePlace': 'Search by place name',
|
||||
'stops.codePh': '3+000',
|
||||
'stops.codeHint': 'Type 4 digits and the + sign is added automatically (e.g. 3000 → 3+000)',
|
||||
'stops.codeHintBox': 'Type digits in the boxes — empty boxes are filled with 0 automatically. For 4-digit codes such as 8+591, enter 08+591',
|
||||
'stops.codeFull': 'Stop code:',
|
||||
'stops.placePh': 'Ang Thong Hospital',
|
||||
'stops.placeHint': 'Type a place name such as a hospital or land office, then pick a match',
|
||||
'stops.padDelete': 'Del',
|
||||
'stops.reset': 'Clear',
|
||||
'stops.section': 'Section',
|
||||
'stops.showing': 'Showing {a} of {b} stops',
|
||||
'stops.showAll': 'Show all stops',
|
||||
'stops.noResult': 'No stops match your search',
|
||||
'stops.loading': 'Loading stop data…',
|
||||
'type.terminal': 'Passenger terminal',
|
||||
'type.station': 'Major stop',
|
||||
'type.pickup': 'Pickup point',
|
||||
'type.market': 'Market / community',
|
||||
'type.landmark': 'Landmark',
|
||||
|
||||
'route.badge': 'Inter-province route',
|
||||
'route.kpiProvince': 'provinces',
|
||||
'route.kpiStops': 'stops',
|
||||
'route.kpiTrips': 'trips',
|
||||
'route.overview': 'Route overview',
|
||||
'route.contact': 'Contact operator',
|
||||
'route.call': 'Call us',
|
||||
'route.openLink': 'Open link',
|
||||
'route.link.facebook': 'Facebook',
|
||||
'route.link.line': 'LINE Official',
|
||||
'route.link.www': 'Website',
|
||||
'route.vehicle': 'Route vehicle',
|
||||
'route.mapTitle': 'Route map',
|
||||
'route.photos': 'Buses on this network',
|
||||
'route.stopsTitle': 'Stops along the route',
|
||||
'route.scheduleTitle': 'Schedule',
|
||||
'route.selectRoute': 'Select route',
|
||||
'route.selectStation': 'Select station',
|
||||
'route.origin': 'Origin',
|
||||
'route.transfer': 'Transfer',
|
||||
'route.pass': 'Passing',
|
||||
'route.destination': 'Destination',
|
||||
'route.direction': 'All directions',
|
||||
'route.empty': 'No schedule data yet',
|
||||
'route.noSchedule': '— No trips yet —',
|
||||
'route.seeOther': 'Other routes',
|
||||
|
||||
'stop.code': 'Code:',
|
||||
'stop.nearby': 'Nearby',
|
||||
'stop.routes': 'Routes through this stop',
|
||||
'stop.searchRoute': 'Search route or destination',
|
||||
'stop.showing': 'Showing {a} of {b} routes',
|
||||
'stop.mapInfo': 'Map & stop info',
|
||||
'stop.nextArrival': 'Next arrival',
|
||||
'stop.subGeneric': 'A stop in {city} · see every route that passes here on one page',
|
||||
'stop.thisStop': 'this stop',
|
||||
'stop.statRoutes': 'Routes',
|
||||
'stop.statTrips': 'Departures/day',
|
||||
'stop.statHours': 'Service hours',
|
||||
'stop.statType': 'Type',
|
||||
'stop.nRoutes': '{n} routes',
|
||||
'stop.tripsPerDay': '{n} trips/day',
|
||||
'stop.tripsPerDay1': '{n} trip/day',
|
||||
'stop.nRoutes1': '{n} route',
|
||||
'stop.noRoutes': 'No routes recorded for this stop yet',
|
||||
'stop.noTimes': 'No departure times for this stop yet',
|
||||
'stop.tomorrow': 'Tomorrow',
|
||||
'stop.nextAt': 'Next',
|
||||
'stop.notFound': 'Stop not found',
|
||||
'stop.notFoundSub': 'No stop with code “{code}” — check the code or go back to the stop list',
|
||||
'stop.nearbySub': 'Places of interest and stops to wait for your bus',
|
||||
'stop.otherStopsTitle': 'Other boarding points · route {n} ({m} stops)',
|
||||
'stop.otherMore': '(+{n} stops)',
|
||||
'stop.otherStopsAll': 'All other boarding points ({m} stops)',
|
||||
'stop.noCoord': 'No coordinates yet',
|
||||
'stop.open': 'Open',
|
||||
'stop.close': 'Close',
|
||||
'stop.nowAtStop': 'Current time at this stop',
|
||||
'stop.autoNext': 'Next departure is calculated automatically',
|
||||
|
||||
'common.backHome': '← Back to home',
|
||||
'common.backStops': '← Back to stops',
|
||||
'common.search': 'Search',
|
||||
'common.details': 'Details',
|
||||
'common.bus': 'Bus',
|
||||
'common.phone': 'Call:',
|
||||
'common.noWebsite': 'No website listed',
|
||||
'type.van': 'Van station',
|
||||
'type.local': 'Local stop',
|
||||
'type.busstop': 'Bus shelter / stop',
|
||||
'type.startlocalpoint': 'Local route origin',
|
||||
|
||||
'type.other': 'Other boarding points',
|
||||
'type.marketOpt': 'Market / private stop',
|
||||
'route.mapTitleN': 'Route {n} map',
|
||||
'expanded.title': 'Full schedule for every stop',
|
||||
'stop.viewScheduleN': 'View schedule of route {n}',
|
||||
'stop.openRoute': 'Open route details',
|
||||
'credits.title': 'Credits & Sources',
|
||||
'credits.icons': 'Icons — Lucide',
|
||||
'credits.fonts': 'Fonts — Google Fonts',
|
||||
'credits.map': 'Maps',
|
||||
'common.back': 'Back',
|
||||
'check.scheduleAll': 'Departure times at every stop',
|
||||
'check.title': 'Departure Schedule',
|
||||
'check.lead': 'Pick a route to see every stop\u2019s departures on one page',
|
||||
'check.kpiStops': 'Main stops',
|
||||
'check.kpiProvince': 'Provinces',
|
||||
'check.kpiTrips': 'Trips per day',
|
||||
'check.kpiNext': 'Next departure',
|
||||
'check.direction': 'Direction',
|
||||
'check.atStop': 'Departures at',
|
||||
'check.now': 'Current time',
|
||||
'check.nextAt': 'Next departure',
|
||||
'check.noMoreToday': 'No departures left today',
|
||||
'check.stopsCount': 'stops',
|
||||
'check.toStopDetail': 'View stop detail',
|
||||
'common.routes': 'routes',
|
||||
},
|
||||
};
|
||||
var CACHE = {}; /* lang -> dict */
|
||||
var current = detect();
|
||||
var resolveReady;
|
||||
var ready = new Promise(function (r) { resolveReady = r; });
|
||||
|
||||
/* ---------- ตรวจจับภาษาเริ่มต้น ---------- */
|
||||
function detect() {
|
||||
@@ -530,15 +35,25 @@
|
||||
var saved = localStorage.getItem(LS_KEY);
|
||||
if (saved && SUPPORTED.indexOf(saved) !== -1) return saved;
|
||||
} catch (e) { /* localStorage ไม่พร้อมใช้งาน */ }
|
||||
var nav = (navigator.language || 'th').toLowerCase();
|
||||
return nav.indexOf('en') === 0 ? 'en' : 'th';
|
||||
var nav = (navigator.language || BASE).toLowerCase();
|
||||
return nav.indexOf('en') === 0 ? 'en' : BASE;
|
||||
}
|
||||
|
||||
var current = detect();
|
||||
/* ---------- โหลดไฟล์ภาษา (cache ต่อภาษา · ล้มเหลว = {} ไม่ให้พัง) ---------- */
|
||||
function dict(lang) {
|
||||
if (CACHE[lang]) return Promise.resolve(CACHE[lang]);
|
||||
return fetch(DIR + lang + '.json', { cache: 'no-store' })
|
||||
.then(function (r) { return r.ok ? r.json() : {}; })
|
||||
.then(function (d) { CACHE[lang] = d || {}; return CACHE[lang]; })
|
||||
.catch(function () { CACHE[lang] = {}; return CACHE[lang]; });
|
||||
}
|
||||
function loaded() { return !!(CACHE[current] || CACHE[BASE]); }
|
||||
|
||||
/* ---------- แปลข้อความ ---------- */
|
||||
function t(key, vars) {
|
||||
var lang = DICT[current] || DICT.th;
|
||||
var val = lang[key] !== undefined ? lang[key] : DICT.th[key];
|
||||
var cur = CACHE[current], bak = CACHE[BASE];
|
||||
var val = (cur && cur[key] !== undefined) ? cur[key]
|
||||
: (bak && bak[key] !== undefined) ? bak[key] : undefined;
|
||||
if (val === undefined) return key;
|
||||
if (vars) {
|
||||
Object.keys(vars).forEach(function (k) {
|
||||
@@ -550,6 +65,7 @@
|
||||
|
||||
/* ---------- ใช้คำแปลกับ element ---------- */
|
||||
function apply(root) {
|
||||
if (!loaded()) return; /* ยังไม่มีคำแปล → คงข้อความ fallback ใน HTML */
|
||||
var scope = root || document;
|
||||
|
||||
scope.querySelectorAll('[data-i18n]').forEach(function (el) {
|
||||
@@ -575,19 +91,22 @@
|
||||
|
||||
document.documentElement.lang = current;
|
||||
|
||||
// ไฮไลต์ปุ่มภาษาที่ active
|
||||
/* ไฮไลต์ปุ่มภาษาที่ active */
|
||||
document.querySelectorAll('[data-i18n-switch]').forEach(function (btn) {
|
||||
btn.classList.toggle('active', btn.getAttribute('data-i18n-switch') === current);
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- สลับภาษา ---------- */
|
||||
/* ---------- สลับภาษา (โหลดไฟล์ภาษาก่อน แล้วค่อยบอกให้หน้าวาดใหม่) ---------- */
|
||||
function setLang(lang) {
|
||||
if (SUPPORTED.indexOf(lang) === -1) lang = 'th';
|
||||
if (lang === current) return;
|
||||
if (SUPPORTED.indexOf(lang) === -1) lang = BASE;
|
||||
if (lang === current) return Promise.resolve(current);
|
||||
current = lang;
|
||||
try { localStorage.setItem(LS_KEY, lang); } catch (e) {}
|
||||
window.dispatchEvent(new CustomEvent('langchange', { detail: lang }));
|
||||
return dict(current).then(function () {
|
||||
window.dispatchEvent(new CustomEvent('langchange', { detail: lang }));
|
||||
return lang;
|
||||
});
|
||||
}
|
||||
|
||||
window.I18N = {
|
||||
@@ -596,6 +115,8 @@
|
||||
setLang: setLang,
|
||||
getLang: function () { return current; },
|
||||
langs: SUPPORTED,
|
||||
default: BASE, /* ภาษาที่ใช้เมื่อคีย์ขาด */
|
||||
ready: ready, /* Promise — รอคำแปลโหลดเสร็จก่อนวาดหน้าแรก */
|
||||
};
|
||||
|
||||
/* ปุ่มสลับภาษา [data-i18n-switch] — ฟังคลิกทั่วทั้งหน้า */
|
||||
@@ -603,4 +124,10 @@
|
||||
var btn = e.target.closest('[data-i18n-switch]');
|
||||
if (btn) setLang(btn.getAttribute('data-i18n-switch'));
|
||||
});
|
||||
|
||||
/* โหลดภาษาปัจจุบัน (+ ภาษาตั้งต้นสำหรับ fallback) แล้วจึงพร้อมใช้งาน */
|
||||
Promise.all([dict(BASE), dict(current)]).then(function () {
|
||||
apply();
|
||||
resolveReady();
|
||||
});
|
||||
})();
|
||||
@@ -0,0 +1,31 @@
|
||||
/* ============================================================
|
||||
Atroute — ตัวช่วยเติมเวอร์ชันให้ URL รูป (cache busting)
|
||||
------------------------------------------------------------
|
||||
ปัญหา: SW ใช้ cache-first กับรูป → อัปรูปทับชื่อเดิมแล้วไม่เห็นรูปใหม่
|
||||
วิธีแก้ (แนวทาง B2): เติม ?v=<SW VERSION> ต่อท้าย URL รูปทุกตัว
|
||||
→ bump VERSION ใน sw.js = รูปทั้งหมดโหลดใหม่พร้อมกัน
|
||||
|
||||
ใช้: ImgURL.of(url) → '../.image/x.jpg?v=2026.09.27.23'
|
||||
ImgURL.version() → '2026.09.27.23'
|
||||
============================================================ */
|
||||
(function () {
|
||||
'use strict';
|
||||
var V = null; /* cache ของเวอร์ชัน */
|
||||
|
||||
function version() {
|
||||
if (V) return V;
|
||||
/* อ่านเวอร์ชันจาก <meta name="app-version"> ถ้ามี (set ใน index.html) */
|
||||
var m = document.querySelector('meta[name="app-version"]');
|
||||
V = (m && m.content) ? m.content : '0';
|
||||
return V;
|
||||
}
|
||||
/* เติม ?v= ให้ URL รูป (ข้าม URL ภายนอก/ไฟล์ข้อมูล/ที่เติม ?v= แล้ว) */
|
||||
function of(url) {
|
||||
var u = String(url == null ? '' : url);
|
||||
if (!u || u.indexOf('data:') === 0 || u.indexOf('blob:') === 0) return u;
|
||||
if (u.indexOf('//') === 0 || /^https?:\/\//i.test(u)) return u; /* URL เต็ม/ภายนอก — ไม่แตะ */
|
||||
if (/[?&]v=/.test(u)) return u;
|
||||
return u + (u.indexOf('?') > -1 ? '&' : '?') + 'v=' + encodeURIComponent(version());
|
||||
}
|
||||
window.ImgURL = { of: of, version: version };
|
||||
})();
|
||||
+22
-9
@@ -4,12 +4,16 @@
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
||||
<title>หน้าแรก | Atroute (mockup)</title>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Prompt:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<!-- ฟอนต์หลัก K2D: ไฟล์ในโปรเจกต์ (ui/vendor/fonts/) — ทำงานออฟไลน์ได้ -->
|
||||
<link href="./vendor/fonts/k2d.css" rel="stylesheet">
|
||||
<!-- ตัวสำรอง (โหลดจาก CDN เมื่อออนไลน์เท่านั้น · ออฟไลน์ถอยไปใช้ system-ui) -->
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700;800&family=Prompt:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||
<link href="../../frontend-web-transit/web-transit/css/main-theme.css" rel="stylesheet">
|
||||
<link href="./_shared.css" rel="stylesheet">
|
||||
<link href="./vendor/leaflet/leaflet.css" rel="stylesheet">
|
||||
<link href="./map.css" rel="stylesheet">
|
||||
<link rel="icon" type="image/png" href="../.image/icons/minibus-512x512.png">
|
||||
<meta name="app-version" content="2026.09.27.74">
|
||||
<link rel="icon" type="image/png" href="../.image/icons/minibus-512x512.png?v=2026.09.27.74">
|
||||
<style>
|
||||
.mu-card.empty { width: 100%; padding: 16px; text-align: center; color: #6f7b95; background: #fff7fb; border: 1px dashed #f4c7df; }
|
||||
a.mu-card { text-decoration: none; color: inherit; display: block; }
|
||||
@@ -62,7 +66,7 @@
|
||||
.mu-route-name { margin: 0 0 10px; font-size: .95rem; color: #1f2a44; font-weight: 700; }
|
||||
|
||||
/* ===== maintheme.png look: topbar, hero, zones, grid, summary, footer ===== */
|
||||
body.main-theme-page { margin: 0; font-family: 'Noto Sans Thai','Prompt',system-ui,sans-serif; color: #1f2a44; background: #f7f9fd; }
|
||||
body.main-theme-page { margin: 0; font-family: 'K2D','Noto Sans Thai','Prompt',system-ui,sans-serif; color: #1f2a44; background: #f7f9fd; }
|
||||
.mu-container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
|
||||
|
||||
/* Topbar */
|
||||
@@ -174,7 +178,7 @@
|
||||
/* Zones / grid */
|
||||
main.mu-container { padding-top: 40px; padding-bottom: 40px; }
|
||||
.mu-zone { margin-bottom: 32px; }
|
||||
.mu-zone-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
|
||||
.mu-zone-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-bottom: 14px; }
|
||||
.mu-zone-tag { padding: 5px 14px; border-radius: 999px; font-size: .82rem; font-weight: 700; }
|
||||
.mu-zone-tag.tag-sky { background: #dbeafe; color: #1d4ed8; }
|
||||
.mu-zone-tag.tag-pink { background: #fce7f3; color: #be185d; }
|
||||
@@ -194,6 +198,13 @@
|
||||
.sw-empty { background: #e4e7eb; }
|
||||
.mu-legend-note { margin: 12px 0 0; color: #6f7b95; font-size: .82rem; }
|
||||
.mu-zone-sub, .mu-zone-desc { color: #6f7b95; font-size: .88rem; margin: 0; }
|
||||
/* ทุกบรรทัดคำอธิบายกินเต็มความกว้างของตัวเอง — ไม่ถูกบีบไปรวมแถวเดียวกับป้ายหัวข้อ
|
||||
(เดิม flex ไม่มี wrap → ทุกบรรทัดถูกย่อรวมกันหมด ข้อความไทยจึงตัดคำมั่ว) */
|
||||
.mu-zone-head .mu-zone-desc { flex-basis: 100%; min-width: 0; line-height: 1.65; }
|
||||
|
||||
/* แถวข้อมูลแบบ "ชิ้น" (segment) — กฎจริงอยู่ใน responsive.css (#view …) เพราะต้องชนะ
|
||||
<style> ของ partial ที่ถูก inject ทีหลัง · ที่นี่เก็บเฉพาะสีที่ใช้ร่วมทุกหน้า */
|
||||
.mu-zone-updated { color: #8a7aa8; }
|
||||
.mu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }
|
||||
|
||||
/* Cards */
|
||||
@@ -299,8 +310,9 @@
|
||||
<meta name="theme-color" content="#7a4cc0">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
||||
<link rel="apple-touch-icon" href="../.image/icons/minibus-192x192.png">
|
||||
<script src="./pwa.js" defer></script>
|
||||
<link rel="apple-touch-icon" href="../.image/icons/minibus-192x192.png?v=2026.09.27.74">
|
||||
<script src="./imageurl.js" defer></script>
|
||||
<script src="./pwa.js" defer></script>
|
||||
<script src="./i18n.js" defer></script>
|
||||
<script src="./vendor/leaflet/leaflet.js" defer></script>
|
||||
<script src="./map.js" defer></script>
|
||||
@@ -319,6 +331,7 @@
|
||||
<path d="M6.38 18.7 4 21" />
|
||||
<path d="M17.64 18.67 20 21" />
|
||||
</symbol>
|
||||
<symbol id="ic-x" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></symbol>
|
||||
<symbol id="ic-arrow-right" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M5 12h14" />
|
||||
<path d="m12 5 7 7-7 7" />
|
||||
@@ -394,12 +407,13 @@
|
||||
<symbol id="ic-share-2" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"/><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"/></symbol>
|
||||
<symbol id="ic-link" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></symbol>
|
||||
<symbol id="ic-facebook" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"/></symbol>
|
||||
<symbol id="ic-copy" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/></symbol>
|
||||
</svg>
|
||||
|
||||
<header class="mu-topbar">
|
||||
<div class="mu-container mu-topbar-inner">
|
||||
<a class="mu-brand" href="#/" aria-label="Atroute — หน้าแรก">
|
||||
<img class="mu-logo-img" src="../.image/icons/minibus-512x512.png" alt="Atroute logo" width="44" height="44" decoding="async">
|
||||
<img class="mu-logo-img" src="../.image/icons/minibus-512x512.png?v=2026.09.27.74" alt="Atroute logo" width="44" height="44" decoding="async">
|
||||
<span>
|
||||
<span class="mu-brand-title">Atroute</span>
|
||||
<span class="mu-brand-subtitle" data-i18n="brand.subtitle">สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง</span>
|
||||
@@ -442,7 +456,7 @@
|
||||
<div class="mu-footer-grid">
|
||||
<div class="mu-footer-brand">
|
||||
<div class="mu-footer-brand-row">
|
||||
<img src="../.image/icons/minibus-512x512.png" alt="Atroute">
|
||||
<img src="../.image/icons/minibus-512x512.png?v=2026.09.27.74" alt="Atroute">
|
||||
<div>
|
||||
<strong>Atroute</strong>
|
||||
<span data-i18n="brand.subtitle">สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง</span>
|
||||
@@ -456,7 +470,6 @@
|
||||
<li><a href="#/" data-i18n="nav.home">หน้าแรก</a></li>
|
||||
<li><a href="#/stops" data-i18n="nav.stops">ค้นหาป้ายหยุดรถ</a></li>
|
||||
<li><a href="#/routes" data-i18n="nav.routes">รายละเอียดสายรถ</a></li>
|
||||
<li><a href="#/routes/expanded" data-i18n="nav.expanded">ตารางขยาย</a></li>
|
||||
<li><a href="#/about" data-i18n="nav.about">เกี่ยวกับเรา</a></li>
|
||||
<li><a href="#/blog" data-i18n="nav.blog">บ่นไปเรื่อย</a></li>
|
||||
<li><a href="#/credits" data-i18n="nav.credits">เครดิต</a></li></ul>
|
||||
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"brand.subtitle": "Ang Thong Provincial Bus Terminal",
|
||||
"nav.home": "Home",
|
||||
"nav.stops": "Bus Stops",
|
||||
"nav.routes": "Route Details",
|
||||
"nav.credits": "Credits",
|
||||
"nav.about": "About",
|
||||
"nav.blog": "Blog",
|
||||
"about.title": "About Us",
|
||||
"about.brand": "When will the bus come?",
|
||||
"about.lead": "Our story — read through the blocks below.",
|
||||
"blog.title": "Blog",
|
||||
"blog.subtitle": "News & travel know-how",
|
||||
"blog.lead": "Route news, timetable updates and useful tips — switch between grid and list view.",
|
||||
"blog.viewGrid": "Grid",
|
||||
"blog.viewList": "List",
|
||||
"blog.count": "All posts",
|
||||
"blog.items": "posts",
|
||||
"blog.minRead": "min read",
|
||||
"blog.readMore": "Read more",
|
||||
"blog.backList": "Back to all posts",
|
||||
"blog.empty": "No posts yet — add files under ui/partials/blog-data/",
|
||||
"blog.notFound": "Post not found",
|
||||
"blog.noGeo": "Route geometry not available yet",
|
||||
"blog.mapPick": "Tap a route on the map, or a row above, to see details",
|
||||
"blog.mapNoOrigin": "Origin coordinates not found — check station_code under \"map\"",
|
||||
"blog.mapNoRoutes": "No routes yet — add them under \"map\" → \"routes\"",
|
||||
"blog.mapNoCoord": "No coordinates yet",
|
||||
"blog.mapDest": "Destination",
|
||||
"blog.mapVia": "Via",
|
||||
"blog.mapNote": "Note",
|
||||
"blog.km": "km",
|
||||
"blog.min": "min",
|
||||
"blog.thb": "THB",
|
||||
"legend.title": "Card colours by route group",
|
||||
"legend.bangkok": "Bangkok routes — blue card",
|
||||
"legend.interprov": "Inter-provincial routes — purple card",
|
||||
"legend.inprov": "In-province routes — pink card",
|
||||
"legend.municipal": "Municipal routes — light yellow card",
|
||||
"legend.empty": "No data yet — grey card showing N/A instead of a route number",
|
||||
"legend.note": "Ang Thong has no group 1 (municipal) services yet, so the card is grey and shows N/A in place of the route number",
|
||||
"zone.municipal": "Municipal routes",
|
||||
"zone.municipalDesc": "Routes inside municipal areas",
|
||||
"zone.municipalNA": "No municipal routes in Ang Thong yet",
|
||||
"card.noData": "No data yet",
|
||||
"route.mapDesc": "Real geometry from our GIS data · stops along the route",
|
||||
"map.origin": "Origin",
|
||||
"map.destination": "Destination",
|
||||
"map.offline": "Offline — route only",
|
||||
"map.empty": "No route geometry for this service yet",
|
||||
"map.legendRoute": "Route",
|
||||
"map.legendStop": "Bus stop",
|
||||
"map.legendTerminal": "Bus terminal",
|
||||
"map.subStop": "Boarding point (sub-stop)",
|
||||
"map.viewBoardingPoints": "See boarding points for this route",
|
||||
"map.legendSubStop": "Boarding point (sub-stop)",
|
||||
"map.route": "Route",
|
||||
"map.noStationPin": "stop coordinates not in the system yet — showing serving routes",
|
||||
"map.captionRoute": "Route length {km} km · {n} stops along the route",
|
||||
"map.captionStop": "Routes serving this stop: {r} · {n} stops along the route",
|
||||
"map.stations": "terminals along route",
|
||||
"map.stationPinned": "stop location pinned on the map",
|
||||
"map.thisStop": "the stop you are viewing",
|
||||
"map.legendHere": "This stop",
|
||||
"map.noRoutesHere": "No routes recorded for this stop yet",
|
||||
"map.servedBy": "Routes served",
|
||||
"map.openInMaps": "Open in Google Maps",
|
||||
"map.viewStopPage": "View this stop",
|
||||
"map.km": "km",
|
||||
"map.offRoute": "off route",
|
||||
"map.alongRoute": "Stops along the route (km from origin)",
|
||||
"map.useMyLocation": "Stops near me",
|
||||
"map.locating": "Finding your location…",
|
||||
"map.geoDenied": "Location permission denied — allow it in your browser and try again",
|
||||
"map.noGeo": "This browser does not support geolocation",
|
||||
"map.nearestTitle": "Stops closest to you",
|
||||
"map.youAreHere": "Your location",
|
||||
"cta.check": "Check Schedules",
|
||||
"footer.menu": "Menu",
|
||||
"footer.popular": "Most Searched Routes",
|
||||
"footer.popstops": "Popular Stops",
|
||||
"footer.contact": "Contact",
|
||||
"footer.about": "Every bus stop in Ang Thong and nearby provinces — locations and routes served.",
|
||||
"footer.sponsors": "Sponsors & Partners",
|
||||
"footer.sponsorsLead": "Support us at no extra cost: shop online or book bus and flight tickets through our affiliate links — you pay nothing more.",
|
||||
"home.welcome": "Welcome",
|
||||
"home.title1": "Ang Thong Provincial",
|
||||
"home.provincePrefix": "",
|
||||
"home.lead": "Browse routes, find stops, and preview a route right from this page",
|
||||
"home.chooseProvince": "Select Province",
|
||||
"home.chooseStation": "Select Terminal",
|
||||
"share.label": "Share short link",
|
||||
"share.copied": "Link copied",
|
||||
"share.short": "Short link",
|
||||
"share.line": "Share on LINE",
|
||||
"home.stationEmpty": "— No terminals in this province —",
|
||||
"home.stationEmptyHint": "No bus terminal in",
|
||||
"home.stationCount": "<b>{n}</b> terminals in",
|
||||
"zone.bangkok": "To Bangkok",
|
||||
"zone.bangkokDesc": "Routes to Bangkok",
|
||||
"zone.interprov": "Inter-province",
|
||||
"zone.interprovDesc": "Routes to nearby provinces",
|
||||
"zone.inprov": "Within Ang Thong",
|
||||
"zone.inprovDesc": "Routes inside Ang Thong",
|
||||
"card.schedule": "Schedule",
|
||||
"card.nextTrip": "Next trip",
|
||||
"card.noSchedule": "No schedule",
|
||||
"stops.title": "Find bus stops quickly and easily",
|
||||
"stops.subtitle": "All major terminals, local stops, van stations and private stops — mobile and desktop friendly",
|
||||
"stops.kpi.total": "Total stops",
|
||||
"stops.kpi.coverage": "Coverage",
|
||||
"stops.kpi.types": "Main types",
|
||||
"stops.kpi.routes": "Popular departures",
|
||||
"stops.searchPh": "Search a place, e.g. Ang Thong terminal",
|
||||
"stops.filterProvince": "Filter by province",
|
||||
"stops.allProvinces": "All provinces",
|
||||
"stops.allTypes": "All types",
|
||||
"stops.mapTitle": "Stop network map",
|
||||
"stops.onMap": "On map",
|
||||
"stops.kpi.places": "Key places",
|
||||
"stops.kpi.buses": "Busiest bus line",
|
||||
"stops.unitPoints": "stops",
|
||||
"stops.unitPlaces": "places",
|
||||
"stops.unitTypes": "types",
|
||||
"stops.unitRoutes": "highways",
|
||||
"stops.highway": "Highway",
|
||||
"stops.busPrefix": "Route",
|
||||
"stops.viewSchedule": "View schedule for route {n}",
|
||||
"stops.viewRoute": "View route {n}",
|
||||
"stops.subStop": "Boarding point (sub-stop)",
|
||||
"stops.noOffset": "No travel time from the first stop yet",
|
||||
"stops.noBusLine": "No bus line listed",
|
||||
"stops.modeCode": "Search by stop code",
|
||||
"stops.modePlace": "Search by place name",
|
||||
"stops.codePh": "3+000",
|
||||
"stops.codeHint": "Type 4 digits and the + sign is added automatically (e.g. 3000 → 3+000)",
|
||||
"stops.codeHintBox": "Type digits in the boxes — empty boxes are filled with 0 automatically. For 4-digit codes such as 8+591, enter 08+591",
|
||||
"stops.codeFull": "Stop code:",
|
||||
"stops.placePh": "Ang Thong Hospital",
|
||||
"stops.placeHint": "Type a place name such as a hospital or land office, then pick a match",
|
||||
"stops.padDelete": "Del",
|
||||
"stops.reset": "Clear",
|
||||
"stops.section": "Section",
|
||||
"stops.showing": "Showing {a} of {b} stops",
|
||||
"stops.showAll": "Show all stops",
|
||||
"stops.noResult": "No stops match your search",
|
||||
"stops.loading": "Loading stop data…",
|
||||
"type.terminal": "Passenger terminal",
|
||||
"type.station": "Major stop",
|
||||
"type.pickup": "Pickup point",
|
||||
"type.market": "Market / community",
|
||||
"type.landmark": "Landmark",
|
||||
"route.badge": "Inter-province route",
|
||||
"route.kpiProvince": "provinces",
|
||||
"route.kpiStops": "stops",
|
||||
"route.kpiTrips": "trips",
|
||||
"route.overview": "Route overview",
|
||||
"route.contact": "Contact operator",
|
||||
"route.call": "Call us",
|
||||
"route.openLink": "Open link",
|
||||
"route.zoomQr": "Enlarge QR to scan",
|
||||
"route.copyLink": "Copy link",
|
||||
"route.copied": "Copied",
|
||||
"common.close": "Close",
|
||||
"route.link.facebook": "Facebook",
|
||||
"route.link.line": "LINE Official",
|
||||
"route.link.www": "Website",
|
||||
"route.vehicle": "Route vehicle",
|
||||
"route.mapTitle": "Route map",
|
||||
"route.photos": "Buses on this network",
|
||||
"route.stopsTitle": "Stops along the route",
|
||||
"route.scheduleTitle": "Schedule",
|
||||
"route.selectRoute": "Select route",
|
||||
"route.selectStation": "Select station",
|
||||
"route.origin": "Origin",
|
||||
"route.transfer": "Intermediate stop",
|
||||
"route.intermediate": "Intermediate stop",
|
||||
"route.pass": "Passing",
|
||||
"route.destination": "Destination",
|
||||
"route.direction": "All directions",
|
||||
"route.empty": "No schedule data yet",
|
||||
"route.noSchedule": "— No trips yet —",
|
||||
"route.seeOther": "Other routes",
|
||||
"stop.code": "Code:",
|
||||
"stop.nearby": "Nearby",
|
||||
"stop.routes": "Routes through this stop",
|
||||
"stop.searchRoute": "Search route or destination",
|
||||
"stop.showing": "Showing {a} of {b} routes",
|
||||
"stop.mapInfo": "Map & stop info",
|
||||
"stop.nextArrival": "Next arrival",
|
||||
"stop.subGeneric": "A stop in {city} · see every route that passes here on one page",
|
||||
"stop.thisStop": "this stop",
|
||||
"stop.statRoutes": "Routes",
|
||||
"stop.statTrips": "Departures/day",
|
||||
"stop.statHours": "Service hours",
|
||||
"stop.statType": "Type",
|
||||
"stop.nRoutes": "{n} routes",
|
||||
"stop.tripsPerDay": "{n} trips/day",
|
||||
"stop.tripsPerDay1": "{n} trip/day",
|
||||
"stop.nRoutes1": "{n} route",
|
||||
"stop.noRoutes": "No routes recorded for this stop yet",
|
||||
"stop.noTimes": "No departure times for this stop yet",
|
||||
"stop.tomorrow": "Tomorrow",
|
||||
"stop.nextAt": "Next",
|
||||
"stop.notFound": "Stop not found",
|
||||
"stop.notFoundSub": "No stop with code “{code}” — check the code or go back to the stop list",
|
||||
"stop.nearbySub": "Places of interest and stops to wait for your bus",
|
||||
"stop.otherStopsTitle": "Other boarding points · route {n} ({m} stops)",
|
||||
"stop.otherMore": "(+{n} stops)",
|
||||
"stop.otherStopsAll": "All other boarding points ({m} stops)",
|
||||
"stop.noCoord": "No coordinates yet",
|
||||
"stop.open": "Open",
|
||||
"stop.close": "Close",
|
||||
"stop.nowAtStop": "Current time at this stop",
|
||||
"stop.autoNext": "Next departure is calculated automatically",
|
||||
"common.backHome": "← Back to home",
|
||||
"common.backStops": "← Back to stops",
|
||||
"common.search": "Search",
|
||||
"common.details": "Details",
|
||||
"common.bus": "Bus",
|
||||
"common.phone": "Call:",
|
||||
"common.noWebsite": "No website listed",
|
||||
"type.van": "Van station",
|
||||
"type.local": "Local stop",
|
||||
"type.busstop": "Bus shelter / stop",
|
||||
"type.startlocalpoint": "Local route origin",
|
||||
"type.other": "Other boarding points",
|
||||
"type.marketOpt": "Market / private stop",
|
||||
"route.mapTitleN": "Route {n} map",
|
||||
"stop.viewScheduleN": "View schedule of route {n}",
|
||||
"stop.openRoute": "Open route details",
|
||||
"credits.title": "Credits & Sources",
|
||||
"credits.icons": "Icons — Lucide",
|
||||
"credits.fonts": "Fonts — Google Fonts",
|
||||
"credits.map": "Maps",
|
||||
"credits.photos": "Bus photo credits",
|
||||
"credits.photosNote": "For all routes not listed here, our thanks go out to everyone as well.",
|
||||
"common.back": "Back",
|
||||
"check.scheduleAll": "Departure times at every stop",
|
||||
"check.title": "Departure Schedule",
|
||||
"check.lead": "Pick a route to see every stop’s departures on one page",
|
||||
"check.kpiStops": "Main stops",
|
||||
"check.kpiProvince": "Provinces",
|
||||
"check.kpiTrips": "Trips per day",
|
||||
"check.kpiNext": "Next departure",
|
||||
"check.direction": "Direction",
|
||||
"check.atStop": "Departures at",
|
||||
"check.dayWeekday": "Weekday timetable (Mon–Fri)",
|
||||
"check.dayHoliday": "Weekend/holiday timetable",
|
||||
"check.dayMixed": "This direction mixes weekday and holiday times — not split by day yet",
|
||||
"check.dayUnknown": "Timetable day not specified (showing all days)",
|
||||
"check.dayOfWeek": "today is",
|
||||
"time.estimated": "~ Estimated from the origin (not an operator timetable)",
|
||||
"time.derived": "~ Computed timetable (from {base} {n} min) — may change with real traffic conditions",
|
||||
"check.now": "Current time",
|
||||
"check.updatedAgo": "Last updated {ago}",
|
||||
"check.agoToday": "today",
|
||||
"check.agoYesterday": "yesterday",
|
||||
"check.agoDays": "{n} days ago",
|
||||
"check.agoWeeks": "{n} weeks ago",
|
||||
"check.agoMonths": "{n} months ago",
|
||||
"check.agoYears": "{y} years ago",
|
||||
"check.agoYearsMonths": "{y} years {m} months ago",
|
||||
"check.nextAt": "Next departure",
|
||||
"check.noMoreToday": "No departures left today",
|
||||
"check.stopsCount": "stops",
|
||||
"check.toStopDetail": "View stop detail",
|
||||
"common.routes": "routes"
|
||||
}
|
||||
@@ -0,0 +1,269 @@
|
||||
{
|
||||
"brand.subtitle": "สถานีขนส่งผู้โดยสารจังหวัดอ่างทอง",
|
||||
"nav.home": "หน้าแรก",
|
||||
"nav.stops": "ป้ายหยุดรถ",
|
||||
"nav.routes": "รายละเอียดสายรถ",
|
||||
"nav.credits": "เครดิต",
|
||||
"nav.about": "เกี่ยวกับเรา",
|
||||
"nav.blog": "บ่นไปเรื่อย",
|
||||
"about.title": "เกี่ยวกับเรา",
|
||||
"about.brand": "เมื่อไหร่รถจะมา",
|
||||
"about.lead": "เรื่องราวและที่มาของเว็บนี้ — อ่านเรียงตามบล็อกด้านล่างได้เลย",
|
||||
"blog.title": "บ่นไปเรื่อย",
|
||||
"blog.subtitle": "หาอะไรอ่านรอรถ",
|
||||
"blog.lead": "ความรู้สึกผมตั้งแต่รวบรวมข้อมูล ปัญหาที่เจอ บ่นไปเรื่อย",
|
||||
"blog.viewGrid": "ตาราง",
|
||||
"blog.viewList": "รายการ",
|
||||
"blog.count": "บ่นไปเรื่อยทั้งหมด",
|
||||
"blog.items": "เรื่อง",
|
||||
"blog.minRead": "นาที",
|
||||
"blog.readMore": "อ่านต่อ",
|
||||
"blog.backList": "กลับไปรายการบ่นไปเรื่อย",
|
||||
"blog.empty": "ยังไม่มีเรื่องบ่น — เพิ่มไฟล์ใน ui/partials/blog-data/ ได้เลย",
|
||||
"blog.notFound": "ไม่พบเรื่องบ่นนี้",
|
||||
"blog.noGeo": "ยังไม่มีข้อมูลเส้นทางสายนี้",
|
||||
"blog.mapPick": "กดเส้นทางบนแผนที่ หรือแตะรายการด้านบน เพื่อดูรายละเอียด",
|
||||
"blog.mapNoOrigin": "ไม่พบพิกัดต้นทาง — ตรวจ station_code ในคีย์ \"map\"",
|
||||
"blog.mapNoRoutes": "ยังไม่มีเส้นทางในโครง — เพิ่มในคีย์ \"map\" → \"routes\"",
|
||||
"blog.mapNoCoord": "ยังไม่ใส่พิกัด",
|
||||
"blog.mapDest": "ปลายทาง",
|
||||
"blog.mapVia": "ผ่าน",
|
||||
"blog.mapNote": "หมายเหตุ",
|
||||
"blog.km": "กม.",
|
||||
"blog.min": "นาที",
|
||||
"blog.thb": "บาท",
|
||||
"legend.title": "คำอธิบายสีการ์ดตามหมวดเส้นทาง",
|
||||
"legend.bangkok": "หมวดเส้นทางเข้ากรุงเทพฯ — การ์ดสีน้ำเงิน",
|
||||
"legend.interprov": "หมวดเส้นทางระหว่างจังหวัด — การ์ดสีม่วง",
|
||||
"legend.inprov": "หมวดเส้นทางภายในจังหวัด — การ์ดสีชมพู",
|
||||
"legend.municipal": "หมวดเส้นทางภายในเทศบาล — การ์ดสีเหลืองอ่อน",
|
||||
"legend.empty": "ยังไม่มีข้อมูล — การ์ดสีเทา แสดง N/A แทนเลขสาย",
|
||||
"legend.note": "อ่างทองยังไม่มีรถหมวด 1 (เส้นทางภายในเทศบาล) จึงแสดงการ์ดสีเทาและใช้ N/A แทนตัวเลขสายเส้นทาง",
|
||||
"zone.municipal": "หมวดเส้นทางภายในเทศบาล",
|
||||
"zone.municipalDesc": "เส้นทางภายในเขตเทศบาล",
|
||||
"zone.municipalNA": "ยังไม่มีเส้นทางหมวดเทศบาลในอ่างทอง",
|
||||
"card.noData": "ยังไม่มีข้อมูล",
|
||||
"route.mapDesc": "เส้นทางจริงจากข้อมูล GIS · ป้ายหยุดรถตามเส้นทาง",
|
||||
"map.origin": "ต้นทาง",
|
||||
"map.destination": "ปลายทาง",
|
||||
"map.offline": "ออฟไลน์ — แสดงเฉพาะเส้นทาง",
|
||||
"map.empty": "ยังไม่มีข้อมูลเส้นทางสายนี้ในระบบ",
|
||||
"map.legendRoute": "เส้นทาง",
|
||||
"map.legendStop": "ป้ายหยุดรถ",
|
||||
"map.legendTerminal": "สถานีขนส่ง",
|
||||
"map.subStop": "จุดขึ้นรถ (จุดย่อย)",
|
||||
"map.viewBoardingPoints": "ดูจุดขึ้นรถของสายนี้",
|
||||
"map.legendSubStop": "จุดขึ้นรถ (จุดย่อย)",
|
||||
"map.route": "สาย",
|
||||
"map.noStationPin": "พิกัดป้ายนี้ยังไม่มีในระบบ — แสดงเส้นทางที่ผ่าน",
|
||||
"map.captionRoute": "ความยาวเส้นทาง {km} กม. · ป้ายตามเส้นทาง {n} แห่ง",
|
||||
"map.captionStop": "เส้นทางที่ผ่านป้ายนี้ {r} · ป้ายตามเส้นทาง {n} แห่ง",
|
||||
"map.stations": "สถานีขนส่งตามเส้นทาง",
|
||||
"map.stationPinned": "ปักหมุดตำแหน่งป้ายแล้ว",
|
||||
"map.thisStop": "ป้ายที่กำลังดูอยู่",
|
||||
"map.legendHere": "ป้ายที่กำลังดู",
|
||||
"map.noRoutesHere": "ยังไม่มีข้อมูลสายรถที่ผ่านป้ายนี้ในระบบ",
|
||||
"map.servedBy": "สายที่ผ่าน",
|
||||
"map.openInMaps": "เปิดใน Google Maps",
|
||||
"map.viewStopPage": "ดูรายละเอียดป้ายนี้",
|
||||
"map.km": "กม.",
|
||||
"map.offRoute": "นอกเส้นทาง",
|
||||
"map.alongRoute": "จุดจอดตามเส้นทาง (กม. จากต้นทาง)",
|
||||
"map.useMyLocation": "ป้ายใกล้ฉัน",
|
||||
"map.locating": "กำลังหาตำแหน่งของคุณ…",
|
||||
"map.geoDenied": "ไม่ได้รับอนุญาตให้เข้าถึงตำแหน่ง — เปิดสิทธิ์ตำแหน่งในเบราว์เซอร์แล้วลองใหม่",
|
||||
"map.noGeo": "เบราว์เซอร์นี้ไม่รองรับการระบุตำแหน่ง",
|
||||
"map.nearestTitle": "ป้ายที่ใกล้คุณที่สุด",
|
||||
"map.youAreHere": "ตำแหน่งของคุณ",
|
||||
"cta.check": "เช็กเวลาเดินรถ",
|
||||
"footer.menu": "เมนู",
|
||||
"footer.popular": "สายที่ค้นหาบ่อยที่สุด",
|
||||
"footer.popstops": "ป้ายยอดนิยม",
|
||||
"footer.contact": "ติดต่อ",
|
||||
"footer.about": "รวมป้ายขึ้น-ลงรถทุกจุดในจังหวัดอ่างทองและจังหวัดใกล้เคียง พร้อมตำแหน่งและสายรถที่ผ่าน",
|
||||
"footer.sponsors": "ผู้สนับสนุน & พาร์ทเนอร์",
|
||||
"footer.sponsorsLead": "ร่วมเป็นผู้สนับสนุนเราได้ เมื่อซื้อของออนไลน์ หรือซื้อตั๋วรถทัวร์ เครื่องบิน ออนไลน์กดเลือกสินค้า หรือบริการผ่านลิงค์นายหน้าของเราไม่มีค่าใช้จ่ายเพิ่ม",
|
||||
"home.welcome": "ยินดีต้อนรับ",
|
||||
"home.title1": "สถานีขนส่งผู้โดยสารภายใน",
|
||||
"home.provincePrefix": "จังหวัด",
|
||||
"home.lead": "ดูสายรถ, ค้นหาป้าย และเปิดตัวอย่างเส้นทางได้ทันทีจากหน้าแรก",
|
||||
"home.chooseProvince": "เลือกจังหวัด",
|
||||
"home.chooseStation": "เลือกสถานีขนส่งผู้โดยสาร",
|
||||
"share.label": "แชร์ลิงก์สั้น",
|
||||
"share.copied": "คัดลอกลิงก์แล้ว",
|
||||
"share.short": "ลิงก์สั้น",
|
||||
"share.line": "แชร์ผ่าน LINE",
|
||||
"home.stationEmpty": "— ยังไม่มีสถานีขนส่งในจังหวัดนี้ —",
|
||||
"home.stationEmptyHint": "ยังไม่มีสถานีขนส่งผู้โดยสารในจังหวัด",
|
||||
"home.stationCount": "มี <b>{n}</b> สถานีขนส่งในจังหวัด",
|
||||
"zone.bangkok": "หมวดเส้นทางเข้ากรุงเทพฯ",
|
||||
"zone.bangkokDesc": "เส้นทางเชื่อมต่อกรุงเทพมหานคร",
|
||||
"zone.interprov": "หมวดเส้นทางระหว่างจังหวัด",
|
||||
"zone.interprovDesc": "เส้นทางเชื่อมต่อจังหวัดใกล้เคียง",
|
||||
"zone.inprov": "หมวดเส้นทางภายในจังหวัด",
|
||||
"zone.inprovDesc": "เส้นทางภายในจังหวัดอ่างทอง",
|
||||
"card.schedule": "ดูตาราง",
|
||||
"card.nextTrip": "เที่ยวถัดไป",
|
||||
"card.noSchedule": "ยังไม่มีตาราง",
|
||||
"stops.title": "ค้นหาป้ายหยุดรถแบบรวดเร็ว",
|
||||
"stops.subtitle": "รวมสถานีขนส่งหลัก จุดจอดท้องถิ่น สถานีรถตู้ และจุดเอกชน — ใช้งานได้ทั้งบนมือถือและเดสก์ท็อป",
|
||||
"stops.kpi.total": "จำนวนจุดทั้งหมด",
|
||||
"stops.kpi.coverage": "ครอบคลุม",
|
||||
"stops.kpi.types": "ประเภทหลัก",
|
||||
"stops.kpi.routes": "เที่ยวใช้งานบ่อย",
|
||||
"stops.searchPh": "ค้นหาชื่อสถานที่ เช่น บขส.อ่างทอง",
|
||||
"stops.filterProvince": "กรองตามจังหวัด",
|
||||
"stops.allProvinces": "ทุกจังหวัด",
|
||||
"stops.allTypes": "ทุกประเภท",
|
||||
"stops.mapTitle": "แผนที่ย่อของเครือข่ายป้าย",
|
||||
"stops.onMap": "บนแผนที่",
|
||||
"stops.kpi.places": "สถานที่สำคัญ",
|
||||
"stops.kpi.buses": "สายที่ผ่านมากสุด",
|
||||
"stops.unitPoints": "จุด",
|
||||
"stops.unitPlaces": "แห่ง",
|
||||
"stops.unitTypes": "ประเภท",
|
||||
"stops.unitRoutes": "สายทางหลวง",
|
||||
"stops.highway": "ทางหลวง",
|
||||
"stops.busPrefix": "สาย",
|
||||
"stops.viewSchedule": "ดูตารางเวลาสาย {n}",
|
||||
"stops.viewRoute": "ดูรายละเอียดสาย {n}",
|
||||
"stops.subStop": "จุดขึ้นรถ (จุดย่อย)",
|
||||
"stops.noOffset": "ยังไม่ระบุเวลาเดินทางจากจุดแรก",
|
||||
"stops.noBusLine": "ยังไม่ระบุสายรถ",
|
||||
"stops.modeCode": "ค้นหาด้วยรหัสป้าย",
|
||||
"stops.modePlace": "ค้นหาด้วยชื่อสถานที่",
|
||||
"stops.codePh": "3+000",
|
||||
"stops.codeHint": "พิมพ์ตัวเลข 4 หลัก ระบบจะเติมเครื่องหมาย + ให้อัตโนมัติ (เช่น 3000 → 3+000)",
|
||||
"stops.codeHintBox": "พิมพ์ตัวเลขในช่อง ระบบจะเติม 0 ให้อัตโนมัติเมื่อเว้นว่าง และถ้าเจอรหัส 4 หลัก เช่น 8+591 ให้กรอก 08+591",
|
||||
"stops.codeFull": "รหัสป้าย:",
|
||||
"stops.placePh": "โรงพยาบาลอ่างทอง",
|
||||
"stops.placeHint": "พิมพ์ชื่อสถานที่สำคัญ เช่น โรงพยาบาล สำนักงานที่ดิน แล้วเลือกรายการที่ตรงกัน",
|
||||
"stops.padDelete": "ลบ",
|
||||
"stops.reset": "ล้างค่า",
|
||||
"stops.section": "ตอน",
|
||||
"stops.showing": "แสดง {a} จาก {b} ป้าย",
|
||||
"stops.showAll": "แสดงป้ายทั้งหมด",
|
||||
"stops.noResult": "ไม่พบป้ายหยุดรถที่ตรงกับเงื่อนไข",
|
||||
"stops.loading": "กำลังโหลดข้อมูลป้าย…",
|
||||
"type.terminal": "สถานีขนส่งผู้โดยสาร",
|
||||
"type.station": "ป้ายหลัก",
|
||||
"type.pickup": "จุดรับส่ง",
|
||||
"type.market": "ตลาด/ชุมชน",
|
||||
"type.landmark": "จุดสังเกต",
|
||||
"route.badge": "สายระหว่างจังหวัด",
|
||||
"route.kpiProvince": "จังหวัด",
|
||||
"route.kpiStops": "จุดจอด",
|
||||
"route.kpiTrips": "รอบเวลา",
|
||||
"route.overview": "ภาพรวมของสาย",
|
||||
"route.contact": "ติดต่อผู้ประกอบการ",
|
||||
"route.call": "โทรสอบถาม",
|
||||
"route.openLink": "เปิดลิงก์",
|
||||
"route.zoomQr": "ขยาย QR ให้ใหญ่ (กดเพื่อสแกน)",
|
||||
"route.copyLink": "คัดลอกลิงก์",
|
||||
"route.copied": "คัดลอกแล้ว",
|
||||
"common.close": "ปิด",
|
||||
"route.link.facebook": "Facebook",
|
||||
"route.link.line": "LINE Official",
|
||||
"route.link.www": "เว็บไซต์",
|
||||
"route.vehicle": "รถประจำสาย",
|
||||
"route.mapTitle": "เส้นทางเดินรถ",
|
||||
"route.photos": "รูปรถประจำเส้นทางในเครือข่าย",
|
||||
"route.stopsTitle": "จุดจอดสำคัญบนเส้นทาง",
|
||||
"route.scheduleTitle": "ตารางเวลา",
|
||||
"route.selectRoute": "เลือกสายรถ",
|
||||
"route.selectStation": "เลือกสถานี",
|
||||
"route.origin": "ต้นทาง",
|
||||
"route.transfer": "กลางทาง",
|
||||
"route.intermediate": "จุดจอดกลางทาง",
|
||||
"route.pass": "ผ่านทาง",
|
||||
"route.destination": "ปลายทาง",
|
||||
"route.direction": "ทุกทิศทาง",
|
||||
"route.empty": "ยังไม่มีข้อมูลตารางเวลา",
|
||||
"route.noSchedule": "— ยังไม่มีรอบ —",
|
||||
"route.seeOther": "เลือกสายรถอื่น",
|
||||
"stop.code": "รหัส:",
|
||||
"stop.nearby": "ใกล้เคียงป้าย",
|
||||
"stop.routes": "สายรถที่ผ่านจุดนี้",
|
||||
"stop.searchRoute": "ค้นหาสายรถหรือปลายทาง",
|
||||
"stop.showing": "แสดง {a} จาก {b} สาย",
|
||||
"stop.mapInfo": "แผนที่และข้อมูลป้าย",
|
||||
"stop.nextArrival": "เที่ยวถัดไป",
|
||||
"stop.subGeneric": "จุดจอดใน{city} · ดูเวลารถทุกสายที่ผ่านป้ายนี้ได้ในหน้าเดียว",
|
||||
"stop.thisStop": "ป้ายนี้",
|
||||
"stop.statRoutes": "จำนวนสายรถ",
|
||||
"stop.statTrips": "เที่ยวต่อวัน",
|
||||
"stop.statHours": "เวลาบริการ",
|
||||
"stop.statType": "ประเภท",
|
||||
"stop.nRoutes": "{n} สาย",
|
||||
"stop.tripsPerDay": "{n} รอบ/วัน",
|
||||
"stop.tripsPerDay1": "{n} รอบ/วัน",
|
||||
"stop.nRoutes1": "{n} สาย",
|
||||
"stop.noRoutes": "ยังไม่มีสายรถที่บันทึกว่าผ่านป้ายนี้",
|
||||
"stop.noTimes": "ยังไม่มีข้อมูลเวลาเดินรถที่ป้ายนี้",
|
||||
"stop.tomorrow": "พรุ่งนี้",
|
||||
"stop.nextAt": "ถัดไป",
|
||||
"stop.notFound": "ไม่พบป้ายนี้",
|
||||
"stop.notFoundSub": "ไม่พบรหัสป้าย “{code}” ในระบบ — ตรวจรหัสหรือกลับไปหน้ารายการป้าย",
|
||||
"stop.nearbySub": "สถานที่น่าสนใจและจุดแวะระหว่างรอรถ",
|
||||
"stop.otherStopsTitle": "จุดขึ้นรถประจำทางอื่นๆ · สาย {n} ({m} จุด)",
|
||||
"stop.otherMore": "(+{n} จุด)",
|
||||
"stop.otherStopsAll": "จุดขึ้นรถประจำทางอื่นๆ ทั้งหมด ({m} จุด)",
|
||||
"stop.noCoord": "ยังไม่มีพิกัด",
|
||||
"stop.open": "เปิด",
|
||||
"stop.close": "ปิด",
|
||||
"stop.nowAtStop": "เวลาปัจจุบัน ณ ป้ายนี้",
|
||||
"stop.autoNext": "กำลังคำนวณเที่ยวถัดไปอัตโนมัติ",
|
||||
"common.backHome": "← กลับหน้าแรก",
|
||||
"common.backStops": "← กลับไปยังรายการป้าย",
|
||||
"common.search": "ค้นหา",
|
||||
"common.details": "ดูรายละเอียด",
|
||||
"common.bus": "รถบัส",
|
||||
"common.phone": "โทร:",
|
||||
"common.noWebsite": "ยังไม่ระบุเว็บไซต์",
|
||||
"type.van": "สถานีรถตู้",
|
||||
"type.local": "จุดจอดท้องถิ่น",
|
||||
"type.busstop": "ศาลารอรถ หรือป้ายหยุดรถ",
|
||||
"type.startlocalpoint": "ต้นทางรถสายท้องถิ่น",
|
||||
"type.other": "จุดขึ้นรถประจำทางอื่นๆ",
|
||||
"type.marketOpt": "ตลาด/จุดเอกชน",
|
||||
"route.mapTitleN": "เส้นทางเดินรถสาย {n}",
|
||||
"stop.viewScheduleN": "ดูตารางเวลาสายรถ {n}",
|
||||
"stop.openRoute": "เปิดหน้ารายละเอียดสายรถนี้",
|
||||
"credits.title": "เครดิตและแหล่งที่มา",
|
||||
"credits.icons": "ไอคอน — Lucide",
|
||||
"credits.fonts": "ฟอนต์ — Google Fonts",
|
||||
"credits.map": "แผนที่",
|
||||
"credits.photos": "ขอขอบคุณภาพรถประจำทาง",
|
||||
"credits.photosNote": "และสายอื่น ๆ ที่ไม่ได้ระบุ ขอขอบคุณมา ณ ที่นี้",
|
||||
"common.back": "ย้อนกลับ",
|
||||
"check.scheduleAll": "ตารางเวลาเดินรถทุกจุดจอด",
|
||||
"check.title": "ตารางเวลาเดินรถ",
|
||||
"check.lead": "เลือกสายรถ แล้วดูรอบรถทุกจุดจอดในหน้าเดียว",
|
||||
"check.kpiStops": "จุดจอดหลัก",
|
||||
"check.kpiProvince": "จังหวัดที่ผ่าน",
|
||||
"check.kpiTrips": "รอบต่อวัน",
|
||||
"check.kpiNext": "รอบถัดไป",
|
||||
"check.direction": "ทิศทาง",
|
||||
"check.atStop": "ตารางเดินรถ ณ",
|
||||
"time.derived": "~ ตารางจากการคำนวณ (จาก {base} {n} นาที) — อาจเปลี่ยนแปลงตามการจราจรจริง",
|
||||
"check.dayWeekday": "ตารางวันทำงาน (จ–ศ)",
|
||||
"check.dayHoliday": "ตารางวันหยุด (ส–อา/นักขัตฤกษ์)",
|
||||
"check.dayMixed": "ทิศนี้มีทั้งตารางวันทำงานและวันหยุดในตัวเดียวกัน — ยังไม่แยกตามวัน",
|
||||
"check.dayUnknown": "ยังไม่ระบุวันของตาราง (แสดงทุกวัน)",
|
||||
"check.dayOfWeek": "วันนี้",
|
||||
"time.estimated": "~ เวลาคำนวณจากต้นทาง (ประมาณ — ไม่ใช่ตารางของผู้ประกอบการ)",
|
||||
"check.now": "เวลาปัจจุบัน",
|
||||
"check.updatedAgo": "อัปเดตล่าสุด {ago}",
|
||||
"check.agoToday": "วันนี้",
|
||||
"check.agoYesterday": "เมื่อวาน",
|
||||
"check.agoDays": "{n} วันที่แล้ว",
|
||||
"check.agoWeeks": "{n} สัปดาห์ที่แล้ว",
|
||||
"check.agoMonths": "{n} เดือนที่แล้ว",
|
||||
"check.agoYears": "{y} ปีที่แล้ว",
|
||||
"check.agoYearsMonths": "{y} ปี {m} เดือนที่แล้ว",
|
||||
"check.nextAt": "เที่ยวถัดไป",
|
||||
"check.noMoreToday": "ไม่มีรถเหลือในวันนี้แล้ว",
|
||||
"check.stopsCount": "จุดจอด",
|
||||
"check.toStopDetail": "ไปหน้ารายละเอียดจุดจอด",
|
||||
"common.routes": "เส้นทาง"
|
||||
}
|
||||
@@ -50,6 +50,8 @@
|
||||
.at-pin.mute { background: #6b7268; } /* --muted */
|
||||
/* ป้ายที่กำลังเปิดดูอยู่ — ใหญ่กว่าเพื่อให้เห็นชัด */
|
||||
.at-pin.here { background: #f2a900; width: 18px; height: 18px; border-width: 3px; }
|
||||
/* จุดย่อย (จุดขึ้นรถประจำทางอื่นๆ) — สี่เหลี่ยมม่วง ต่างจากหมุดกลม */
|
||||
.at-pin.sub { background: #7a4cc0; border-radius: 2px; }
|
||||
|
||||
.at-map .leaflet-tooltip {
|
||||
border-radius: 4px;
|
||||
@@ -127,6 +129,7 @@
|
||||
/* จุดจอดที่ไม่มีหน้ารายละเอียด (มาจาก 8 other_stop.json) — ไม่ใช่ลิงก์ */
|
||||
.at-km-row.is-plain { cursor: default; }
|
||||
.at-km-row.is-plain .at-km-dot { background: #7a4cc0; }
|
||||
.at-km-row.is-sub .at-km-dot { background: #7a4cc0; } /* จุดย่อย (จุดขึ้นรถอื่นๆ) — ม่วง ให้ตรงกับหมุดบนแผนที่ */
|
||||
.at-km-row.is-plain:hover .at-km-name { color: inherit; text-decoration: none; }
|
||||
.at-km-row .at-km-val.is-off { color: #a3560f; font-weight: 600; font-size: .78rem; }
|
||||
|
||||
|
||||
@@ -146,12 +146,15 @@ window.ATMap = (function () {
|
||||
/* แตกเป็น "จุดจริง" ทีละจุด — ชื่อ ↔ พิกัด จับคู่ตามลำดับ (จุดที่ไม่มีพิกัด = ไม่ปักหมุด) */
|
||||
var subs = (window.OtherStop && OtherStop.stopsOf) ? OtherStop.stopsOf(o) : [];
|
||||
if (!subs.length) subs = [{ name: o.station_name_th, hasCoord: false, lat: null, lng: null }];
|
||||
subs.forEach(function (sub) {
|
||||
subs.forEach(function (sub, si) {
|
||||
stops.push({
|
||||
name: sub.name,
|
||||
pt: sub.hasCoord ? [sub.lng, sub.lat] : null,
|
||||
code: null,
|
||||
note: o.note || null
|
||||
note: o.note || null,
|
||||
subStop: true, /* ★ จุดย่อย: ลิงก์ไปหน้ารวมจุดขึ้นรถของสายนี้ */
|
||||
subRoute: String(route.route_id),
|
||||
subFirst: si === 0 /* จุดแรก = จุดอ้างอิง (อยู่บน timetable แล้ว) */
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -172,6 +175,7 @@ window.ATMap = (function () {
|
||||
var km = fromEnd ? total - k.km : k.km;
|
||||
s.off = k.d > OFF_ROUTE_M;
|
||||
s.km = Math.max(0, km).toFixed(1);
|
||||
if (s.subStop) s.sub = true; /* คงธงจุดย่อยไว้ให้ตัววาดหมุด */
|
||||
});
|
||||
return stops;
|
||||
}
|
||||
@@ -236,7 +240,11 @@ window.ATMap = (function () {
|
||||
}
|
||||
function fitAll(map, latlngs) {
|
||||
var all = [];
|
||||
latlngs.forEach(function (l) { all = all.concat(l); });
|
||||
latlngs.forEach(function (l) {
|
||||
/* รับได้ทั้ง "เส้น" ([ [lat,lng], ... ]) และ "จุดเดี่ยว" ([lat, lng]) */
|
||||
if (l && typeof l[0] === 'number' && typeof l[1] === 'number') all.push([l[0], l[1]]);
|
||||
else if (l && l.length) all = all.concat(l);
|
||||
});
|
||||
if (!all.length) return;
|
||||
var rec = mapsFor(map);
|
||||
if (all.length === 1) {
|
||||
@@ -301,6 +309,23 @@ window.ATMap = (function () {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* จุดย่อยของ "จุดขึ้นรถประจำทางอื่นๆ" (จาก 8 other_stop.json) — ปักหมุดสี่เหลี่ยมม่วง
|
||||
คลิก = popup ชื่อ + กม. + ลิงก์ไปหน้ารวมจุดขึ้นรถของสายนั้น */
|
||||
function drawSubStops(map, rows, routeId, group) {
|
||||
(rows || []).forEach(function (r) {
|
||||
if (!r.sub || !r.pt) return;
|
||||
var html = '<div class="at-pop"><b>' + esc(r.name) + '</b>';
|
||||
html += '<span>' + esc(t('map.subStop')) + (r.km != null && r.km !== '' ? ' · ' + esc(r.km) + ' กม.' : '') + '</span>';
|
||||
if (r.href) html += '<a href="' + esc(r.href) + '">' + esc(t('map.viewBoardingPoints')) + '</a>';
|
||||
html += '</div>';
|
||||
L.marker([r.pt[1], r.pt[0]], { icon: pinIcon('sub'), zIndexOffset: 400 })
|
||||
.bindTooltip(esc(r.name), { direction: 'top', offset: [0, -8] })
|
||||
.bindPopup(html, { closeButton: false, offset: [0, -6] })
|
||||
.addTo(group);
|
||||
});
|
||||
}
|
||||
|
||||
/* สถานีของเรา: ชื่อ + คลิกไปหน้ารายละเอียดป้าย (opts.stopHref) */
|
||||
function drawStations(map, hits, opts, group) {
|
||||
hits.forEach(function (h) {
|
||||
@@ -317,10 +342,15 @@ window.ATMap = (function () {
|
||||
});
|
||||
}
|
||||
|
||||
function stationsNear(lines, maxM, o) {
|
||||
/* สถานีที่จะปักหมุด (ไอคอนเหลือง)
|
||||
- allowedIds = routes.json → station_ids ของสายนั้น (ปักเฉพาะที่ระบุไว้ — ให้ตรงกับตาราง)
|
||||
- ไม่ส่ง allowedIds = พฤติกรรมเดิม (ปักทุกสถานีที่อยู่ใกล้เส้น) */
|
||||
function stationsNear(lines, maxM, o, allowedIds) {
|
||||
return stationList(o).then(function (list) {
|
||||
var hits = [];
|
||||
var allow = (allowedIds && allowedIds.length) ? allowedIds.map(String) : null;
|
||||
list.forEach(function (s) {
|
||||
if (allow && allow.indexOf(String(s.station_id)) === -1) return; /* ไม่อยู่ในสายนี้ → ไม่ปัก */
|
||||
var pt = pointOf(s);
|
||||
if (!pt) return;
|
||||
var best = Infinity;
|
||||
@@ -366,7 +396,7 @@ window.ATMap = (function () {
|
||||
var li = document.createElement('li');
|
||||
var row = document.createElement(x.href ? 'a' : 'div');
|
||||
if (x.href) row.href = x.href;
|
||||
row.className = 'at-km-row' + (x.href ? '' : ' is-plain');
|
||||
row.className = 'at-km-row' + (x.href ? '' : ' is-plain') + (x.sub ? ' is-sub' : '');
|
||||
if (x.note) row.title = x.note;
|
||||
var val = x.off ? '<span class="is-off">' + esc(t('map.offRoute')) + '</span>'
|
||||
: (x.km === null || x.km === '' ? '–' : x.km + ' ' + esc(t('map.km')));
|
||||
@@ -406,21 +436,28 @@ window.ATMap = (function () {
|
||||
.bindTooltip(esc(e[1]), { direction: 'top', offset: [0, -8] }).addTo(group);
|
||||
});
|
||||
|
||||
Promise.all([stopsNear(lines, opts), stationsNear(lines, STATION_NEAR_M, opts),
|
||||
stationList(opts), routeList(opts), otherStopList(opts)]).then(function (res) {
|
||||
var shelters = res[0], sts = res[1], stations = res[2], routesDoc = res[3], others = res[4];
|
||||
Promise.all([stopsNear(lines, opts), routeList(opts),
|
||||
stationList(opts), otherStopList(opts)]).then(function (res) {
|
||||
var shelters = res[0], routesDoc = res[1], stations = res[2], others = res[3];
|
||||
var routeDoc = (routesDoc || []).filter(function (r) { return String(r.route_id) === String(routeId); })[0];
|
||||
var allowed = routeDoc ? (routeDoc.station_ids || []) : null; /* ★ ปักเฉพาะสถานีที่สายระบุ */
|
||||
drawShelters(map, shelters, group);
|
||||
drawStations(map, sts, opts, group);
|
||||
stationsNear(lines, STATION_NEAR_M, opts, allowed).then(function (sts) {
|
||||
drawStations(map, sts, opts, group);
|
||||
});
|
||||
fitAll(map, latlngs);
|
||||
|
||||
/* จุดจอดตามเส้นทาง + กม. จากต้นทาง — ใช้ routes.json → station_ids เป็นหลัก
|
||||
(station 8 → จับคู่ route_id ใน 8 other_stop.json) ถ้าหา route ไม่ได้จึงใช้ระยะใกล้เส้นแบบเดิม */
|
||||
var main = longest(lines);
|
||||
var route = (routesDoc || []).filter(function (r) { return String(r.route_id) === String(routeId); })[0];
|
||||
var route = routeDoc;
|
||||
var rows;
|
||||
if (route && (route.station_ids || []).length) {
|
||||
rows = routeStopRows(route, stations, others, main, (routesDoc || []).map(function (r) { return String(r.route_id); })).map(function (x) {
|
||||
return { name: x.name, km: x.km, off: x.off, note: x.note, href: x.code ? href(opts, x.code) : null };
|
||||
/* จุดย่อย → ลิงก์ไป #/stops/other_stop?route=<รหัสสาย> (หน้ารวมจุดขึ้นรถของสายนั้น) */
|
||||
var linkHref = x.code ? href(opts, x.code)
|
||||
: (x.subStop ? '#/stops/other_stop?route=' + encodeURIComponent(x.subRoute) : null);
|
||||
return { name: x.name, km: x.km, off: x.off, note: x.note, href: linkHref, sub: !!x.subStop };
|
||||
}).sort(function (a, b) { /* เรียงตาม กม. ตามเส้นทาง (อ่านเป็นเส้นทางเดินรถ) */
|
||||
if (a.km === null || a.km === '') return 1;
|
||||
if (b.km === null || b.km === '') return -1;
|
||||
@@ -433,6 +470,8 @@ window.ATMap = (function () {
|
||||
}).sort(function (a, b) { return parseFloat(a.km) - parseFloat(b.km); });
|
||||
}
|
||||
renderKmList('route-map-list', rows);
|
||||
drawSubStops(map, routeStopRows(route, stations, others, main,
|
||||
(routesDoc || []).map(function (r) { return String(r.route_id); })), route.route_id, group);
|
||||
|
||||
var parts = ['<b>' + esc(routeId) + '</b> · ' + esc(t('map.captionRoute', { km: lineLengthKm(lines).toFixed(1), n: shelters.length }))];
|
||||
if (rows.length) parts.push(esc(t('map.stations')) + ' <b>' + rows.length + '</b>');
|
||||
@@ -443,7 +482,8 @@ window.ATMap = (function () {
|
||||
legend(el, [
|
||||
{ color: LINE_MAIN, label: t('map.legendRoute') },
|
||||
{ color: '#1f7a3d', square: true, label: t('map.legendStop') },
|
||||
{ color: '#f2a900', square: true, label: t('map.legendTerminal') }
|
||||
{ color: '#f2a900', square: true, label: t('map.legendTerminal') },
|
||||
{ color: '#7a4cc0', square: true, label: t('map.legendSubStop') }
|
||||
]);
|
||||
});
|
||||
}
|
||||
@@ -626,8 +666,98 @@ window.ATMap = (function () {
|
||||
map.fitBounds(L.latLngBounds(pts), { padding: [28, 28] });
|
||||
}
|
||||
|
||||
/* ---------- แผนที่ "เส้นทางที่เสนอ" (ยังไม่มีจริง — วาดจากโครงข้อมูลที่ผู้ใช้กำหนด) ----------
|
||||
spec = { origin:{lat,lng,label}, routes:[{ id, line_color, line_name,
|
||||
dest:{name,lat,lng}, via:[{name,lat,lng}] }] }
|
||||
เส้นที่ยังไม่ใส่พิกัดปลายทาง = ข้ามการวาด (ไปโผล่ในรายการฝั่งผู้เรียกแทน)
|
||||
onPick(route) เรียกเมื่อคลิกเส้น/จุด — ผู้เรียกเป็นคนแสดงรายละเอียดเอง */
|
||||
/* อ่านพิกัดจากได้ทั้ง 2 แบบ: coords = [lat, lng] (แบบใหม่) หรือ lat/lng แยก (แบบเดิม) */
|
||||
function coordOf(o) {
|
||||
o = o || {};
|
||||
if (Array.isArray(o.coords) && o.coords.length >= 2) {
|
||||
var a = num(o.coords[0]), b = num(o.coords[1]);
|
||||
return (a == null || b == null) ? null : [a, b];
|
||||
}
|
||||
var la = num(o.lat), ln = num(o.lng);
|
||||
return (la == null || ln == null) ? null : [la, ln];
|
||||
}
|
||||
|
||||
function proposal(el, spec, onPick) {
|
||||
var mk = makeMap(el), map = mk.map;
|
||||
var group = L.featureGroup().addTo(map);
|
||||
var pts = [];
|
||||
var o = spec.origin || {};
|
||||
var org = coordOf(o);
|
||||
if (!org) { return { map: map, empty: true }; }
|
||||
pts.push(org);
|
||||
L.circleMarker(org, { radius: 8, color: '#fff', weight: 3, fillColor: '#1f2a44', fillOpacity: 1 })
|
||||
.bindTooltip(esc(o.label || 'ต้นทาง'), { permanent: true, direction: 'top', offset: [0, -8], className: 'at-tip-org' })
|
||||
.addTo(group);
|
||||
|
||||
var pending = []; /* เส้นที่พิกัดปลายทางมาจาก geojson (โหลด async) */
|
||||
(spec.routes || []).forEach(function (r) {
|
||||
var d = r.dest || {};
|
||||
if (r.geo_id) { /* มีไฟล์เส้นทาง → โหลดเพื่อวาดเส้นจริง */
|
||||
pending.push(loadGeo(r.geo_id, spec).then(function (geo) {
|
||||
var ls = flatten(geo);
|
||||
r.__shape = toLatLngs(ls); /* ★ เส้นจริงจาก geojson (วาดตามที่ลากใน QGIS) */
|
||||
if (!coordOf(d)) { /* dest ยังไม่มีพิกัด → เดาจากจุดไกลสุดของเส้น */
|
||||
var ps = [];
|
||||
ls.forEach(function (l) { if (l && l.length) { ps.push(l[0]); ps.push(l[l.length - 1]); } });
|
||||
if (!ps.length) return;
|
||||
var ref = ps[0], far = ps[0], best = -1;
|
||||
ps.forEach(function (pt) {
|
||||
var dd = Math.pow(num(pt[0]) - num(ref[0]), 2) + Math.pow(num(pt[1]) - num(ref[1]), 2);
|
||||
if (dd > best) { best = dd; far = pt; }
|
||||
});
|
||||
d.coords = [num(far[1]), num(far[0])]; /* geojson = [lng, lat] → [lat, lng] */
|
||||
}
|
||||
r.__geoOk = true;
|
||||
}).catch(function () { /* อ่านไม่ได้ → ใช้ coords ที่มี (ถ้ามี) */ }));
|
||||
}
|
||||
});
|
||||
var drawAll = function () {
|
||||
(spec.routes || []).forEach(function (r) {
|
||||
var d = r.dest || {};
|
||||
var dl = coordOf(d);
|
||||
if (!dl) return; /* ยังไม่มีพิกัด → ข้าม */
|
||||
var col = r.line_color || '#7a4cc0';
|
||||
|
||||
/* เส้นจริงจาก geojson (ถ้ามี) → วาดตามเส้นที่ลากไว้ · ไม่มี → เส้นตรงต้นทาง→ปลายทาง + จุดแวะ */
|
||||
var segs = (r.__shape && r.__shape.length) ? r.__shape : [[org].concat(
|
||||
(r.via || []).map(coordOf).filter(Boolean), dl)];
|
||||
|
||||
/* smoothFactor 0.5 = ลดจุดน้อยลง (ค่าเริ่มต้น Leaflet = 1.0 ทำให้เส้นดูตรงตอนซูมออก) */
|
||||
var line = L.featureGroup(segs.map(function (seg) {
|
||||
return L.polyline(seg, { color: col, weight: 4, opacity: .85, dashArray: '10 8', smoothFactor: 0.5 });
|
||||
})).addTo(group);
|
||||
/* FeatureGroup ไม่มี setStyle → แนบ helper ให้ผู้เรียกใช้ได้เหมือน polyline เดี่ยว */
|
||||
line.setStyle = function (st) { this.eachLayer(function (l) { l.setStyle(st); }); return this; };
|
||||
var dot = L.circleMarker(dl, { radius: 7, color: '#fff', weight: 2, fillColor: col, fillOpacity: 1 })
|
||||
.bindTooltip(esc(d.name || ''), { direction: 'top', offset: [0, -6] }).addTo(group);
|
||||
pts.push(dl);
|
||||
|
||||
function pick(e) {
|
||||
if (e && e.originalEvent) L.DomEvent.stopPropagation(e);
|
||||
if (onPick) onPick(r, { line: line, dot: dot });
|
||||
}
|
||||
line.on('click', pick);
|
||||
dot.on('click', pick);
|
||||
r.__layer = { line: line, dot: dot }; /* ให้ผู้เรียกไฮไลต์ได้ */
|
||||
});
|
||||
|
||||
};
|
||||
/* มีเส้นที่ต้องอ่านพิกัดจาก geojson → รอให้ครบก่อนวาด · ไม่มี → วาดเลย */
|
||||
(pending.length ? Promise.all(pending) : Promise.resolve()).then(function () {
|
||||
drawAll();
|
||||
fitAll(map, pts);
|
||||
setTimeout(function () { map.invalidateSize(); }, 60);
|
||||
});
|
||||
return { map: map, group: group };
|
||||
}
|
||||
|
||||
return {
|
||||
route: route, forStop: forStop, nearMe: nearMe,
|
||||
route: route, forStop: forStop, proposal: proposal, nearMe: nearMe,
|
||||
NEAR_M: NEAR_M, LINE_MAIN: LINE_MAIN,
|
||||
maps: MAPS /* ไว้ตรวจสอบ/ทดสอบจากคอนโซล */
|
||||
};
|
||||
|
||||
+3
-2
@@ -5,7 +5,8 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="theme-color" content="#7a4cc0">
|
||||
<title>ออฟไลน์ | Atroute</title>
|
||||
<style>
|
||||
<link href="./vendor/fonts/k2d.css" rel="stylesheet">
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body {
|
||||
min-height: 100vh;
|
||||
@@ -13,7 +14,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 24px;
|
||||
font-family: "Noto Sans Thai", "Prompt", system-ui, sans-serif;
|
||||
font-family: "K2D", "Noto Sans Thai", "Prompt", system-ui, sans-serif;
|
||||
color: #1f2a44;
|
||||
background:
|
||||
radial-gradient(circle at 15% 15%, rgba(122,76,192,.18), transparent 40%),
|
||||
|
||||
@@ -35,3 +35,65 @@
|
||||
สร้าง `text5.json` + `pic5.jpg` — จบ (ไม่ต้องแก้โค้ด)
|
||||
|
||||
> แก้ไฟล์แล้วกด F5 เห็นผลทันที (โหลดแบบ network-first)
|
||||
|
||||
## แผนที่ในบทความ — 2 โหมด (กำหนดใน `textN.json` → คีย์ `map`)
|
||||
|
||||
### โหมด 1 · เส้นทางจริงที่มีอยู่แล้ว (ดึงจาก geojson)
|
||||
```json
|
||||
"map": { "route_id": "101", "height": 320, "interactive": false, "caption": "…" }
|
||||
```
|
||||
ขึ้นเฉพาะ**หน้าอ่านบทความ** (การ์ดในรายการยังใช้รูป) · ใช้ `geojson-web/<route_id>.geojson`
|
||||
· ถ้าไม่มีไฟล์นั้น → คงรูป `picN.*` + ป้าย "ยังไม่มีข้อมูลเส้นทางสายนี้"
|
||||
|
||||
### โหมด 2 · เส้นทางที่เสนอ (ยังไม่มีจริง = "ความฝัน") + คลิกดูรายละเอียด
|
||||
```json
|
||||
"map": {
|
||||
"origin": { "station_code": "at_main_terminal", "label": "บขส.อ่างทอง" },
|
||||
"routes": [
|
||||
{
|
||||
"id": "red-rangsit",
|
||||
"line_color": "#c8102e",
|
||||
"line_name": "สายสีแดง (ธานีรัถยา)",
|
||||
"dest": { "name": "ท่ารถตู้ต่างจังหวัด รังสิต", "lat": 13.989149716177037, "lng": 100.61472107391762 },
|
||||
"via": [ { "name": "ป่าโมก", "lat": null, "lng": null } ],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
}
|
||||
],
|
||||
"note": "ที่มา/แรงบันดาลใจ: https://…"
|
||||
}
|
||||
```
|
||||
|
||||
| คีย์ | จำเป็น | ความหมาย |
|
||||
|---|---|---|
|
||||
| `origin` | ✓ | จุดต้นทาง — ใส่ `station_code` (ค้นพิกัดจาก `stations.json` ให้เอง) **หรือ** `lat`/`lng` ตรง ๆ · `label` = ชื่อที่แสดง |
|
||||
| `routes[]` | ✓ | รายการเส้นทางที่เสนอ (มี `routes` = เข้าโหมดนี้ทันที) |
|
||||
| `line_color` | – | สีเส้น/หมุด (hex) · ไม่ใส่ = ม่วงแบรนด์ `#7a4cc0` |
|
||||
| `line_name` | – | ชื่อสาย (แสดงหัวแผงรายละเอียด) |
|
||||
| `dest.name` / `lat` / `lng` | ✓ | ปลายทาง · **lat/lng ต้องเป็นตัวเลข** ถ้าเว้น `null` → ไม่วาดบนแผนที่ แต่ขึ้นในรายการพร้อมป้าย "ยังไม่ใส่พิกัด" |
|
||||
| `via[]` | – | จุดจอดระหว่างทาง (`name` + `lat`/`lng` เป็นตัวเลขเท่านั้นจึงจะวาด) |
|
||||
| `distance_km` / `duration_min` / `fare_thb` | – | **เว้นเป็น `null` = ซ่อน** (ไม่โชว์ 0/ค่าว่าง) |
|
||||
| `note` | – | หมายเหตุรายเส้นทาง |
|
||||
| `note` (ระดับบน) | – | ที่มา/แรงบันดาลใจ → แสดงเป็นบรรทัดเล็กท้ายแผนที่ |
|
||||
|
||||
**การทำงาน**
|
||||
- วาดเส้นจากต้นทาง → (จุดแวะที่มีพิกัด) → ปลายทาง · เส้นประสีตามสาย · หมุดปลายทางสีเดียวกัน
|
||||
- **คลิกได้ 3 ทาง:** คลิกเส้นบนแผนที่ · คลิกหมุดปลายทาง · คลิกแถวในรายการใต้แผนที่ (มือถือกดง่ายสุด)
|
||||
→ แผงรายละเอียดด้านล่างแสดง `line_name` · ปลายทาง · จุดผ่าน · ระยะ/เวลา/ค่าโดยสาร (เฉพาะที่มีค่า) · หมายเหตุ
|
||||
- เลือกแล้วเส้นที่เลือกจะหนาขึ้น เส้นอื่นจางลง
|
||||
- พิกัดเป็น WGS84 (EPSG:4326) เท่านั้น
|
||||
|
||||
## รูปแบบข้อความใน `body` (มาร์กดาวน์เบา ๆ)
|
||||
|
||||
| เขียนแบบนี้ | ได้ผลลัพธ์ |
|
||||
|---|---|
|
||||
| `**หนา**` / `__หนา__` | **หนา** |
|
||||
| `*เอียง*` / `_เอียง_` | *เอียง* |
|
||||
| `` `โค้ด` `` | `โค้ด` |
|
||||
| `[ข้อความ](https://…)` | ลิงก์เปิดแท็บใหม่ |
|
||||
| `` | รูปแทรกกลางเนื้อหา |
|
||||
| `- ข้อความ` | รายการหัวข้อย่อย (เขียนติดกันหลายบรรทัด) |
|
||||
|
||||
> แก้ไฟล์แล้วกด F5 เห็นผลทันที (โหลดแบบ network-first)
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 233 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 91 KiB |
@@ -1,19 +1,25 @@
|
||||
{
|
||||
"date": "2026-09-14",
|
||||
"th": {
|
||||
"title": "เปิดเพิ่ม 3 เส้นทางช่วงปลายฝน",
|
||||
"tag": "ข่าว",
|
||||
"title": "ความรู้สึกที่รวบรวมข้อมูลต่างๆ",
|
||||
"tag": "ความรู้สึก",
|
||||
"body": [
|
||||
"ช่วงปลายฝนนี้มีเส้นทางใหม่เปิดให้บริการเพิ่ม 3 เส้นทาง เชื่อมต่ออ่างทองกับจังหวัดใกล้เคียง เริ่มตั้งแต่ต้นเดือนตุลาคมเป็นต้นไป",
|
||||
"ตารางเดินรถของเส้นทางใหม่จะอัปเดตในหน้า “เช็กเวลาเดินรถ” ทันทีที่ผู้ประกอบการยืนยันรอบวิ่ง — ฝากติดตามไว้ด้วยครับ"
|
||||
"สวัสดีครับ นี่เป็นบทความแรกของหมวดบ่นไปเรื่อย การเราไปขอข้อมูลช่องทางติดต่อ ติดตามข่าวสาร ถ่ายรูปรถประจำทางเส้นทางๆเหมือนต่อจิ๊กซอทีละชิ้น ยิ่งถ้าเป็นลุงๆป้าๆรถสองแถวต้องตามรอยขนมปังแบบนิทานฝรั่งเลย",
|
||||
"ก็หวังว่าเว็บนี้จะทำให้การเดินทางด้วยรถประจำทางในจังหวัดอ่างทองง่ายขึ้นไม่มากก็น้อยนะครับ",
|
||||
"การพี่ๆน้องๆคนทั่วไป เข้าเว็ปมาแล้วเข้ากลุ่มไลน์ กลุ่มเฟช เพจ หรือโทรถามเวลาเดินรถก็ถือว่าได้ทำตามความตั้งใจครบแล้วล่ะ ตารางเวลาเราอยากทำเป็นตัวอย่างเฉยๆ อย่าไปเชื่อมากเราก็ไม่มีเวลาแก้ให้ถูกทุกวันและทุกสาย เพราะบางสายก็ปรับเวลาทุกวัน",
|
||||
"เราเลือกรูปนี้เพราะเป็นจุดเริ่มต้นเลยแค่จะขึ้นรถมินิบัส สายใน ไปกรุงเทพ ทำไมเราต้องรู้นั่น รู้นี่จัง ต้องรู้ว่ารถส่วนใหญ่ไปไม่ถึงอ่างทอง ต้องรู้ว่ารถที่ออกจากอ่างทองมีแค่เช้ามืดแต่เอาจริงๆรถคันที่เห็นรูปน่าจะเป็นคันสุดท้ายที่ขับถึงอ่างทอง บางคนถามว่าทำไมเลือกสายนี้ คือมันได้ดูวิว ตลาดป่าโมก ตลาดเจ้าพรหม วัดภูเขาทอง ถ้าเลือกได้ก็อยากนั่งสายในก่อน",
|
||||
"ส่วนการติดต่อสอบถามหน่วยงานราชการ ก็ขอข้อมูลไปหลายแห่ง ตามที่คนเรียนหมายบอกว่าส่วนใหญ่ถ้าแค่คนธรรมดา ไม่ได้มาจากหน่วยงานตรวจสอบ องค์กร หรือมูลนิธิต่างๆ เขาไม่บอกหรอ ต้องเขียนจดหมายอ้างถือกฎระเบียบ อำนาจ หน้าที่ ประกบคู่กับ พ.ร.บ.ข้อมูลข่าวสาร เราก็ไม่ได้อ้างกฎหมายอย่างละเอียดก็จริงตามที่นักกฎหมายบอก มียกเว้นที่เดียวเห็นจะมีแค่แขวงทางหลวงจังหวัดอ่างทอง ที่ให้ข้อมูลศาลารอรถโดยไม่ต้องอ้างถึงระเบียบและพ.ร.บ.ข้อมูลข่าวสาร ต้องขอขอบคุณ ณ ที่นี้"
|
||||
]
|
||||
},
|
||||
"en": {
|
||||
"title": "Three new routes open this rainy season",
|
||||
"tag": "News",
|
||||
"title": "What it felt like gathering all this data",
|
||||
"tag": "Feelings",
|
||||
"body": [
|
||||
"Three new routes connecting Ang Thong with nearby provinces will start service in early October.",
|
||||
"Their schedules will appear on the Check Schedules page as soon as operators confirm the trips — stay tuned."
|
||||
"Hi there — this is the first post in the Bored Ramblings series. Asking around for contact details, following the news, photographing buses route by route felt like putting together a jigsaw puzzle, one piece at a time. And with the older songthaew drivers, it was like following a trail of breadcrumbs straight out of a fairy tale.",
|
||||
"I hope this site makes getting around Ang Thong by bus at least a little easier.",
|
||||
"If people — anyone at all — come to the site and then join the LINE group, the Facebook group, the page, or simply call to ask about departure times, then I'd say the whole thing has done what it set out to do. The timetables are meant as a rough guide only, so please don't take them too literally. I don't have time to fix them every day for every route, and some lines change their times daily.",
|
||||
"I picked this photo because it's where it all began — just to catch a minibus on the local route into Bangkok. Why does one need to know this, and that? You need to know that most buses don't actually reach Ang Thong; you need to know the only buses leaving Ang Thong head out at dawn — and honestly, the bus in the photo was probably the last one that made it to Ang Thong that day. Some people ask why I picked this route. Because of the view: Pa Mok market, Chao Phrom market, Wat Phu Khao Thong. If I had the choice, I'd take the local line every time.",
|
||||
"As for contacting government agencies, I sent requests to quite a few of them. And going by what people who've studied this told me, most of them won't tell you anything if you're just an ordinary citizen — not from an oversight body, an organisation, or a foundation. You have to write a formal letter citing regulations, authority and duties, backed up with the Official Information Act. I didn't cite the law in as much detail as the lawyers suggested. There was one exception: the Ang Thong Highway District gave me information about the bus shelters without asking for any references to regulations or the Official Information Act. My thanks to them here."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,257 @@
|
||||
{
|
||||
"date": "2026-09-10",
|
||||
"map": {
|
||||
"origin": {
|
||||
"coords": [
|
||||
14.59489,
|
||||
100.45161
|
||||
],
|
||||
"label": "บขส.อ่างทอง"
|
||||
},
|
||||
"groups": [
|
||||
{
|
||||
"id": "existing",
|
||||
"label": "รถประจำทางผ่านอยู่แล้ว",
|
||||
"routes": [
|
||||
{
|
||||
"id": "line15",
|
||||
"geo_id": "15",
|
||||
"line_color": "#7cb342",
|
||||
"line_name": "สาย 15 (กรุงเทพ-อ่างทอง สายใน)",
|
||||
"dest": {
|
||||
"name": "BTS หมอชิต · MRT จตุจักร",
|
||||
"coords": [
|
||||
13.803471537697645,
|
||||
100.55428211112948
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "line902",
|
||||
"geo_id": "902",
|
||||
"line_color": "#1f5fbf",
|
||||
"line_name": "สาย 902 (กรุงเทพ-อ่างทอง สายเอเซีย)",
|
||||
"dest": {
|
||||
"name": "BTS หมอชิต · MRT จตุจักร",
|
||||
"coords": [
|
||||
13.803471537697645,
|
||||
100.55428211112948
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "line952",
|
||||
"geo_id": "952",
|
||||
"line_color": "#7a4cc0",
|
||||
"line_name": "สาย 952 (กรุงเทพ-วิเศษชัยชาญ)",
|
||||
"dest": {
|
||||
"name": "MRT คลองบางไผ่",
|
||||
"coords": [
|
||||
13.89239670552972, 100.40816596702227
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "line952",
|
||||
"geo_id": "952",
|
||||
"line_color": "#7a4cc0",
|
||||
"line_name": "สาย 952 (กรุงเทพ-วิเศษชัยชาญ)",
|
||||
"dest": {
|
||||
"name": "MRT ตลาดบางใหญ่",
|
||||
"coords": [
|
||||
13.880976188776955, 100.40915071255077
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "improve",
|
||||
"label": "ปรับปรุงจากเส้นทางเดิม",
|
||||
"routes": [
|
||||
{
|
||||
"id": "line101",
|
||||
"geo_id": "101",
|
||||
"line_color": "#a51f2e",
|
||||
"line_name": "สาย 101 (อ่างทอง-ป่าโมก-อยุธยา)",
|
||||
"dest": {
|
||||
"name": "สถานีรถไฟ/รถไฟฟ้าชานเมืองอยุธยา",
|
||||
"coords": [
|
||||
14.356766025721091,
|
||||
100.58296985329517
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "line952b",
|
||||
"geo_id": "952",
|
||||
"line_color": "#FF8F94",
|
||||
"line_name": "สาย 952 (ขยายถึงสถานีรถไฟฟ้าชานเมืองชุมทางตลิ่งชัน)",
|
||||
"dest": {
|
||||
"name": "สถานีรถไฟฟ้าชานเมืองชุมทางตลิ่งชัน",
|
||||
"coords": [
|
||||
13.78935132220992, 100.43941463521845
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "new",
|
||||
"label": "เปิดเส้นทางใหม่",
|
||||
"routes": [
|
||||
{
|
||||
"id": "banchang",
|
||||
"geo_id": "dream-banchang",
|
||||
"line_color": "#a51f2e",
|
||||
"line_name": "สถานีรถไฟฟ้าชานเมืองชุมทางบ้านภาชี (สายสีแดงเข้ม)",
|
||||
"dest": {
|
||||
"name": "ชุมทางบ้านภาชี",
|
||||
"coords": [
|
||||
14.450689476023536,
|
||||
100.72094907399251
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "ayutthaya-hsr",
|
||||
"geo_id": "dream-ayutthaya-hsr",
|
||||
"line_color": "#a51f2e",
|
||||
"line_name": "สถานีรถไฟความเร็วสูงอยุธยา",
|
||||
"dest": {
|
||||
"name": "สถานีรถไฟความเร็วสูงอยุธยา",
|
||||
"coords": [
|
||||
14.356766025721091,
|
||||
100.58296985329517
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "pakkret",
|
||||
"geo_id": "dream-pakkret",
|
||||
"line_color": "#e0509b",
|
||||
"line_name": "MRT แยกปากเกร็ด (รางเดี่ยวสีชมพู)",
|
||||
"dest": {
|
||||
"name": "MRT แยกปากเกร็ด",
|
||||
"coords": [
|
||||
13.906656941460735,
|
||||
100.50553319459016
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "muangthong",
|
||||
"geo_id": "dream-muangthong",
|
||||
"line_color": "#e0509b",
|
||||
"line_name": "MRT ทะเลสาบเมืองทองธานี (รางเดี่ยวสีชมพู)",
|
||||
"dest": {
|
||||
"name": "MRT ทะเลสาบเมืองทองธานี",
|
||||
"coords": [
|
||||
13.918274061982352,
|
||||
100.54526798554069
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
},
|
||||
{
|
||||
"id": "Watcharapol",
|
||||
"geo_id": "dream-Watcharapol",
|
||||
"line_color": "#e0509b",
|
||||
"line_name": "MRT วัชรพล (รางเดี่ยวสีชมพู)",
|
||||
"dest": {
|
||||
"name": "MRT วัชรพล",
|
||||
"coords": [
|
||||
13.8496,
|
||||
100.64198
|
||||
]
|
||||
},
|
||||
"via": [],
|
||||
"distance_km": null,
|
||||
"duration_min": null,
|
||||
"fare_thb": null,
|
||||
"note": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"th": {
|
||||
"title": "วิธีดูว่ารถสาย 101 ผ่านป้ายเรากี่โมง",
|
||||
"tag": "วิธีใช้",
|
||||
"title": "อยากให้มีรถประจำทางเชื่อมต่อสถานีรถไฟฟ้า",
|
||||
"tag": "ความฝัน",
|
||||
"body": [
|
||||
"เปิดหน้าป้ายหยุดรถ เลือกป้ายที่ต้องการ แล้วดูรายการ “สายรถที่ผ่านจุดนี้” — ระบบจะไฮไลต์เที่ยวถัดไปให้อัตโนมัติ",
|
||||
"ถ้าต้องการดูทุกจุดจอดของสาย เข้าเมนูรายละเอียดสายรถ หรือกดปุ่มเช็กเวลาเดินรถเพื่อดูตารางแบบเต็มในหน้าเดียว"
|
||||
"เราเป็นคนชอบนั่งรถไฟฟ้า เราก็ฝันอยากให้จังหวัดอ่างทองมีเส้นทางที่วิ่งตรงจาก บขส.อ่างทอง ผ่านสถานีขนส่งประจำอำเภอยิงตรงจอดหน้าหรือใต้สถานีรถไฟฟ้าสายต่างๆไม่ต้องเปลี่ยนรถหลายรอบ",
|
||||
"เอาจริงๆเราก็รู้แหละว่าไม่น่าเป็นไปได้จากหลายสาเหตุ เช่น ใครจะมาประกอบธุรกิจมันหมดยุครถประจำทางแล้ว ทุกบ้านมีมอไซ 2-3 คัน รถยนต์อีก 1-2 คัน ใครจะขึ้นเวลาใครถามก็บอกดีๆแต่จะเหลือคนขึ้นรถประจำทางจริงๆเท่าไร ขนาดเราเองก็ไม่ได้ขึ้นรถประจำทางนานมากแล้ว ระบบราชการ ระเบียบใช้คำว่าอะไรดีแปลกๆมั้งแบบว่าหห้ามออกใบอนุญาตทับเส้นทางกัน คือสมมติ เขาวิ่งแค่เช้าเย็นแล้วเส้นทางเราทับเขา แต่เราวิ่งสายกับบ่าย เขาก็ประท้วงได้ แบบ??? หะ",
|
||||
"แบ่งเส้นทางออกเป็นสองกลุ่มคือ 1.รถประจำทางผ่านอยู่แล้ว 2.ปรับปรุงจากเส้นทางเดิม 3.เปิดเส้นทางใหม่",
|
||||
"1.รถประจำทางผ่านอยู่แล้ว ได้แก่ รถไฟฟ้าสายสีเขียวอ่อน และสายสีน้ำเงิน โดยสายที่ผ่านได้แก่ 15 กรุงเทพ-ป่าโมก-อ่างทอง(สายใน) และ 902 กรุงเทพ-อ่างทอง(สายเอเซีย) ผ่าน BTS หมอชิตและ MRT จตุจักร และรถไฟฟ้าสายสีม่วง ได้แก่ 952 · กรุงเทพ-วิเศษชัยชาญ ผ่าน MRT คลองบางไผ่ กับ ตลาดบางใหญ่",
|
||||
"2.ปรับปรุงจากเส้นทางเดิม เส้นทางเดิมห่างจากสถานีรถไฟฟ้าเกือบ 1 กิโลเมตร อยากให้กรมการขนส่งและผู้ประกอบการเห็นพ้องกันขยายเส้นทางไปถึงหน้าสถานีรถไฟฟ้า ได้ สายสีแดงเข้ม(สถานีในอนาคต) 101 อ่างทอง-อยุธยา ปัจจุบันต้องจอดก่อนสามแยกเข้าเจ้าพรหม เดิน 300-400 เมตร นั่งเรือข้ามฟาก เดินอีก 100+ เมตร ถึงสถานีรถไฟอยุธยาซึ่งสถานีใหม่เยื้องๆไปหน่อยนึงแค่ข้ามสะพานเลี้ยวซ้ายไปเกือบๆครึ่งโลจะถึงแล้วไม่รู้จะมีอุปสรรคหรือลุงๆคนขับจะอยากขับอ้อมไป-กลับอีกหรือเปล่า หรือเอาเข้าจริงพอสถานีก่อสร้างเสร็จคนอ่างทองจะไปจริงๆหรือเปล่า หรือจะแบ่งเป็นสายย่อยก็ได้ส่วนใหญ่ลุงก็ขับแบบเดิมแต่มี ช่วง (อ่างทอง-สถานีรถไฟฟ้าชานเมืองอยุธยา) ต่างห่างแบบ มินิบัสซักคัน ตั้งเป้าว่าจะไปให้ถึงสถานีก่อนรถไฟฟ้าออกซัก 10-15 นาที เพราะเราเชื่อว่ารถไฟฟ้าชานเมืองไม่ได้ออกถี่ๆเท่ากับรถไฟฟ้าสีเขียว สีน้ำเงินระยะทางมันไกล และสายสีแดงอ่อนสถานีรถไฟฟ้าชุมทางตลิ่งชัน ปัจจุบันยังไม่น่าสนใจแต่ถ้ารถไฟฟ้าชานเมืองก่อสร้างเต็มระบบ สถานีนี้สามารถไปนครปฐม สถานีกลางกรุงเทพอภิวัฒน์ และโรงพยาบาลศิริราชได้ด้วยรถไฟฟ้าไม่ต้องผ่ารถติด สาย 952 กรุงเทพ-วิเศษชัยชาญ เคยไป3-4 ครั้งถนนแอบงงๆ แต่ก็อยากให้ขยายเส้นทางอยู่ดี",
|
||||
"3.เปิดเส้นทางใหม่ เอาจริงๆข้อนี้ก็ยากเพราะข้าราชการจะยอมเปิดเส้นทางใหม่มั้ย ถ้าเปิดเส้นทางใหม่แล้วใครจะมาประมูลใบอนุญาตและกลุ่มผู้โดยสารขาประจำจะมีเพียงพอมั้ยก็ไม่รู้ อยากเสนอให้พิจารณา ได้แก่ ",
|
||||
"รถไฟฟ้าสายสีแดงเข้ม อ่างทอง-ป่าโมก-สถานีชุมทางบ้านภาชี ทั้งๆที่มีสถานีรถไฟชานเมืองอยู่แล้ว แม้ว่าจะอ้อมกว่าเล็กน้อยจะเสนอ เพราะว่าการขึ้นสถานีต้นทางประกันว่ามีที่นั่งแน่นอนและหนีความวุ่นวาย สถานีรถไฟฟ้าอยุธยาต้องวุ่นวายทั้งคนรอรถไฟความเร็วสูง รถไฟฟ้าชานเมือง นักท่องเที่ยว ",
|
||||
"รถไฟฟ้าความเร็วสูง อ่างทอง-ป่าโมก-สถานีรถไฟฟ้าความเร็วสูงอยุธยา ทั้งๆที่ตั้งอยู่ที่เดียวกันนั่นแหละ แต่เสนอเพราะอยากให้เดินทางเร็วสอดคล้องกับเที่ยวรถไฟความเร็วสูงคนที่จะไป อีสานและกรุงเทพ ",
|
||||
"รถไฟฟ้ารางเดี่ยวสีชมพู อ่างทอง-ป่าโมก-MRT แยกปากเกร็ด หรือ ทะเลสาบเมืองทองธานี หรือวัชรพล เชื่อมต่อรถไฟฟ้ารางเดี่ยวสามารถพาไปส่วนต่างๆของนนทบุรีได้และต่อไปรถไฟฟ้าสายสีอื่นๆได้ "
|
||||
]
|
||||
},
|
||||
"en": {
|
||||
"title": "How to see when route 101 passes your stop",
|
||||
"tag": "How-to",
|
||||
"title": "I wish there were buses connecting to the rail lines",
|
||||
"tag": "A dream",
|
||||
"body": [
|
||||
"Open Bus Stops, pick your stop, then check the routes serving it — the next departure is highlighted automatically.",
|
||||
"For every stop along a route, open Route Details or hit Check Schedules for the full table in one page."
|
||||
"I'm a rail person at heart, and I keep dreaming that Ang Thong would have routes running straight from the Ang Thong Bus Terminal, through the district bus stations, and stopping right at — or under — the various rail stations, without having to change buses several times.",
|
||||
"Honestly, I know it's unlikely for a lot of reasons. Who's going to build a business on it when the era of the bus is over? Every household has two or three motorbikes and another one or two cars. Who's going to ride? Ask anyone and they'll be polite about it, but how many people will actually still take the bus? Even I haven't taken one in ages. Then there's the bureaucracy — some odd rule about not granting a licence that overlaps another operator's route. Say they only run mornings and evenings and our route overlaps theirs: even if we run in the afternoon, they can still file an objection. Like… what?",
|
||||
"I'd split the routes into two groups: 1) buses that already pass through, 2) improvements to existing routes, 3) brand-new routes.",
|
||||
"1. Buses that already pass through: the Light Green and Blue lines. The routes that qualify are 15 (Bangkok–Pa Mok–Ang Thong, local line) and 902 (Bangkok–Ang Thong, Asia line), which pass Mo Chit BTS and Chatuchak MRT. And the Purple Line: 952, Bangkok–Wiset Chai Chan, passing Khlong Bang Phai MRT and Bang Yai market.",
|
||||
"2. Improving existing routes: the old routes stop nearly a kilometre from the rail stations. I'd like the Department of Land Transport and the operators to agree on extending them right up to the station forecourt. Take the Dark Red Line (a future station): route 101, Ang Thong–Ayutthaya, currently has to stop before the junction into Chao Phrom — walk 300–400 metres, take a ferry across, walk another 100-plus metres, and you reach Ayutthaya railway station, whose new building sits slightly off to one side; cross the bridge, turn left, and it's almost another half a kilometre. I don't know whether there'll be obstacles, or whether the drivers will want to make the detour out and back. Or, honestly, whether people from Ang Thong will actually go once the station is finished. Or it could be split into a sub-route — most of the drivers would keep running as they do now, but with a stretch (Ang Thong–Ayutthaya suburban rail station) served separately, maybe by a minibus. The aim would be to arrive at the station 10–15 minutes before the train leaves, because I don't believe the suburban rail runs as frequently as the Green or Blue lines — the distance is much longer. And the Light Red Line's Taling Chan station isn't very appealing right now, but once the suburban rail system is fully built, that station can reach Nakhon Pathom, Krung Thep Aphiwat Central Terminal and Siriraj Hospital by rail, without getting stuck in traffic. As for route 952, Bangkok–Wiset Chai Chan, I've taken it three or four times and the roads still confuse me — but I'd still like to see its route extended.",
|
||||
"3. Brand-new routes: honestly, this part is hard, because will the officials even allow a new route? And if they do, who'll bid for the licence, and will there be enough regular passengers? I don't know. But I'd like the following to be considered:",
|
||||
"The Dark Red Line: Ang Thong–Pa Mok–Ban Phachi Junction. Even though it's a bit of a detour, I'd propose it because starting at the origin station guarantees you a seat and lets you skip the crowds. Ayutthaya's rail station is chaotic — people waiting for the high-speed train, the suburban rail, and tourists all at once.",
|
||||
"The High-Speed Rail: Ang Thong–Pa Mok–Ayutthaya High-Speed Rail Station. It's at the same place, yes, but I propose it because it makes for fast travel that lines up with the high-speed train's own departures — for people heading to Isan and to Bangkok.",
|
||||
"The Pink monorail: Ang Thong–Pa Mok–Pak Kret MRT, or Muang Thong Thani lakeside, or Watcharaphol. Connecting to the monorail lets you reach different parts of Nonthaburi and then transfer to other rail lines."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,45 @@
|
||||
{
|
||||
"date": "2026-09-05",
|
||||
"date": "2024-07-18",
|
||||
"th": {
|
||||
"title": "อัปเดตตารางเดินรถสาย 902",
|
||||
"tag": "อัปเดต",
|
||||
"title": "ถ้าผมได้ออกแบบสายเดินรถเอง จะออกแบบอะไร",
|
||||
"tag": "ความฝัน",
|
||||
"body": [
|
||||
"สาย 902 (กรุงเทพ–อ่างทอง สายเอเซีย) ปรับรอบวิ่งช่วงเย็นจากเดิมออกทุก 50 นาที เป็นทุก 40 นาที ตั้งแต่วันที่ 1 กันยายน",
|
||||
"รอบเช้าและรอบกลางวันยังคงเดิม หากมีเปลี่ยนแปลงเพิ่มเติมจะแจ้งผ่าน LINE Official ของสายโดยตรง"
|
||||
"บทความนี้ไม่รู้ว่าจะมีประโยชน์อะไร แต่ถ้าไม่เขียนรู้สึกเหมือนจิ๊กซอว์ยังไม่ครบ ก่อนอื่นก็ต้องขอบคุณใครก็ตามที่เข้ามาอ่าน มันแค่ความฝันตอนนั่งรถประจำทางว่าถ้าเราเป็นคนออกแบบได้ เราอยากทำอะไรบ้าง",
|
||||
"อย่างแรก ตอนที่เราเป็นคนนั่ง เราคาดหวังอะไรบ้าง มันแยกได้เป็นสองระดับ คือ **1. ไหว้ล่ะ ขอให้ทำหน่อย** ได้แก่ 1) คนขับสุภาพ 2) รถไม่โทรม (เก่าแต่ไม่โทรมก็ดีนะ) 3) รถแอร์ — ไหว้ล่ะ ขอให้หมดยุครถร้อนเถอะ ใครติดแอร์ได้ติดแอร์เถอะ 4) ป้ายรอรถ ศาลารอรถ มีป้ายบอกว่ารถสายนี้ผ่าน 5) เวลาปล่อยรถแน่นอน ไม่ต้องเป๊ะหรอก แค่ช้าไม่เกิน 10 นาทีก็ดีมากแล้ว 6) มีเบอร์ให้โทรถาม",
|
||||
"และ **2. มีก็ขอบคุณ ไม่มีก็ไม่เป็นไร** ได้แก่ 1) รถติด GPS 2) ดูตำแหน่งรถผ่านเว็บหรือแอป 3) ศาลารอรถมีแอร์/พัดลม ไอเย็น ๆ 4) มีที่ชาร์จแบต 5) มี Wi-Fi ฟรี",
|
||||
"พอนั่งเขียน ๆ ก็เยอะเหมือนกันนะเนี่ย เราคาดหวังบริการขนาดนี้ กับกลุ่มธุรกิจขาลง ค่าน้ำมันแพง คนนิยมซื้อรถยนต์-มอไซค์ หน่วยงานราชการไม่สนับสนุนจริงจัง มีการควบคุมราคา ค่าตั๋วแพงไม่ได้ มีรถนักเรียนแข่ง มีรถทับเส้นทาง",
|
||||
"ถึงกระนั้น รถประจำทางยังเจาะกลุ่มคน 5 กลุ่มได้ ทั้งขาประจำและขาจร ได้แก่ 1) นักเรียน นักศึกษา 2) พ่อค้าแม่ค้าขายของในตลาด — แทบเป็นขาประจำ รถหลายสายก็อยู่ได้ด้วยผู้โดยสารกลุ่มนี้ 3) ระยะทางไกลกว่าจะขับมอไซค์ไหว 4) พื้นที่หนาแน่นจนจอดรถยนต์ยาก 5) มาทำธุระ",
|
||||
"พื้นที่หนาแน่นมาก ๆ แทบไม่มีในอ่างทองเลย ยกเว้นตลาดอ่างทอง หน่วยงานราชการหลายหน่วยขยันตัดถนน แต่มีหน่วยงานไหนทำที่จอดรถจริงจังบ้าง เรื่องที่จอดรถนี่แหละที่พอเป็นจุดเรียกผู้โดยสารขาจรได้",
|
||||
"เมื่อมีความหวังและรู้กลุ่มผู้โดยสารแล้ว ก็มาเลือกเส้นทางกัน เส้นทางที่น่าสนใจมี 4 แบบ",
|
||||
"1) **324 อ่างทอง-วัดพิกุลทอง** เพราะผ่านสถานที่พักผ่อน 5 แห่ง แม้จะโทรมไปบ้าง แต่ถ้าปรับปรุงทางเข้าหรือมีรถสายสั้นมารับส่งต่อก็น่าสนใจมาก",
|
||||
"2) **1011 อ่างทอง-แสวงหา-สีบัวทอง** เพราะผ่าน 2 อำเภอ",
|
||||
"3) **2293 อ่างทอง-โผงเผง** เพราะผ่านโรงเรียนโยธินบูรณะอ่างทองและโรงเรียนป่าโมกข์วิทยาภูมิ ถ้าขยายไปถึงโรงเรียนวัดป่าโมกได้จะดีมาก",
|
||||
"4) **เปิดเส้นทางใหม่** บขส.อ่างทอง (ต้นทาง) → บิ๊กซี/โลตัส → อบจ. → สาธารณสุขจังหวัด → ปั๊มร่มไทร → อบต.บ้านอิฐ → โตโยต้าโฆสิต → ศาลจังหวัดอ่างทอง (ปลายทาง)",
|
||||
"ถ้าให้เลือกจริง ๆ ผมเลือก **1011 อ่างทอง-แสวงหา-สีบัวทอง** เพราะผ่านตัวอำเภอถึง 2 อำเภอ โอกาสมีผู้โดยสารน่าจะเยอะที่สุด",
|
||||
"เรื่องคนขับ อยากได้เป็นของตัวเอง 3-4 คน จะพยายามเลือกคนขับใจเย็นและไม่ตัด GPS มั้ง",
|
||||
"เรื่องรถ ถ้าเอาอุดมคติก็ต้องมินิบัส 14-16 ที่นั่ง ถอดเบาะสัก 2-4 ตัว ให้พ่อค้าแม่ค้าวางของไปขายตลาดได้ แต่ถ้าพูดแบบที่เป็นไปได้จริง ก็ขอรถกระบะสองแถวติดแอร์มากกว่า (กระบะรับจบ)",
|
||||
"สุดท้ายเรื่องประสานงาน ก็ต้องขอร้องหน่วยงานราชการให้ติดป้ายบอกข้อมูลสายเดินรถตามป้ายรอรถ-ศาลารอรถ ตัวอย่างที่ดีคือที่อำเภอวิเศษชัยชาญ"
|
||||
]
|
||||
},
|
||||
"en": {
|
||||
"title": "Route 902 timetable update",
|
||||
"tag": "Update",
|
||||
"title": "If I could design the bus routes myself",
|
||||
"tag": "A dream",
|
||||
"body": [
|
||||
"Route 902 (Bangkok–Ang Thong, Asia line) now departs every 40 minutes in the evening instead of 50, effective 1 September.",
|
||||
"Morning and midday trips are unchanged. Further changes will be announced via the line's LINE Official."
|
||||
"I'm not sure this article is useful to anyone, but not writing it feels like a jigsaw puzzle left unfinished. First of all, thank you to anyone reading this. It's just a daydream from my seat on the bus: if I were the one designing the routes, what would I do?",
|
||||
"Let's start with what I hope for as a passenger. It splits into two levels. **1. Please, I'm begging you** — 1) polite drivers 2) buses that aren't run-down (old but well kept is fine) 3) air conditioning; please, let the era of the hot bus end 4) proper bus shelters with signs showing which routes stop there 5) departures that keep to schedule — not to the minute, but within 10 minutes is already great 6) a phone number to call.",
|
||||
"And **2. Nice to have, but no big deal if not** — 1) GPS on the bus 2) live vehicle tracking on the web or in an app 3) air-conditioned shelters or at least fans and cool mist 4) charging points 5) free Wi-Fi.",
|
||||
"Writing it all down, it's quite a list. We expect this much service from an industry in decline: fuel is expensive, people prefer their own cars and motorbikes, government agencies don't really back public transport, fares are capped and can't rise, student buses compete, and routes overlap each other.",
|
||||
"Even so, buses can still reach five groups of people, both regulars and occasional riders: 1) students 2) market traders — practically regulars; many routes survive on them alone 3) people whose trip is too far for a motorbike 4) dense areas where parking a car is hard 5) people running errands.",
|
||||
"Really dense areas barely exist in Ang Thong, except around the Ang Thong market. Plenty of agencies are quick to build roads, but how many actually build car parks? Parking, of all things, is what draws in the occasional rider.",
|
||||
"Once we have hope and know our passengers, it's time to pick the routes. Four are worth considering.",
|
||||
"1) **Route 324, Ang Thong–Wat Phikul Thong** — it passes five leisure spots. They're a bit run-down, but with better access roads or a short feeder service it would be very appealing.",
|
||||
"2) **Route 1011, Ang Thong–Sawaeng Ha–Si Bua Thong** — it crosses two districts.",
|
||||
"3) **Route 2293, Ang Thong–Phong Pheng** — it passes Yothinburana Ang Thong School and Pa Mok Witthayaphum School. Extending it to Wat Pa Mok School would be even better.",
|
||||
"4) **A brand-new route** — Ang Thong Bus Terminal (origin) → Big C/Lotus's → PAO → Ang Thong Provincial Public Health Office → Rom Sai petrol station → Ban It Subdistrict Administration → Kositt Toyota → Ang Thong Provincial Court (terminus).",
|
||||
"If I really had to choose, I'd pick **1011, Ang Thong–Sawaeng Ha–Si Bua Thong**, because it crosses two districts, so the odds of having enough passengers are the best.",
|
||||
"As for drivers, I'd want three or four of my own — I'd try to pick calm ones, and ones who don't switch the GPS off.",
|
||||
"As for the vehicle, the ideal would be a 14–16 seat minibus with two to four seats removed so traders can carry goods to market. But realistically, I'd rather have an air-conditioned pickup songthaew — the pickup that does it all.",
|
||||
"Last is coordination: we'd need to ask the agencies to put route information on the bus shelters and stop signs. Wiset Chai Chan district is a good example to follow."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,37 @@
|
||||
{
|
||||
"date": "2026-08-28",
|
||||
"date": "2024-07-18",
|
||||
"th": {
|
||||
"title": "ทำไมตารางรถถึงเปลี่ยนบ่อย",
|
||||
"tag": "ความรู้",
|
||||
"title": "วิธีเดินทางไปสถานีรถไฟ และสนามบิน",
|
||||
"tag": "วิธีเดินทาง",
|
||||
"body": [
|
||||
"ตารางเดินรถของรถโดยสารประจำทางเปลี่ยนได้ตามสภาพการจราจร จำนวนผู้โดยสาร และช่วงเทศกาล — บางสายปรับตามวันหยุดอีกด้วย",
|
||||
"เราจึงแสดงเวลาดิบจากผู้ประกอบการเสมอ และมีหมายเหตุเตือนให้เช็กเวลากับทางสายโดยตรงก่อนเดินทางในวันที่ฝนตกหรือวันหยุดยาว"
|
||||
"บทความนี้รวบรวมวิธีเดินทางไประบบขนส่งหลัก จริง ๆ มีหลายวิธี แต่เราเลือกตามเกณฑ์ 2 ข้อ คือ 1) รถประจำทางเส้นนั้นเข้าบขส.อ่างทองหรือสถานีขนส่งป่าโมกไหม 2) มีต้นทางอยู่ในอ่างทองไหม ถ้าไม่มีก็ต้องใช้รถระหว่างจังหวัดเอา",
|
||||
"**สถานีรถไฟ** ที่น่าสนใจมี สถานีรถไฟอยุธยา ลพบุรี สระบุรี ท่าเรือ และสุพรรณบุรี แต่รอบนี้เลือกเฉพาะที่มีข้อมูลแน่นก่อน",
|
||||
"**สถานีรถไฟอยุธยา** — ไม่ว่าจะเริ่มจากบขส.อ่างทองหรือสถานีขนส่งป่าโมก ก็ขึ้นรถเหมือนกัน คือรถตู้สาย 15 กรุงเทพ-ป่าโมก-อ่างทอง (สายใน) ซึ่งที่บขส.อ่างทองมีเฉพาะเช้ามืด และรถสองแถวสาย 101 อ่างทอง-ป่าโมก-อยุธยา",
|
||||
"ก่อนถึงสามแยกเข้าตลาดเจ้าพรหม กดกริ่งลงเดินประมาณ 200-300 เมตร ไปที่เรือข้ามฟากแล้วเดินต่อไปสถานีรถไฟ หรือจะรอลงที่ตลาดเจ้าพรหมแล้วนั่งรถรอบเมืองก็ได้ แต่ให้ถามคนขับให้ชัวร์ก่อน แล้วค่อยนั่งไปจนถึงสถานีรถไฟ",
|
||||
"**สถานีรถไฟท่าเรือ** — ต้องขึ้นที่บขส.อ่างทอง รถตู้สาย 464 สระบุรี-สุพรรณบุรี รถผ่านหน้าสถานีรถไฟเลย แต่ควรคุยกับคนขับก่อน เพราะมีบางคันที่ไม่เข้าหน้าสถานีรถไฟ",
|
||||
"ถ้าสนใจจองตั๋วรถไฟออนไลน์ สามารถจองได้ผ่าน BusOnlineTicket",
|
||||
"**สนามบิน** ที่น่าสนใจมีสนามบินดอนเมืองกับสนามบินสุวรรณภูมิ",
|
||||
"**สนามบินสุวรรณภูมิ** — ไม่ว่าจะเริ่มจากบขส.อ่างทองหรือสถานีขนส่งป่าโมก ก็ขึ้นรถเหมือนกัน คือรถตู้สาย 15 สายใน (ที่บขส.อ่างทองมีเฉพาะเช้ามืด) และรถสองแถวสาย 101 อ่างทอง-ป่าโมก-อยุธยา แล้วต่อรถมินิบัส 901 อยุธยา-กรุงเทพ",
|
||||
"อีกทางหนึ่ง ขึ้นรถมินิบัส 902 กรุงเทพ-อ่างทอง สายเอเซีย จากบขส.อ่างทอง ลงที่ท่ารถตู้ฟิวเจอร์พาร์ค รังสิต แล้วนั่งรถตู้สาย 559 รังสิต-สนามบินสุวรรณภูมิ",
|
||||
"**สนามบินดอนเมือง** — ขึ้นรถลงที่ท่ารถตู้ฟิวเจอร์พาร์ค รังสิต แล้วนั่งรถสองแถวไปขึ้นรถไฟฟ้าชานเมืองที่สถานีรังสิต ไปลงสถานีรถไฟดอนเมือง หรือจะขึ้นรถเมล์สาย A5 (ทางด่วน) หรือสาย 510 ไปลงสนามบินก็ได้",
|
||||
"ถ้าสนใจจองตั๋วเครื่องบินออนไลน์ สามารถจองได้ผ่าน Trip.com"
|
||||
]
|
||||
},
|
||||
"en": {
|
||||
"title": "Why bus timetables change so often",
|
||||
"tag": "Explainer",
|
||||
"title": "Getting to the railway stations and the airports",
|
||||
"tag": "How to travel",
|
||||
"body": [
|
||||
"Bus schedules shift with traffic, passenger demand and seasonal peaks — some lines even differ on holidays.",
|
||||
"That's why we show operators' raw times and remind you to double-check with the operator before travelling in heavy rain or long holidays."
|
||||
"This article collects ways to reach the main transport hubs. There are many ways, but I picked them by two criteria: 1) does the bus route serve the Ang Thong Bus Terminal or Pa Mok Bus Station, and 2) does it start inside Ang Thong? If not, you have to fall back on intercity buses.",
|
||||
"**Railway stations** worth knowing: Ayutthaya, Lopburi, Saraburi, Tha Ruea and Suphan Buri. For now I'll cover only the ones where I have solid information.",
|
||||
"**Ayutthaya railway station** — whether you start from the Ang Thong Bus Terminal or Pa Mok Bus Station, you take the same vehicle: the number 15 van, Bangkok–Pa Mok–Ang Thong (local line), which at Ang Thong Bus Terminal only departs at dawn, or the 101 songthaew, Ang Thong–Pa Mok–Ayutthaya.",
|
||||
"Just before the junction into Chao Phrom market, ring the bell and walk about 200–300 metres to the ferry crossing, then walk on to the station. Or get off at Chao Phrom market and take a town bus — but check with the driver first, then ride it all the way to the station.",
|
||||
"**Tha Ruea railway station** — you have to start at the Ang Thong Bus Terminal, on the number 464 van, Saraburi–Suphan Buri. It passes right in front of the station, but talk to the driver first, because a few vehicles don't pull into the station.",
|
||||
"If you'd like to book train tickets online, you can book through BusOnlineTicket.",
|
||||
"**Airports** worth knowing: Don Mueang and Suvarnabhumi.",
|
||||
"**Suvarnabhumi** — whether you start from the Ang Thong Bus Terminal or Pa Mok Bus Station, you take the same vehicle: the number 15 van, local line (which at Ang Thong Bus Terminal only departs at dawn), or the 101 songthaew, Ang Thong–Pa Mok–Ayutthaya, then transfer to the 901 minibus, Ayutthaya–Bangkok.",
|
||||
"Another option: take the 902 minibus, Bangkok–Ang Thong, Asia line, from the Ang Thong Bus Terminal, get off at the Future Park Rangsit van terminal, then take the number 559 van, Rangsit–Suvarnabhumi Airport.",
|
||||
"**Don Mueang** — take the bus to the Future Park Rangsit van terminal, then a songthaew to the Rangsit suburban rail station and ride to Don Mueang railway station. Or take bus A5 (expressway) or bus 510 to the airport.",
|
||||
"If you'd like to book flights online, you can book through Trip.com."
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"date": "2026-10-05",
|
||||
"th": {
|
||||
"title": "แก้ปัญหาไม่มีรถประจำทาง แสวงหาและโพธิ์ทอง",
|
||||
"tag": "วิธีเดินทาง",
|
||||
"body": [
|
||||
"**[โครงบทความ — เติมทีละหัวข้อ · ข้อมูลในวงเล็บเหลี่ยม = ต้องยืนยัน/เติม]**",
|
||||
"**1. ปัญหาคืออะไร** — อำเภอแสวงหาและอำเภอโพธิ์ทองไม่มีรถประจำทางเข้าเมืองอ่างทองโดยตรง ผู้ที่ไม่มีรถส่วนตัวต้อง [เติม: เดินทางอย่างไรในปัจจุบัน — อาศัยรถอะไร ต่อกี่ต่อ ใช้เวลากี่ชั่วโมง ค่าใช้จ่ายเท่าไร]",
|
||||
"**2. ข้อเท็จจริงจากข้อมูลในระบบ** — ปัจจุบันมีเพียงสาย 1011 (อ่างทอง-แสวงหา-สีบัวทอง) ที่วิ่งผ่านทั้งสองอำเภอ โดยมีจุดจอดจริง 3 จุด ได้แก่ วัดสีบัวทอง (จุดเริ่มต้นฝั่งแสวงหา) ตลาดแสวงหา และตลาดสดเทศบาลตำบลโพธิ์ทอง ห่างจากจุดแรก 10.5 และ 19.8 กิโลเมตรตามลำดับ",
|
||||
"**3. ตารางที่มีอยู่จริง** — สาย 1011 มีรอบวิ่งเพียง 6 รอบต่อวัน แบ่งเป็น 2 ทิศ ทิศจากบขส.อ่างทองออก 12:00, 16:00 และ 17:00 ส่วนทิศจากวัดสีบัวทองออก 06:00, 06:30 และ 14:30 [เติม: รอบเหล่านี้พอกับความต้องการจริงไหม ใครได้ใช้บ้าง]",
|
||||
"**4. เวลาเดินทางจริง** — ตามข้อมูลที่บันทึกไว้ รถจากวัดสีบัวทองถึงตลาดแสวงหาใช้เวลา 25 นาที จากตลาดแสวงหาถึงตลาดโพธิ์ทอง 30 นาที และจากตลาดโพธิ์ทองถึงบขส.อ่างทอง 25 นาที รวมทั้งเส้นทางประมาณ 80 นาที [เติม: ในความเป็นจริงใช้เวลาเท่านี้ไหม ติดช่วงไหน]",
|
||||
"**5. ทำไมถึงเป็นแบบนี้** — [เติม: ปัญหาที่แท้จริงคืออะไร — ผู้ประกอบการขาดทุน? รถเสีย? ไม่มีคนขับ? ใบอนุญาต? จำนวนผู้โดยสารไม่พอ?] ข้อสังเกตของผมคือ รถที่มีอยู่ก็วิ่งไม่เต็มรอบ ถ้าเพิ่มรอบโดยไม่มีผู้โดยสารก็ยิ่งขาดทุน [เติม: ตรวจสอบกับผู้ประกอบการหรือไม่]",
|
||||
"**6. แนวทางที่คิดว่าทำได้** — ก) [เติม: ทางเลือกที่ 1] ข) [เติม: ทางเลือกที่ 2] ค) [เติม: ทางเลือกที่ 3] เกณฑ์ที่ผมใช้ตัดสินคือ ต้องไม่ทำให้ผู้ประกอบการเดิมเดือดร้อน และต้องมีคนใช้จริงตั้งแต่เริ่ม",
|
||||
"**7. ใครต้องทำอะไร** — [เติม: หน่วยงานที่เกี่ยวข้อง — ขนส่งจังหวัด? อบจ.? เทศบาล? ผู้ประกอบการ?] [เติม: ขั้นตอนที่ต้องทำจริงตามกฎหมาย]",
|
||||
"**8. สรุป** — [เติม: บทสรุปของคุณ]"
|
||||
]
|
||||
},
|
||||
"en": {
|
||||
"title": "",
|
||||
"tag": "",
|
||||
"body": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"date": "2026-10-05",
|
||||
"th": {
|
||||
"title": "เส้นทางรถประจำทางจากตัวอำเภอเข้าตัวจังหวัด",
|
||||
"tag": "ความฝัน",
|
||||
"body": [
|
||||
"**[โครงบทความ — เติมทีละหัวข้อ · ข้อมูลในวงเล็บเหลี่ยม = ต้องยืนยัน/เติม]**",
|
||||
"**1. ทำไมต้องเริ่มจากตัวอำเภอ** — [เติม: เหตุผลของคุณ — คนในอำเภอต้องเข้าเมืองทำธุระ ไปโรงพยาบาล ไปติดต่อราชการ ไปเรียน]",
|
||||
"**2. ภาพรวมอำเภอของจังหวัดอ่างทอง** — จังหวัดอ่างทองมี 7 อำเภอ ได้แก่ เมืองอ่างทอง ไชโย ป่าโมก โพธิ์ทอง แสวงหา วิเศษชัยชาญ และสามโก้ [เติม: ยืนยันจำนวนอำเภอ — ตรวจกับข้อมูลราชการ]",
|
||||
"**3. สายที่มีอยู่จริงตอนนี้** — จากข้อมูลในระบบ มี 8 สายที่เข้าเทียบ บขส.อ่างทอง ได้แก่ 902 (กรุงเทพ-อ่างทอง สายเอเซีย) 15 (กรุงเทพ-อ่างทอง สายใน) 101 (อ่างทอง-ป่าโมก-อยุธยา) 464 (สุพรรณ-อ่างทอง-สระบุรี) 641 (อ่างทอง-บ้านแพรก-ลพบุรี) 324 (อ่างทอง-วัดพิกุลทอง) 1011 (อ่างทอง-แสวงหา-สีบัวทอง) และ 2231 (อ่างทอง-มหานาม)",
|
||||
"**4. อำเภอที่มีสายเข้าเมืองแล้ว** — จากสายทั้ง 8 ข้างต้น อำเภอที่มีสายวิ่งเข้า บขส.อ่างทอง ได้แก่ [เติม: ไล่ให้ครบว่าแต่ละสายผ่านอำเภออะไร — ผมสรุปได้แค่บางอำเภอจากข้อมูลในระบบ]",
|
||||
"**5. อำเภอที่ยังไม่มีสายเข้าเมือง** — [เติม: อำเภอที่ขาด — จากข้อมูลในระบบ ผมไม่พบสายที่เข้า อำเภอโพธิ์ทอง · แสวงหา · สามโก้ โดยตรง ต้องยืนยัน]",
|
||||
"**6. เส้นทางที่เสนอ** — [เติม: เส้นทางที่คุณอยากให้มี — เช่น อำเภอ → อำเภอ → ตัวเมือง หรือวงแหวนรอบเมือง] [เติม: เหตุผลที่เลือกเส้นนี้]",
|
||||
"**7. ความท้าทาย** — [เติม: อุปสรรคจริงที่คุณรู้ — กฎหมายทับเส้นทาง · ผู้ประกอบการเดิม · จำนวนผู้โดยสาร · รถและคนขับ]",
|
||||
"**8. สรุป** — [เติม: บทสรุปของคุณ]"
|
||||
]
|
||||
},
|
||||
"en": {
|
||||
"title": "",
|
||||
"tag": "",
|
||||
"body": [
|
||||
""
|
||||
]
|
||||
}
|
||||
}
|
||||
+75
-1
@@ -109,10 +109,80 @@
|
||||
/* --- หน้าอ่านบทความ --- */
|
||||
.mu-post { background: #fff; border: 1px solid #ebe8f4; border-radius: 20px; overflow: hidden; box-shadow: 0 12px 30px rgba(63, 43, 94, .08); }
|
||||
.mu-post .mu-cover { aspect-ratio: 16 / 8; }
|
||||
|
||||
/* --- แผนที่เส้นทางแทนรูปปก (textN.json → "map") --- */
|
||||
.mu-post .mu-cover.is-map { aspect-ratio: auto; height: 280px; position: relative; }
|
||||
.mu-post .mu-cover.is-map .at-map { height: 100%; border: 0; border-radius: 0; }
|
||||
.mu-cover.is-map .at-map.is-static { pointer-events: none; } /* ปิดซูม/ลาก */
|
||||
.mu-cover-cap {
|
||||
position: absolute; left: 0; right: 0; bottom: 0; z-index: 500;
|
||||
padding: 8px 12px; color: #fff; font-size: .8rem; line-height: 1.4;
|
||||
background: linear-gradient(180deg, rgba(15, 23, 42, 0), rgba(15, 23, 42, .62));
|
||||
}
|
||||
/* --- แผนที่ "เส้นทางที่เสนอ" (ความฝัน) + รายการคลิกได้ + แผงรายละเอียด --- */
|
||||
.blog-mapx { margin: 0 0 16px; }
|
||||
.blog-mapx-map { height: 280px; border-radius: 16px; }
|
||||
.blog-mapx-legend { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
|
||||
.blog-mapx-group {
|
||||
margin: 10px 0 2px; font-size: .78rem; font-weight: 700; letter-spacing: .01em;
|
||||
color: #7a4cc0; list-style: none;
|
||||
}
|
||||
.blog-mapx-group:first-child { margin-top: 0; }
|
||||
.blog-mapx-group::before { content: ''; display: inline-block; width: 14px; height: 2px;
|
||||
background: #cbb8e8; vertical-align: middle; margin-right: 8px; border-radius: 2px; }
|
||||
.blog-mapx-row {
|
||||
display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
||||
padding: 9px 11px; border: 1px solid #e8e4f2; border-radius: 12px;
|
||||
background: #fff; cursor: pointer; font-size: .88rem; color: #3d4a63;
|
||||
}
|
||||
.blog-mapx-row:hover { border-color: #cbb8e8; background: #faf8ff; }
|
||||
.blog-mapx-row.is-on { border-color: #7a4cc0; background: #f6f2ff; }
|
||||
.blog-mapx-row:focus-visible { outline: 2px solid #7a4cc0; outline-offset: 1px; }
|
||||
.blog-mapx-sw { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
|
||||
.blog-mapx-nm { font-weight: 700; color: #1f2a44; }
|
||||
.blog-mapx-ds { color: #6b7a94; }
|
||||
.blog-mapx-ds::before { content: '\00b7'; margin-right: 6px; color: #c9c2dc; }
|
||||
.blog-mapx-badge {
|
||||
margin-left: auto; font-size: .72rem; padding: 2px 8px; border-radius: 999px;
|
||||
background: #fdf4e3; color: #8a6100; border: 1px solid #f0dfb8;
|
||||
}
|
||||
.blog-mapx-panel { margin-top: 10px; padding: 12px 14px; border: 1px solid #e8e4f2; border-radius: 14px; background: #fbfaff; }
|
||||
.blog-mapx-panel[hidden] { display: none; }
|
||||
.blog-mapx-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
|
||||
.blog-mapx-head strong { color: #1f2a44; font-size: .95rem; }
|
||||
.blog-mapx-line { margin: 4px 0; font-size: .85rem; color: #6b7a94; }
|
||||
.blog-mapx-line span::after { content: ':'; margin-right: 6px; }
|
||||
.blog-mapx-line b { color: #1f2a44; font-weight: 600; }
|
||||
.blog-mapx-facts { margin: 8px 0 0; font-size: .82rem; color: #7a4cc0; font-weight: 700; }
|
||||
.blog-mapx-hint { margin: 8px 0 0; font-size: .8rem; color: #8b93a7; }
|
||||
.blog-mapx-src { margin: 0 0 14px; font-size: .78rem; color: #8b93a7; word-break: break-all; }
|
||||
.at-tip-org { background: #1f2a44; color: #fff; border: 0; font-weight: 700; }
|
||||
@media (min-width: 768px) { .blog-mapx-map { height: 380px; } }
|
||||
|
||||
.mu-cover-note {
|
||||
position: absolute; left: 12px; bottom: 12px; z-index: 500;
|
||||
padding: 4px 10px; border-radius: 999px; font-size: .78rem;
|
||||
background: rgba(255, 255, 255, .9); color: #8a6100; border: 1px solid #f0d9a8;
|
||||
}
|
||||
.mu-post-body { padding: 20px 18px 26px; }
|
||||
.mu-post-body h1 { margin: 6px 0 12px; font-size: 1.35rem; color: #1f2a44; font-weight: 800; line-height: 1.4; }
|
||||
.mu-post-body p { margin: 0 0 14px; color: #4a5568; font-size: .96rem; line-height: 1.9; }
|
||||
/* ย่อหน้า: เว้นระยะ 20px + ย่อหน้าหน้าบรรทัด 1.5em (แบบหนังสือไทย) */
|
||||
.mu-post-body p { margin: 0 0 20px; color: #4a5568; font-size: .96rem; line-height: 1.9; text-indent: 1.5em; }
|
||||
.mu-post-body p:last-child { margin-bottom: 0; }
|
||||
/* ย่อหน้าที่เป็นรูป/บรรทัดข้อมูลไม่ต้องย่อหน้า */
|
||||
.mu-post-body p.mu-post-figure, .mu-post-figure, .mu-post-body p:empty { text-indent: 0; }
|
||||
/* มาร์กดาวน์เบา ๆ ในเนื้อหา (จาก textN.json) */
|
||||
.mu-post-body strong { color: #1f2a44; font-weight: 800; }
|
||||
.mu-post-body em { font-style: italic; }
|
||||
.mu-post-body a { color: #7a4cc0; font-weight: 700; text-decoration: none; border-bottom: 1px solid #d9cbf3; }
|
||||
.mu-post-body a:hover { border-bottom-color: #7a4cc0; }
|
||||
.mu-post-body code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .88em;
|
||||
background: #f4f1fb; border: 1px solid #e7e0f6; border-radius: 4px; padding: 1px 5px; color: #5b4a80; }
|
||||
.mu-post-body ul { margin: 0 0 20px; padding-left: 20px; }
|
||||
.mu-post-body li { color: #4a5568; font-size: .96rem; line-height: 1.9; margin-bottom: 4px; }
|
||||
.mu-post-figure { margin: 4px 0 16px; }
|
||||
.mu-post-figure img { width: 100%; height: auto; border-radius: 10px; border: 1px solid #e7e0f6; display: block; }
|
||||
.mu-post-figure figcaption { margin-top: 6px; color: #6f7b95; font-size: .82rem; text-align: center; }
|
||||
.mu-post-back {
|
||||
display: inline-flex; align-items: center; gap: 6px;
|
||||
margin-bottom: 16px; color: #7a4cc0; font-weight: 700;
|
||||
@@ -121,6 +191,10 @@
|
||||
.mu-post-back:hover { text-decoration: underline; }
|
||||
|
||||
/* แท็บเล็ตขึ้นไป: การ์ด 2 คอลัมน์ → 3 คอลัมน์ */
|
||||
@media (min-width: 768px) {
|
||||
.mu-post .mu-cover.is-map { height: 380px; }
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
#blog-list.mode-grid { grid-template-columns: repeat(2, 1fr); }
|
||||
}
|
||||
|
||||
+353
-11
@@ -89,7 +89,7 @@
|
||||
cover.className = 'mu-cover' + (p.img ? '' : ' no-img');
|
||||
if (p.img) {
|
||||
var im = document.createElement('img');
|
||||
im.src = p.img; im.alt = ''; im.loading = 'lazy'; im.decoding = 'async';
|
||||
im.src = imgUrl(p.img); im.alt = ''; im.loading = 'lazy'; im.decoding = 'async';
|
||||
cover.appendChild(im);
|
||||
}
|
||||
if (c.tag) {
|
||||
@@ -152,17 +152,362 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/* ---------- มินิมาร์กดาวน์สำหรับเนื้อหาบทความ ----------
|
||||
ปลอดภัย: escape HTML "ก่อน" แล้วจึงแปลงมาร์กดาวน์ (ไม่รับ HTML ดิบจากไฟล์)
|
||||
รองรับ:
|
||||
**หนา** / __หนา__ → <strong>
|
||||
*เอียง* / _เอียง_ → <em>
|
||||
[ข้อความ](url) → <a target=_blank rel=noopener>
|
||||
 → <img> (ย่อหน้าที่เป็นรูปเดี่ยว ๆ)
|
||||
- ข้อ / * ข้อ → <ul><li> (ติดกันหลายบรรทัด)
|
||||
`โค้ด` → <code>
|
||||
หมายเหตุ: URL ที่ไม่ใช่ http/https/./../ จะถูกทิ้ง (กัน javascript:) */
|
||||
function escHtml(s) {
|
||||
return String(s == null ? '' : s)
|
||||
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
||||
.replace(/"/g, '"').replace(/'/g, ''');
|
||||
}
|
||||
function safeUrl(u) {
|
||||
var s = String(u == null ? '' : u).trim();
|
||||
if (/^https?:\/\//i.test(s)) return s; /* เว็บภายนอก */
|
||||
if (/^(\.{0,2}\/)?[\w.\-]+\/[\w.\-/]*[\w.\-]$/.test(s)) return s; /* เส้นทางไฟล์: pic1.jpg · ./a/b.png · ../x/y.jpg */
|
||||
if (/^[\w.\-]+\.(jpg|jpeg|png|webp|gif|svg)$/i.test(s)) return s; /* ชื่อไฟล์เดี่ยว ๆ */
|
||||
return ''; /* javascript: / data: / อื่น ๆ → ทิ้ง */
|
||||
}
|
||||
/* แปลง inline (ตัวหนา/เอียง/ลิงก์/โค้ด) บนข้อความที่ escape แล้ว */
|
||||
function inlineMd(txt) {
|
||||
var s = escHtml(txt);
|
||||
s = s.replace(/!\[([^\]]*)\]\(([^()\s]*(?:\([^()]*\)[^()\s]*)*)\)/g, function (_, alt, url) {
|
||||
var u = safeUrl(url);
|
||||
return u ? '<img src="' + u + '" alt="' + alt + '" loading="lazy" decoding="async">' : alt;
|
||||
});
|
||||
s = s.replace(/\[([^\]]+)\]\(([^()\s]*(?:\([^()]*\)[^()\s]*)*)\)/g, function (_, label, url) {
|
||||
var u = safeUrl(url);
|
||||
return u ? '<a href="' + u + '" target="_blank" rel="noopener noreferrer">' + label + '</a>' : label;
|
||||
});
|
||||
s = s.replace(/`([^`]+)`/g, '<code>$1</code>');
|
||||
s = s.replace(/\*\*([^*]+)\*\*/g, '<strong>$1</strong>');
|
||||
s = s.replace(/__([^_]+)__/g, '<strong>$1</strong>');
|
||||
s = s.replace(/(^|[^*])\*([^*\s][^*]*?)\*/g, '$1<em>$2</em>');
|
||||
s = s.replace(/(^|[^_])_([^_\s][^_]*?)_/g, '$1<em>$2</em>');
|
||||
return s;
|
||||
}
|
||||
/* เรนเดอร์ body[] ลง host — จัดกลุ่มรายการ "- " ต่อกันเป็น <ul> */
|
||||
function renderBody(host, body) {
|
||||
var i = 0, list = null;
|
||||
function closeList() { if (list) { host.appendChild(list); list = null; } }
|
||||
body.forEach(function (raw) {
|
||||
var line = String(raw == null ? '' : raw);
|
||||
var bullet = line.match(/^\s*[-*]\s+(.+)$/);
|
||||
if (bullet) {
|
||||
if (!list) list = document.createElement('ul');
|
||||
var li = document.createElement('li');
|
||||
li.innerHTML = inlineMd(bullet[1]);
|
||||
list.appendChild(li);
|
||||
return;
|
||||
}
|
||||
closeList();
|
||||
/* ย่อหน้าที่เป็นรูปเดี่ยว  → ใช้ <figure> */
|
||||
var onlyImg = line.trim().match(/^!\[([^\]]*)\]\(([^)\s]+)\)$/);
|
||||
if (onlyImg) {
|
||||
var u = safeUrl(onlyImg[2]);
|
||||
if (u) {
|
||||
var fig = document.createElement('figure');
|
||||
fig.className = 'mu-post-figure';
|
||||
fig.innerHTML = '<img src="' + u + '" alt="' + escHtml(onlyImg[1]) + '" loading="lazy" decoding="async">' +
|
||||
(onlyImg[1] ? '<figcaption>' + escHtml(onlyImg[1]) + '</figcaption>' : '');
|
||||
host.appendChild(fig);
|
||||
return;
|
||||
}
|
||||
}
|
||||
var p = document.createElement('p');
|
||||
p.innerHTML = inlineMd(line);
|
||||
host.appendChild(p);
|
||||
});
|
||||
closeList();
|
||||
}
|
||||
|
||||
/* รูปปก — เติม ?v= เวอร์ชันแอป (กัน cache-first ของ SW ค้างรูปเก่า) ให้ตรงกับหน้าอื่น */
|
||||
function imgUrl(u) {
|
||||
return (window.ImgURL && ImgURL.of) ? ImgURL.of(u) : u;
|
||||
}
|
||||
|
||||
/* ---------- แผนที่เส้นทางแทนรูปปก (กำหนดใน textN.json) ----------
|
||||
"map": { "route_id": "101", "height": 320, "interactive": false, "caption": "…" }
|
||||
เงื่อนไข: ถ้าไม่มีไฟล์ geojson ของสายนั้น → คงรูป picN ไว้ + ป้ายบอก (ไม่พัง ไม่ขึ้นแผนที่เปล่า)
|
||||
ใช้ ATMap.route() ตัวเดียวกับหน้า #/routes/:id (ไม่ต้องโหลดไลบรารีเพิ่ม) */
|
||||
var GEO_DIR = '../resource/data/geojson-web/';
|
||||
|
||||
function hasGeo(id) {
|
||||
return fetch(GEO_DIR + id + '.geojson', { method: 'HEAD', cache: 'no-store' })
|
||||
.then(function (r) { return r.ok; })
|
||||
.catch(function () { return false; });
|
||||
}
|
||||
|
||||
function mountBlogMap(cover, spec) {
|
||||
var rid = String((spec && spec.route_id) || '').trim();
|
||||
if (!cover || !rid) return;
|
||||
hasGeo(rid).then(function (ok) {
|
||||
if (!ok) { /* ไม่มีเส้นทาง → ใช้รูปเดิม + ป้าย */
|
||||
var note = document.createElement('span');
|
||||
note.className = 'mu-cover-note';
|
||||
note.textContent = t('blog.noGeo');
|
||||
cover.appendChild(note);
|
||||
return;
|
||||
}
|
||||
cover.innerHTML = ''; /* แผนที่แทนรูป */
|
||||
cover.classList.remove('no-img');
|
||||
cover.classList.add('is-map');
|
||||
var box = document.createElement('div');
|
||||
box.className = 'at-map' + (spec.interactive === false ? ' is-static' : '');
|
||||
if (spec.height) box.style.height = spec.height + 'px';
|
||||
cover.appendChild(box);
|
||||
if (spec.caption) {
|
||||
var cap = document.createElement('span');
|
||||
cap.className = 'mu-cover-cap';
|
||||
cap.textContent = spec.caption;
|
||||
cover.appendChild(cap);
|
||||
}
|
||||
if (window.ATMap) {
|
||||
ATMap.route(box, rid);
|
||||
/* container เพิ่งมีขนาด → สั่งวัดใหม่ (กันบั๊กแผนที่ 0×0) */
|
||||
var hit = (ATMap.maps || []).filter(function (m) { return m.el === box; })[0];
|
||||
if (hit && hit.map) setTimeout(function () { hit.map.invalidateSize(); }, 60);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderPost(post, host) {
|
||||
var c = pick(post.data, lang());
|
||||
var art = document.createElement('article');
|
||||
art.className = 'mu-post';
|
||||
|
||||
if (post.img) {
|
||||
/* ---------- แผนที่ "เส้นทางที่เสนอ" (ความฝัน) — กำหนดใน textN.json → "map"."routes"[]
|
||||
"map": { "origin": {"station_code":"at_main_terminal","label":"บขส.อ่างทอง"},
|
||||
"routes": [ { "id":"…", "line_color":"#c8102e", "line_name":"สายสีแดง",
|
||||
"dest":{"name":"…","lat":13.9,"lng":100.6},
|
||||
"via":[{"name":"…","lat":…,"lng":…}],
|
||||
"distance_km":null, "duration_min":null, "fare_thb":null, "note":"" } ] }
|
||||
เงื่อนไข: เส้นทางที่ยังไม่ใส่พิกัดปลายทาง → ไม่วาดบนแผนที่ แต่ขึ้นในรายการพร้อมป้ายบอก
|
||||
ค่าที่เว้น null → ซ่อนในแผงรายละเอียด (ไม่โชว์ 0 หรือค่าว่าง) */
|
||||
var STATIONS_URL = '../resource/data/stations.json';
|
||||
var stationsP = null;
|
||||
|
||||
function numOrNull(v) {
|
||||
var n = parseFloat(v);
|
||||
return isFinite(n) ? n : null;
|
||||
}
|
||||
|
||||
/* พิกัดจากได้ทั้ง coords=[lat,lng] (แบบใหม่) หรือ lat/lng (แบบเดิม) — คืน [lat,lng] หรือ null */
|
||||
function coordsOf(o) {
|
||||
o = o || {};
|
||||
if (Array.isArray(o.coords) && o.coords.length >= 2) {
|
||||
var a = numOrNull(o.coords[0]), c = numOrNull(o.coords[1]);
|
||||
return (a == null || c == null) ? null : [a, c];
|
||||
}
|
||||
var la = numOrNull(o.lat), ln = numOrNull(o.lng);
|
||||
return (la == null || ln == null) ? null : [la, ln];
|
||||
}
|
||||
|
||||
function stationByCode(code) {
|
||||
if (!stationsP) {
|
||||
stationsP = fetch(STATIONS_URL, { cache: 'no-store' })
|
||||
.then(function (r) { return r.ok ? r.json() : {}; })
|
||||
.then(function (d) { return (d && d.stations) || []; })
|
||||
.catch(function () { return []; });
|
||||
}
|
||||
return stationsP.then(function (list) {
|
||||
return list.filter(function (s) { return String(s.station_code) === String(code); })[0] || null;
|
||||
});
|
||||
}
|
||||
|
||||
/* พิกัดต้นทาง: ใช้ lat/lng ที่ระบุมาตรง ๆ ก่อน ถ้าไม่มีจึงค้นจาก stations.json ด้วย station_code */
|
||||
function resolveOrigin(o) {
|
||||
o = o || {};
|
||||
var c = coordsOf(o);
|
||||
if (c) return Promise.resolve({ coords: c, label: o.label || '' });
|
||||
if (!o.station_code) return Promise.resolve(null);
|
||||
return stationByCode(o.station_code).then(function (s) {
|
||||
if (!s || numOrNull(s.latitude) == null) return null;
|
||||
return { coords: [numOrNull(s.latitude), numOrNull(s.longitude)], label: o.label || s.station_name_th || '' };
|
||||
});
|
||||
}
|
||||
|
||||
function buildProposal(spec) {
|
||||
var wrap = document.createElement('div');
|
||||
wrap.className = 'blog-mapx';
|
||||
var host = document.createElement('div');
|
||||
host.className = 'at-map blog-mapx-map';
|
||||
var legend = document.createElement('ul');
|
||||
legend.className = 'blog-mapx-legend';
|
||||
var panel = document.createElement('div');
|
||||
panel.className = 'blog-mapx-panel';
|
||||
panel.hidden = true;
|
||||
wrap.appendChild(host);
|
||||
wrap.appendChild(legend);
|
||||
wrap.appendChild(panel);
|
||||
|
||||
/* โครงได้ 2 แบบ:
|
||||
- ใหม่ "groups": [ {id, label, routes[]} ] → แสดงหัวกลุ่มคั่นในรายการ
|
||||
- เดิม "routes": [ ... ] → ไม่มีกลุ่ม (backward-compat) */
|
||||
var groups = Array.isArray(spec.groups) && spec.groups.length
|
||||
? spec.groups
|
||||
: [{ id: '', label: '', routes: spec.routes || [] }];
|
||||
var routes = [];
|
||||
groups.forEach(function (g) {
|
||||
(g.routes || []).forEach(function (r) {
|
||||
if (r && (r.line_name || r.dest)) { r.__group = g; routes.push(r); }
|
||||
});
|
||||
});
|
||||
var rows = [];
|
||||
|
||||
routes.forEach(function (r) {
|
||||
var li = document.createElement('li');
|
||||
li.className = 'blog-mapx-row';
|
||||
li.tabIndex = 0;
|
||||
var sw = document.createElement('span');
|
||||
sw.className = 'blog-mapx-sw';
|
||||
sw.style.background = r.line_color || '#7a4cc0';
|
||||
var nm = document.createElement('span');
|
||||
nm.className = 'blog-mapx-nm';
|
||||
nm.textContent = r.line_name || (r.dest && r.dest.name) || '';
|
||||
var ds = document.createElement('span');
|
||||
ds.className = 'blog-mapx-ds';
|
||||
ds.textContent = (r.dest && r.dest.name) || '';
|
||||
li.appendChild(sw);
|
||||
li.appendChild(nm);
|
||||
li.appendChild(ds);
|
||||
if (!coordsOf(r.dest)) { /* ยังไม่ใส่พิกัด → บอกให้รู้ */
|
||||
var badge = document.createElement('span');
|
||||
badge.className = 'blog-mapx-badge';
|
||||
badge.textContent = t('blog.mapNoCoord');
|
||||
li.appendChild(badge);
|
||||
}
|
||||
li.addEventListener('click', function () { pick(r); });
|
||||
li.addEventListener('keydown', function (e) {
|
||||
if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); pick(r); }
|
||||
});
|
||||
var badge = li.querySelector('.blog-mapx-badge');
|
||||
rows.push({ r: r, el: li, badge: badge });
|
||||
/* หัวกลุ่ม: แทรกเมื่อขึ้นกลุ่มใหม่ (มี label เท่านั้น) */
|
||||
if (r.__group && r.__group.label && !r.__group.__head) {
|
||||
r.__group.__head = document.createElement('li');
|
||||
r.__group.__head.className = 'blog-mapx-group';
|
||||
r.__group.__head.textContent = r.__group.label;
|
||||
legend.appendChild(r.__group.__head);
|
||||
}
|
||||
legend.appendChild(li);
|
||||
});
|
||||
|
||||
function pick(r) {
|
||||
highlight(r);
|
||||
show(r);
|
||||
}
|
||||
|
||||
/* ไฮไลต์เส้นที่เลือก — เส้นอื่นจางลง */
|
||||
function highlight(sel) {
|
||||
rows.forEach(function (x) { x.el.classList.toggle('is-on', x.r === sel); });
|
||||
routes.forEach(function (x) {
|
||||
if (!x.__layer) return;
|
||||
var on = x === sel;
|
||||
x.__layer.line.setStyle({ weight: on ? 7 : 4, opacity: on ? 1 : .3 });
|
||||
x.__layer.dot.setStyle({ opacity: on ? 1 : .35, fillOpacity: on ? 1 : .35 });
|
||||
});
|
||||
}
|
||||
|
||||
function show(r) {
|
||||
var d = r.dest || {};
|
||||
function line(k, v) {
|
||||
if (v == null || v === '') return;
|
||||
var p = document.createElement('p');
|
||||
p.className = 'blog-mapx-line';
|
||||
var s = document.createElement('span');
|
||||
s.textContent = k;
|
||||
var b = document.createElement('b');
|
||||
b.textContent = v;
|
||||
p.appendChild(s);
|
||||
p.appendChild(b);
|
||||
panel.appendChild(p);
|
||||
}
|
||||
panel.innerHTML = '';
|
||||
panel.hidden = false;
|
||||
var head = document.createElement('div');
|
||||
head.className = 'blog-mapx-head';
|
||||
var sw = document.createElement('span');
|
||||
sw.className = 'blog-mapx-sw';
|
||||
sw.style.background = r.line_color || '#7a4cc0';
|
||||
var title = document.createElement('strong');
|
||||
title.textContent = r.line_name || d.name || '';
|
||||
head.appendChild(sw);
|
||||
head.appendChild(title);
|
||||
panel.appendChild(head);
|
||||
line(t('blog.mapDest'), d.name);
|
||||
var via = (r.via || []).map(function (v) { return v && v.name; }).filter(Boolean).join(' · ');
|
||||
line(t('blog.mapVia'), via);
|
||||
var facts = [];
|
||||
if (numOrNull(r.distance_km) != null) facts.push(r.distance_km + ' ' + t('blog.km'));
|
||||
if (numOrNull(r.duration_min) != null) facts.push(r.duration_min + ' ' + t('blog.min'));
|
||||
if (numOrNull(r.fare_thb) != null) facts.push(r.fare_thb + ' ' + t('blog.thb'));
|
||||
if (facts.length) {
|
||||
var f = document.createElement('p');
|
||||
f.className = 'blog-mapx-facts';
|
||||
f.textContent = facts.join(' · ');
|
||||
panel.appendChild(f);
|
||||
}
|
||||
line(t('blog.mapNote'), r.note);
|
||||
}
|
||||
|
||||
if (!routes.length) {
|
||||
panel.hidden = false;
|
||||
panel.textContent = t('blog.mapNoRoutes');
|
||||
} else {
|
||||
var hint = document.createElement('p');
|
||||
hint.className = 'blog-mapx-hint';
|
||||
hint.textContent = t('blog.mapPick');
|
||||
wrap.appendChild(hint);
|
||||
}
|
||||
|
||||
resolveOrigin(spec.origin).then(function (org) {
|
||||
if (!org) {
|
||||
panel.hidden = false;
|
||||
panel.textContent = t('blog.mapNoOrigin');
|
||||
host.remove();
|
||||
return;
|
||||
}
|
||||
if (window.ATMap && ATMap.proposal) {
|
||||
ATMap.proposal(host, { origin: org, routes: routes }, function (r) { pick(r); }); /* groups ถูก flatten เป็น routes แล้ว */
|
||||
/* พิกัดปลายทางที่อ่านจาก geojson สำเร็จ → ลบป้าย "ยังไม่ใส่พิกัด" ออก */
|
||||
setTimeout(function () {
|
||||
rows.forEach(function (x) { if (x.r.__geoOk && x.badge) { x.badge.remove(); x.badge = null; } });
|
||||
}, 250);
|
||||
} else {
|
||||
host.remove();
|
||||
}
|
||||
});
|
||||
|
||||
return wrap;
|
||||
}
|
||||
|
||||
/* ปก: รูป picN หรือแผนที่ (ถ้า textN.json ระบุ "map") — แผนที่ใช้เมื่อมีไฟล์เส้นทางจริงเท่านั้น */
|
||||
var spec = post.data.map;
|
||||
if (spec && (Array.isArray(spec.routes) || Array.isArray(spec.groups))) {
|
||||
/* ความฝัน: แผนที่เส้นทางที่เสนอ (ยังไม่มีจริง) — วาดจากโครงใน textN.json */
|
||||
art.appendChild(buildProposal(spec));
|
||||
if (spec.note) {
|
||||
var src = document.createElement('p');
|
||||
src.className = 'blog-mapx-src';
|
||||
src.textContent = t('blog.mapNote') + ': ' + spec.note;
|
||||
art.appendChild(src);
|
||||
}
|
||||
} else if (post.img || spec) {
|
||||
var cover = document.createElement('div');
|
||||
cover.className = 'mu-cover';
|
||||
var im = document.createElement('img');
|
||||
im.src = post.img; im.alt = c.title || ''; im.decoding = 'async';
|
||||
cover.appendChild(im);
|
||||
cover.className = 'mu-cover' + (post.img ? '' : ' no-img');
|
||||
if (post.img) {
|
||||
var im = document.createElement('img');
|
||||
im.src = imgUrl(post.img); im.alt = c.title || ''; im.decoding = 'async';
|
||||
cover.appendChild(im);
|
||||
}
|
||||
if (c.tag) {
|
||||
var tag = document.createElement('span');
|
||||
tag.className = 'mu-cover-tag';
|
||||
@@ -170,6 +515,7 @@
|
||||
cover.appendChild(tag);
|
||||
}
|
||||
art.appendChild(cover);
|
||||
if (spec) mountBlogMap(cover, spec);
|
||||
}
|
||||
|
||||
var body = document.createElement('div');
|
||||
@@ -192,11 +538,7 @@
|
||||
h1.textContent = c.title || '';
|
||||
body.appendChild(h1);
|
||||
|
||||
(c.body || []).forEach(function (pText) {
|
||||
var p = document.createElement('p');
|
||||
p.textContent = pText;
|
||||
body.appendChild(p);
|
||||
});
|
||||
renderBody(body, c.body || []); /* รองรับมาร์กดาวน์เบา ๆ (หนา/เอียง/ลิงก์/รูป/รายการ) */
|
||||
|
||||
art.appendChild(body);
|
||||
host.appendChild(art);
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
font-weight: 800; font-size: 1.35rem; flex: none;
|
||||
box-shadow: 0 6px 14px rgba(122, 76, 192, .25);
|
||||
}
|
||||
/* สีพื้นหลังของเลขสาย เปลี่ยนตามหมวดเส้นทาง (route_groups.json)
|
||||
น้ำเงิน = เข้ากรุงเทพฯ · ม่วง = ระหว่างจังหวัด · ชมพู = ภายในจังหวัด · เทา = หมวดอื่น/ไม่ระบุ */
|
||||
.mu-route-chip.grp-bangkok { background: linear-gradient(135deg, #1a53a8, #3f82d8); box-shadow: 0 6px 14px rgba(31, 95, 191, .25); }
|
||||
.mu-route-chip.grp-interprovincial { background: linear-gradient(135deg, #7a4cc0, #b07ce0); box-shadow: 0 6px 14px rgba(122, 76, 192, .25); }
|
||||
.mu-route-chip.grp-in_province { background: linear-gradient(135deg, #c02c7d, #e86aae); box-shadow: 0 6px 14px rgba(214, 56, 143, .25); }
|
||||
.mu-route-chip.grp-municipal { background: linear-gradient(135deg, #5b6560, #8b948f); box-shadow: 0 6px 14px rgba(107, 114, 104, .25); }
|
||||
.mu-toolbar {
|
||||
display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
|
||||
background: #fff; border: 1px solid #e7e2f6; border-radius: 14px;
|
||||
@@ -95,10 +101,40 @@
|
||||
.mu-contact-item .txt strong { display: block; color: #1f2a44; font-size: .98rem; margin-bottom: 2px; }
|
||||
.mu-contact-item .txt span { display: block; color: #6f7b95; font-size: .86rem; }
|
||||
.mu-qr-img {
|
||||
width: 72px; height: 72px; flex: none;
|
||||
width: 72px; height: 72px; flex: none; display: block;
|
||||
object-fit: contain; background: #fff;
|
||||
border-radius: 10px; padding: 4px; border: 1px solid #eee;
|
||||
}
|
||||
/* ปุ่มครอบ QR — กดเพื่อขยาย (ไม่ให้หน้าตาเปลี่ยน) */
|
||||
.mu-qr-btn { flex: none; padding: 0; border: 0; background: none; cursor: zoom-in;
|
||||
border-radius: 10px; line-height: 0; }
|
||||
.mu-qr-btn:focus-visible { outline: 2px solid #7a4cc0; outline-offset: 2px; }
|
||||
.mu-qr-btn:hover .mu-qr-img { border-color: #c9b6ec; }
|
||||
|
||||
/* --- ขยาย QR ลอยกลางจอ --- */
|
||||
.mu-qr-modal { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; }
|
||||
.mu-qr-modal::backdrop { background: rgba(20, 28, 48, .55); }
|
||||
.mu-qr-modal-card {
|
||||
position: relative; display: flex; flex-direction: column; align-items: center; gap: 12px;
|
||||
padding: 22px 22px 18px; border-radius: 14px; background: #fff; border: 1px solid #e7e2f6;
|
||||
max-width: min(92vw, 360px);
|
||||
}
|
||||
.mu-qr-modal-card strong { color: #1f2a44; font-size: 1.02rem; text-align: center; }
|
||||
.mu-qr-big { width: min(72vw, 260px); height: auto; border-radius: 10px; background: #fff; }
|
||||
.mu-qr-close {
|
||||
position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; padding: 0;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
border: 0; border-radius: 10px; background: #f4f1fb; color: #5b4a80; cursor: pointer;
|
||||
}
|
||||
.mu-qr-close:hover { background: #e9e2f8; }
|
||||
.mu-qr-close svg { width: 18px; height: 18px; }
|
||||
.mu-qr-modal-card .mu-btn { display: inline-flex; align-items: center; gap: 6px; }
|
||||
.mu-qr-modal-card .mu-btn .ic { width: 16px; height: 16px; }
|
||||
/* กดรูป QR = เปิดลิงก์ (ทั้งใบ กดได้) */
|
||||
.mu-qr-link { display: block; line-height: 0; border-radius: 10px; }
|
||||
.mu-qr-link:focus-visible { outline: 2px solid #7a4cc0; outline-offset: 3px; }
|
||||
.mu-qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
|
||||
.mu-copy-link.is-done { border-color: #1f8765; color: #1f8765; }
|
||||
|
||||
/* --- แผนที่ --- */
|
||||
.mu-map-card {
|
||||
@@ -139,7 +175,7 @@
|
||||
<section class="mu-vehicle-card" aria-label="รถประจำสายและติดต่อผู้ประกอบการ" id="route-vehicle-card">
|
||||
<img id="route-vehicle-img" alt="" loading="lazy" decoding="async" hidden>
|
||||
<div class="meta">
|
||||
<p class="label" data-i18n="route.vehicle">รถบัสประจำสาย</p>
|
||||
<p class="label" data-i18n="route.vehicle">รถประจำสาย</p>
|
||||
<h2 id="route-vehicle-title" hidden></h2>
|
||||
<p id="route-vehicle-desc" hidden></p>
|
||||
</div>
|
||||
|
||||
+133
-10
@@ -57,16 +57,20 @@
|
||||
};
|
||||
img.onerror();
|
||||
}
|
||||
/* เติม ?v=<เวอร์ชันแอป> ให้ URL รูป — bump VERSION ใน sw.js = รูปโหลดใหม่ทั้งหมด
|
||||
(browser/SW แคชรูปไว้แบบ cache-first จึงต้องเปลี่ยน URL เพื่อบังคับดึงใหม่) */
|
||||
function bust(u) { return (window.ImgURL && ImgURL.of) ? ImgURL.of(u) : u; }
|
||||
|
||||
function vehicleUrls(rid, cap) {
|
||||
var base = IMG_ROUTES + encodeURIComponent(rid) + '/', out = [];
|
||||
if (cap && cap.vehicle_image) out.push(base + cap.vehicle_image);
|
||||
CAR_NAMES.forEach(function (n) { CAR_EXTS.forEach(function (e) { out.push(base + n + '.' + e); }); });
|
||||
if (cap && cap.vehicle_image) out.push(bust(base + cap.vehicle_image));
|
||||
CAR_NAMES.forEach(function (n) { CAR_EXTS.forEach(function (e) { out.push(bust(base + n + '.' + e)); }); });
|
||||
return uniq(out);
|
||||
}
|
||||
function qrUrls(rid, cap) {
|
||||
var out = [];
|
||||
if (cap && cap.qr_image) out.push(IMG_QR + cap.qr_image);
|
||||
QR_EXTS.forEach(function (e) { out.push(IMG_QR + encodeURIComponent(rid) + '.' + e); });
|
||||
if (cap && cap.qr_image) out.push(bust(IMG_QR + cap.qr_image));
|
||||
QR_EXTS.forEach(function (e) { out.push(bust(IMG_QR + encodeURIComponent(rid) + '.' + e)); });
|
||||
return uniq(out);
|
||||
}
|
||||
|
||||
@@ -92,6 +96,30 @@
|
||||
{ key: 'line', icon: 'ic-message-circle', tone: 'tone-green', match: /line\.me|lin\.ee|linevoom|line\.at/i },
|
||||
{ key: 'www', icon: 'ic-globe', tone: 'tone-purple', match: /^https?:/i }
|
||||
];
|
||||
/* routes.json เก็บ web_url ได้ 2 แบบ:
|
||||
["facebook", "https://..."] ← อาร์เรย์ [ชนิดลิงก์, URL] (แบบใหม่ — ใช้ชนิดที่ระบุไว้เลย)
|
||||
"https://..." ← สตริงเดี่ยว (แบบเก่า — เดาชนิดจาก URL)
|
||||
คืน { kind, url } · ไม่มีข้อมูล = null */
|
||||
function parseWebUrl(raw) {
|
||||
var kindKey = null, url = '';
|
||||
if (Array.isArray(raw)) {
|
||||
raw.forEach(function (x) {
|
||||
var v = String(x == null ? '' : x).trim();
|
||||
if (!v) return;
|
||||
if (/^https?:\/\//i.test(v)) url = v;
|
||||
else if (LINK_KINDS.some(function (k) { return k.key === v.toLowerCase(); })) kindKey = v.toLowerCase();
|
||||
else if (!url) url = v; /* ค่าแปลก ๆ → กันข้อมูลหาย */
|
||||
});
|
||||
} else {
|
||||
url = String(raw == null ? '' : raw).trim();
|
||||
}
|
||||
if (!url && !kindKey) return null;
|
||||
return { kind: kindKey ? byKind(kindKey) : linkKind(url), url: url };
|
||||
}
|
||||
function byKind(key) {
|
||||
for (var i = 0; i < LINK_KINDS.length; i++) { if (LINK_KINDS[i].key === key) return LINK_KINDS[i]; }
|
||||
return { key: 'www', icon: 'ic-globe', tone: 'tone-purple' };
|
||||
}
|
||||
function linkKind(url) {
|
||||
var u = String(url || '').trim();
|
||||
if (!u) return null;
|
||||
@@ -108,7 +136,9 @@
|
||||
if (!host) return;
|
||||
host.innerHTML = '';
|
||||
|
||||
var kind = linkKind(route.web_url);
|
||||
var web = parseWebUrl(route.web_url); /* รองรับ ["kind","url"] และสตริงเดี่ยว */
|
||||
var kind = web ? web.kind : null;
|
||||
var webUrl = web ? web.url : '';
|
||||
var line = document.createElement('div');
|
||||
line.className = 'mu-contact-item';
|
||||
line.innerHTML =
|
||||
@@ -121,13 +151,25 @@
|
||||
qr.loading = 'lazy';
|
||||
qr.decoding = 'async';
|
||||
qr.hidden = true;
|
||||
line.appendChild(qr);
|
||||
/* กดที่ QR → ขยายลอยกลางจอให้สแกนง่าย (ปุ่มจริง เผื่อคีย์บอร์ด/อ่านหน้าจอ) */
|
||||
var qrBtn = document.createElement('button');
|
||||
qrBtn.type = 'button';
|
||||
qrBtn.className = 'mu-qr-btn';
|
||||
qrBtn.hidden = true;
|
||||
qrBtn.setAttribute('aria-label', t('route.zoomQr'));
|
||||
qrBtn.appendChild(qr);
|
||||
line.appendChild(qrBtn);
|
||||
host.appendChild(line);
|
||||
|
||||
var note = (cap && cap.line_note) ? String(cap.line_note).trim() : '';
|
||||
setText('route-line-note', note);
|
||||
var phones = (route.phone || []).filter(Boolean);
|
||||
tryImage(qr, qrUrls(rid, cap), 'LINE QR สาย ' + rid, function (ok) {
|
||||
qrBtn.hidden = !ok; /* ไม่มีรูป = ไม่มีปุ่มขยาย */
|
||||
if (ok) {
|
||||
var label = (kind ? t('route.link.' + kind.key) : 'LINE Official');
|
||||
qrBtn.addEventListener('click', function () { openQrModal(qr.src, label, webUrl); });
|
||||
}
|
||||
line.hidden = !ok && !note; /* ไม่มีทั้ง QR และข้อความ = ไม่ต้องแสดงแถวนี้ */
|
||||
host.hidden = line.hidden && !phones.length; /* ไม่มีอะไรจะแสดงเลย */
|
||||
});
|
||||
@@ -143,21 +185,98 @@
|
||||
});
|
||||
|
||||
/* ปุ่ม "เปิดลิงก์" แยกต่างหาก — ชัดเจนบนมือถือ (แสดงเมื่อ routes.json มี web_url) */
|
||||
if (kind) {
|
||||
if (kind && /^https?:\/\//i.test(webUrl)) {
|
||||
var open = document.createElement('a');
|
||||
open.className = 'mu-contact-item';
|
||||
open.href = String(route.web_url).trim();
|
||||
open.href = webUrl;
|
||||
open.target = '_blank';
|
||||
open.rel = 'noopener noreferrer';
|
||||
open.setAttribute('aria-label', t('route.openLink') + ': ' + prettyUrl(webUrl));
|
||||
open.innerHTML =
|
||||
'<span class="ic-wrap ' + kind.tone + '"><svg class="ic" aria-hidden="true"><use href="#' + kind.icon + '"/></svg></span>' +
|
||||
'<div class="txt"><strong>' + esc(t('route.openLink')) + '</strong><span>' + esc(prettyUrl(route.web_url)) + '</span></div>' +
|
||||
'<div class="txt"><strong>' + esc(t('route.openLink')) + '</strong></div>' + /* ไม่แสดง URL — กันล้นปุ่ม */
|
||||
'<span class="mu-link-go"><svg class="ic" aria-hidden="true"><use href="#ic-arrow-right"/></svg></span>';
|
||||
host.appendChild(open);
|
||||
host.hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ---------- ขยาย QR ลอยกลางจอ (ให้สแกนง่ายจากจออื่น) ----------
|
||||
ใช้ <dialog> ของเบราว์เซอร์: กด Esc ปิดได้เอง · คลิกพื้นหลังปิด · ไม่ต้องพึ่งไลบรารี
|
||||
ปุ่ม "เปิดลิงก์" เปิดแท็บใหม่ (target=_blank) */
|
||||
function openQrModal(src, label, url) {
|
||||
if (!src) return;
|
||||
var old = $('qr-modal');
|
||||
if (old) old.remove();
|
||||
var hasUrl = url && /^https?:\/\//i.test(String(url).trim());
|
||||
var dlg = document.createElement('dialog');
|
||||
dlg.id = 'qr-modal';
|
||||
dlg.className = 'mu-qr-modal';
|
||||
/* กดรูป QR = เปิดลิงก์ (ตามที่เจ้าของข้อมูลต้องการ) · มีปุ่ม "เปิดลิงก์" + "คัดลอกลิงก์" เป็นทางเลือกชัดเจน */
|
||||
var qrImg = hasUrl
|
||||
? '<a class="mu-qr-link" href="' + esc(String(url).trim()) + '" target="_blank" rel="noopener noreferrer"' +
|
||||
' aria-label="' + esc(t('route.openLink')) + '"><img class="mu-qr-big" src="' + esc(src) +
|
||||
'" alt="' + esc(label || 'QR') + '" decoding="async"></a>'
|
||||
: '<img class="mu-qr-big" src="' + esc(src) + '" alt="' + esc(label || 'QR') + '" decoding="async">';
|
||||
var acts = hasUrl
|
||||
? '<div class="mu-qr-actions">' +
|
||||
'<a class="mu-btn" href="' + esc(String(url).trim()) + '" target="_blank" rel="noopener noreferrer">' +
|
||||
esc(t('route.openLink')) + ' <svg class="ic" aria-hidden="true"><use href="#ic-arrow-right"/></svg></a>' +
|
||||
'<button type="button" class="mu-btn ghost mu-copy-link">' +
|
||||
'<svg class="ic" aria-hidden="true"><use href="#ic-copy"/></svg> ' + esc(t('route.copyLink')) + '</button>' +
|
||||
'</div>'
|
||||
: '';
|
||||
dlg.innerHTML =
|
||||
'<div class="mu-qr-modal-card">' +
|
||||
'<button type="button" class="mu-qr-close" aria-label="' + esc(t('common.close')) + '">' +
|
||||
'<svg class="ic" aria-hidden="true"><use href="#ic-x"/></svg></button>' +
|
||||
qrImg +
|
||||
'<strong>' + esc(label || '') + '</strong>' +
|
||||
acts +
|
||||
'</div>';
|
||||
document.body.appendChild(dlg);
|
||||
dlg.addEventListener('click', function (e) { /* คลิกพื้นหลัง = ปิด */
|
||||
if (e.target === dlg) dlg.close();
|
||||
});
|
||||
dlg.addEventListener('close', function () { dlg.remove(); });
|
||||
dlg.querySelector('.mu-qr-close').addEventListener('click', function () { dlg.close(); });
|
||||
|
||||
/* คัดลอกลิงก์ — ใช้ Clipboard API ก่อน, ถ้าไม่ให้สิทธิ์ถอยไป execCommand */
|
||||
var copyBtn = dlg.querySelector('.mu-copy-link');
|
||||
if (copyBtn) {
|
||||
copyBtn.addEventListener('click', function () {
|
||||
var target = String(url).trim();
|
||||
var done = function () {
|
||||
copyBtn.classList.add('is-done');
|
||||
var old2 = copyBtn.innerHTML;
|
||||
copyBtn.textContent = t('route.copied');
|
||||
setTimeout(function () { copyBtn.innerHTML = old2; copyBtn.classList.remove('is-done'); }, 1400);
|
||||
};
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(target).then(done).catch(function () { legacyCopy(target); done(); });
|
||||
} else { legacyCopy(target); done(); }
|
||||
});
|
||||
}
|
||||
if (typeof dlg.showModal === 'function') dlg.showModal(); else dlg.setAttribute('open', '');
|
||||
}
|
||||
|
||||
/* คัดลอกแบบเก่า (เบราว์เซอร์ไม่รองรับ Clipboard API / ไม่ได้ https) */
|
||||
function legacyCopy(text) {
|
||||
try {
|
||||
var ta = document.createElement('textarea');
|
||||
ta.value = text;
|
||||
ta.setAttribute('readonly', '');
|
||||
ta.style.position = 'fixed';
|
||||
ta.style.top = '-1000px';
|
||||
document.body.appendChild(ta);
|
||||
ta.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(ta);
|
||||
return true;
|
||||
} catch (e) { return false; }
|
||||
}
|
||||
|
||||
/* ---------- รอบต่อวัน / รอบถัดไป จาก schedules.json ---------- */
|
||||
function toMin(hhmm) {
|
||||
var a = String(hhmm).split(':');
|
||||
@@ -208,8 +327,12 @@
|
||||
list.filter(function (r) { return String(r.route_id) === FALLBACK_ID; })[0] || list[0];
|
||||
var rid = String(route.route_id);
|
||||
|
||||
/* หัวเรื่อง (chip + ชื่อสาย) */
|
||||
/* หัวเรื่อง (chip + ชื่อสาย) — สี chip เปลี่ยนตามหมวดเส้นทาง (route_group) */
|
||||
setText('route-chip', rid);
|
||||
var chipEl = $('route-chip');
|
||||
if (chipEl) {
|
||||
chipEl.className = 'mu-route-chip' + (route.route_group ? ' grp-' + route.route_group : '');
|
||||
}
|
||||
setText('route-title', route.route_name_th);
|
||||
document.title = 'Atroute — สาย ' + rid + (route.route_name_th ? ' ' + route.route_name_th : '');
|
||||
|
||||
|
||||
@@ -1,244 +0,0 @@
|
||||
<style>
|
||||
.mu-meta-row { display:flex; flex-wrap:wrap; gap:8px; margin: 8px 0 18px; }
|
||||
.mu-meta-pill { background:#fff; border:1px solid #f0d6e6; color:#5b3b71; padding:6px 14px; border-radius:999px; font-size:.85rem; font-weight:500; }
|
||||
.mu-meta-pill.purple { background:#f3eafe; color:#7a4cc0; border-color:#e3d2f6; }
|
||||
.mu-meta-pill.sky { background:#e8f4ff; color:#3071b8; border-color:#cfe5fb; }
|
||||
.mu-meta-pill.mint { background:#e6faf3; color:#1f8765; border-color:#c8efdf; }
|
||||
.mu-meta-pill.pink { background:#ffeaf2; color:#bb3a78; border-color:#f8c5db; }
|
||||
.mu-contact-row { display:flex; flex-wrap:wrap; gap:10px; }
|
||||
.mu-contact-row a, .mu-contact-row span { background:#fff; border:1px solid #ecd2e2; padding:8px 14px; border-radius:12px; color:#5b3b71; font-weight:500; text-decoration:none; }
|
||||
.mu-direction-tag { background:#7a4cc0; color:#fff; border-radius:999px; padding:2px 10px; font-size:.78rem; margin-left:8px; }
|
||||
.mu-schedule-note { color:#9a3b6e; font-size:.8rem; margin-top:6px; }
|
||||
.mu-quickpick { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
|
||||
.mu-quickpick a { background:#fff; border:1px solid #f0d6e6; border-radius:999px; padding:6px 12px; color:#5b3b71; text-decoration:none; font-weight:600; font-size:.85rem; }
|
||||
.mu-route-type-badge { display: inline-block; background: #f3eafe; color: #7a4cc0; padding: 4px 8px; border-radius: 6px; font-size: .8rem; font-weight: 500; margin-left: 6px; margin-right: 4px; }
|
||||
.mu-inline-context { margin: 6px 0 0; color:#6f7b95; font-size:.84rem; }
|
||||
.mu-inline-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; }
|
||||
.mu-inline-actions a { text-decoration:none; }
|
||||
|
||||
/* === Modern image polish === */
|
||||
.mu-logo-img { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,.12); }
|
||||
.mu-route-hero { position: relative; border-radius: 22px; overflow: hidden; margin: 10px 0 18px; box-shadow: 0 18px 38px rgba(122,76,192,.18); isolation: isolate; }
|
||||
.mu-route-hero img.bg { width: 100%; height: 260px; object-fit: cover; display: block; }
|
||||
.mu-route-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(31,42,68,.78) 0%, rgba(31,42,68,.4) 45%, rgba(31,42,68,.05) 100%); }
|
||||
.mu-route-hero .overlay { position: absolute; inset: 0; padding: 22px 26px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; z-index: 1; }
|
||||
.mu-route-hero .badge { display: inline-flex; gap: 8px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.32); padding: 6px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; width: fit-content; margin-bottom: 10px; }
|
||||
.mu-route-hero h2 { margin: 0; font-size: 1.7rem; line-height: 1.2; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
|
||||
.mu-route-hero p.tag { margin: 6px 0 0; opacity: .92; font-size: .92rem; max-width: 65%; text-shadow: 0 1px 4px rgba(0,0,0,.3); }
|
||||
.mu-contact-grid { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; margin-top: 10px; }
|
||||
.mu-qr-box { padding: 12px; border: 1px dashed #d7c7f8; border-radius: 14px; background: linear-gradient(135deg, #f8f4ff, #eef6ff); display: flex; gap: 12px; align-items: center; }
|
||||
.mu-qr-box img { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 10px; padding: 5px; box-shadow: 0 4px 10px rgba(0,0,0,.06); }
|
||||
.mu-qr-box .txt strong { display: block; color: #2b2f42; font-size: .92rem; }
|
||||
.mu-qr-box .txt span { display: block; color: #6f7b95; font-size: .78rem; margin-top: 2px; }
|
||||
.mu-qr-box .line-tag { display: inline-block; margin-top: 6px; background: #06c755; color: #fff; padding: 3px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; letter-spacing: .03em; }
|
||||
.mu-vehicle-strip { display: flex; gap: 12px; margin-top: 12px; align-items: stretch; }
|
||||
.mu-vehicle-strip img { width: 200px; height: 130px; object-fit: cover; border-radius: 14px; flex-shrink: 0; box-shadow: 0 6px 14px rgba(63,43,94,.10); }
|
||||
.mu-vehicle-strip .meta { display: flex; flex-direction: column; justify-content: center; }
|
||||
.mu-vehicle-strip .meta h3 { margin: 0 0 4px; font-size: 1rem; color: #2b2f42; }
|
||||
.mu-vehicle-strip .meta p { margin: 0; color: #6f7b95; font-size: .85rem; }
|
||||
.mu-stop-thumb { width: 100%; height: 130px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; display: block; box-shadow: 0 6px 14px rgba(63,43,94,.10); }
|
||||
</style>
|
||||
|
||||
<main class="mu-page">
|
||||
<div class="mu-container">
|
||||
<p class="mu-breadcrumb"><a href="#/">หน้าแรก</a>/ รายละเอียดสายรถ</p>
|
||||
<h1 class="mu-page-title"><span class="mu-route-chip">101</span> อ่างทอง - ป่าโมก - อยุธยา</h1>
|
||||
|
||||
<section class="mu-route-hero" aria-label="ภาพรวมของสาย">
|
||||
<img class="bg" src="../.image/routes/101/hero.jpeg" alt="ภาพบรรยากาศริมทางของสาย 101" fetchpriority="high" decoding="async">
|
||||
<div class="overlay">
|
||||
<span class="badge"><svg class="ic" aria-hidden="true"><use href="#ic-bus"/></svg> ขยายข้อมูล · 4 จุดจอดหลัก</span>
|
||||
<h2><span data-i18n="expanded.title">ตารางเวลาแบบขยายทุกจุดจอด</span></h2>
|
||||
<p class="tag">เชื่อมต่ออ่างทอง → ป่าโมก → อยุธยา · ดูตารางรถของทุกป้ายอย่างละเอียด</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<div class="mu-meta-row">
|
||||
<span class="mu-meta-pill purple">หมวดเส้นทางระหว่างจังหวัด</span>
|
||||
<span class="mu-meta-pill sky"><svg class="ic" aria-hidden="true"><use href="#ic-bus-front"/></svg> รถบัส</span>
|
||||
<span class="mu-meta-pill mint">2 จังหวัด · อ่างทอง · อยุธยา</span>
|
||||
<span class="mu-meta-pill pink">4 จุดจอด</span>
|
||||
</div>
|
||||
<p class="mu-inline-context">mock state: <strong>?route=101&origin=at_main_terminal&view=expanded</strong></p>
|
||||
|
||||
<form class="mu-toolbar" onsubmit="return false">
|
||||
<select aria-label="เลือกสายรถ">
|
||||
<option>สาย 101 - อ่างทอง-ป่าโมก-อยุธยา</option>
|
||||
<option>สาย 902 - กรุงเทพ-อ่างทอง สายเอเซีย</option>
|
||||
<option>สาย 15 - กรุงเทพ-อ่างทอง สายใน</option>
|
||||
<option>สาย 951 - กรุงเทพ-วิเศษ-สุพรรณ</option>
|
||||
<option>สาย 952 - กรุงเทพ-วิเศษชัยชาญ</option>
|
||||
<option>สาย 954 - กรุงเทพ-ท่าช้าง</option>
|
||||
<option>สาย 8 - กรุงเทพ-สรรคบุรี-ชัยนาท</option>
|
||||
<option>สาย 464 - สุพรรณ-อ่างทอง-สระบุรี</option>
|
||||
<option>สาย 641 - อ่างทอง-บ้านแพรก-ลพบุรี</option>
|
||||
<option>สาย 2194 - หัวเวียง-อยุธยา</option>
|
||||
<option>สาย 324 - อ่างทอง-วัดพิกุลทอง</option>
|
||||
<option>สาย 1011 - อ่างทอง-สีบัวทอง</option>
|
||||
<option>สาย 2231 - อ่างทอง-มหานาม</option>
|
||||
<option>สาย 999 - บขส.อ่างทอง สายเอเชีย-เหนือ</option>
|
||||
</select>
|
||||
<a class="mu-back-btn" href="#/"><span data-i18n="common.backHome">← กลับหน้าแรก</span></a>
|
||||
</form>
|
||||
|
||||
<div class="mu-panel">
|
||||
<h2><span data-i18n="route.contact">ติดต่อผู้ประกอบการ</span></h2>
|
||||
<div class="mu-contact-row">
|
||||
<a href="tel:+66649639025"><svg class="ic" aria-hidden="true"><use href="#ic-phone"/></svg> +66 64 963 9025</a>
|
||||
<span><svg class="ic" aria-hidden="true"><use href="#ic-globe"/></svg> ยังไม่ระบุเว็บไซต์</span>
|
||||
</div>
|
||||
<div class="mu-qr-box" style="margin-top:12px;">
|
||||
<img src="../.image/qrcode/101.png" alt="LINE QR สาย 101" loading="lazy" decoding="async">
|
||||
<div class="txt">
|
||||
<strong>ติดตามข่าวสาย 101</strong>
|
||||
<span>สแกน QR รับข่าวสาร · เลื่อนเวลา · ไม่มีรถ</span>
|
||||
<span class="line-tag">LINE Official</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mu-vehicle-strip">
|
||||
<img src="../.image/routes/101/car.jpeg" alt="รถของสาย 101" loading="lazy" decoding="async">
|
||||
<div class="meta">
|
||||
<h3><span data-i18n="route.vehicle">รถบัสประจำสาย</span></h3>
|
||||
<p>รถปรับอากาศ · ไม่สูบบุหรี่ · 40 ที่นั่ง<br>ออกรอบละ 24 เที่ยว · ช่วง 04:30-21:00</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mu-panel">
|
||||
<h2><span data-i18n="route.stopsTitle">จุดจอดสำคัญบนเส้นทาง</span></h2>
|
||||
<ul class="mu-list mu-stop-list">
|
||||
<li>
|
||||
<details class="mu-stop-expander" open>
|
||||
<summary>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg> ต้นทาง</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>บขส.อ่างทอง</strong>
|
||||
<span class="mu-stop-summary-meta">อ่างทอง</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<img class="mu-stop-thumb" src="../.image/stops/54950.jpg" alt="บขส.อ่างทอง" loading="lazy" decoding="async">
|
||||
<p style="font-weight: 600; margin-bottom: 8px;">ตารางเดินรถ ณ บขส.อ่างทอง</p>
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">07:30</div><div class="mu-time-chip">08:20</div>
|
||||
<div class="mu-time-chip next">09:10</div><div class="mu-time-chip">10:00</div>
|
||||
<div class="mu-time-chip">10:50</div><div class="mu-time-chip">11:50</div>
|
||||
<div class="mu-time-chip">13:00</div><div class="mu-time-chip">14:00</div>
|
||||
<div class="mu-time-chip">15:00</div>
|
||||
</div>
|
||||
<div class="mu-inline-actions">
|
||||
<a class="mu-btn ghost" href="#/stops/at_main_terminal?route=101">ไปหน้ารายละเอียดจุดจอด</a>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-refresh-cw"/></svg> จุดเปลี่ยน</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>สถานีขนส่งป่าโมก</strong>
|
||||
<span class="mu-stop-summary-meta">อ่างทอง</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<img class="mu-stop-thumb" src="../.image/stops/36020.jpg" alt="สถานีขนส่งป่าโมก" loading="lazy" decoding="async">
|
||||
<p style="font-weight: 600; margin: 0 0 8px 0;">ไปอ่างทอง <span class="mu-direction-tag">ทิศทาง</span></p>
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">07:30</div><div class="mu-time-chip">08:20</div>
|
||||
<div class="mu-time-chip">09:10</div><div class="mu-time-chip">10:00</div>
|
||||
<div class="mu-time-chip">10:50</div><div class="mu-time-chip">11:40</div>
|
||||
<div class="mu-time-chip">12:30</div><div class="mu-time-chip">13:20</div>
|
||||
<div class="mu-time-chip">14:10</div><div class="mu-time-chip">15:00</div>
|
||||
<div class="mu-time-chip">15:50</div><div class="mu-time-chip">16:40</div>
|
||||
<div class="mu-time-chip">17:30</div><div class="mu-time-chip">18:30</div>
|
||||
</div>
|
||||
<p style="font-weight: 600; margin: 12px 0 8px 0;">ไปอยุธยา <span class="mu-direction-tag">ทิศทาง</span></p>
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">08:00</div><div class="mu-time-chip">08:50</div>
|
||||
<div class="mu-time-chip">09:40</div><div class="mu-time-chip">10:30</div>
|
||||
<div class="mu-time-chip">11:20</div><div class="mu-time-chip">12:20</div>
|
||||
<div class="mu-time-chip">13:30</div><div class="mu-time-chip">14:30</div>
|
||||
<div class="mu-time-chip">15:30</div>
|
||||
</div>
|
||||
<p class="mu-schedule-note"><svg class="ic" aria-hidden="true"><use href="#ic-triangle-alert"/></svg> เวลารถเปลี่ยนทุกวัน โดยเฉพาะวันหยุด</p>
|
||||
<div class="mu-inline-actions">
|
||||
<a class="mu-btn ghost" href="#/stops/pa_mok_terminal?route=101">ไปหน้ารายละเอียดจุดจอด</a>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg> ผ่านทาง</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>จุดขึ้นลงรถสองแถว 101 อยุธยา-ป่าโมก-อ่างทอง</strong>
|
||||
<span class="mu-stop-summary-meta">อยุธยา</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<img class="mu-stop-thumb" src="../.image/stops/39321.jpg" alt="จุดขึ้นลงรถสองแถว" loading="lazy" decoding="async">
|
||||
<p style="font-weight: 600; margin-bottom: 8px;">ยังไม่มีข้อมูลตารางอัปเดต</p>
|
||||
<div class="mu-inline-actions">
|
||||
<a class="mu-btn ghost" href="#/stops/route_101_stop_ayutthaya?route=101">ไปหน้ารายละเอียดจุดจอด</a>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
<li>
|
||||
<details class="mu-stop-expander">
|
||||
<summary>
|
||||
<span class="mu-route-type-badge"><svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg> ปลายทาง</span>
|
||||
<span class="mu-stop-summary-main">
|
||||
<strong>ตลาดเจ้าพรหม</strong>
|
||||
<span class="mu-stop-summary-meta">อยุธยา</span>
|
||||
</span>
|
||||
<span class="mu-stop-summary-rail">
|
||||
<span class="mu-stop-chevron">⌄</span>
|
||||
</span>
|
||||
</summary>
|
||||
<div class="mu-stop-expander-body">
|
||||
<img class="mu-stop-thumb" src="../.image/stops/42110.jpg" alt="ตลาดเจ้าพรหม อยุธยา" loading="lazy" decoding="async">
|
||||
<p style="font-weight: 600; margin-bottom: 8px;">ตารางเดินรถ ณ ตลาดเจ้าพรหม (อยุธยา)</p>
|
||||
<div class="mu-time-grid">
|
||||
<div class="mu-time-chip">06:30</div><div class="mu-time-chip">07:20</div>
|
||||
<div class="mu-time-chip">08:10</div><div class="mu-time-chip next">09:00</div>
|
||||
<div class="mu-time-chip">09:50</div><div class="mu-time-chip">10:40</div>
|
||||
<div class="mu-time-chip">11:30</div><div class="mu-time-chip">12:20</div>
|
||||
<div class="mu-time-chip">13:10</div><div class="mu-time-chip">14:00</div>
|
||||
<div class="mu-time-chip">14:50</div><div class="mu-time-chip">15:40</div>
|
||||
<div class="mu-time-chip">16:30</div><div class="mu-time-chip">17:30</div>
|
||||
</div>
|
||||
<div class="mu-inline-actions">
|
||||
<a class="mu-btn ghost" href="#/stops/jaoprom_market?route=101">ไปหน้ารายละเอียดจุดจอด</a>
|
||||
</div>
|
||||
</div>
|
||||
</details>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="mu-panel">
|
||||
<h2><span data-i18n="route.seeOther">เลือกสายรถอื่น</span></h2>
|
||||
<div class="mu-quickpick">
|
||||
<a href="#/routes/902">902</a><a href="#/routes/15">15</a>
|
||||
<a href="#/routes/951">951</a><a href="#/routes/952">952</a>
|
||||
<a href="#/routes/954">954</a><a href="#/routes/8">8</a>
|
||||
<a href="#/routes/464">464</a><a href="#/routes/641">641</a>
|
||||
<a href="#/routes/2194">2194</a><a href="#/routes/324">324</a>
|
||||
<a href="#/routes/1011">1011</a><a href="#/routes/2231">2231</a>
|
||||
<a href="#/routes/999">999</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
@@ -63,7 +63,8 @@
|
||||
function next() {
|
||||
if (i >= IMG_EXTS.length) return Promise.resolve(null);
|
||||
var url = base + '.' + IMG_EXTS[i++];
|
||||
return exists(url).then(function (u) { return u || next(); });
|
||||
var bu = (window.ImgURL && ImgURL.of) ? ImgURL.of(url) : url; /* ?v= กัน cache-first ของ SW */
|
||||
return exists(bu).then(function (u) { return u || next(); });
|
||||
}
|
||||
return next();
|
||||
}
|
||||
|
||||
@@ -164,8 +164,9 @@
|
||||
<div class="mu-zone">
|
||||
<div class="mu-zone-head">
|
||||
<span class="mu-zone-tag tag-purple" data-i18n="check.scheduleAll">ตารางเวลาเดินรถทุกจุดจอด</span>
|
||||
<p class="mu-zone-desc" id="check-zone-desc"></p>
|
||||
<p class="mu-zone-desc" id="check-now-line"></p>
|
||||
<p class="mu-zone-desc mu-zone-meta" id="check-zone-desc"></p>
|
||||
<p class="mu-zone-desc mu-zone-meta mu-zone-now" id="check-now-line"></p>
|
||||
<p class="mu-zone-desc mu-zone-updated" id="check-updated-line"></p>
|
||||
</div>
|
||||
|
||||
<!-- การ์ดจุดจอด + ชิปเวลา: สร้างจาก resource/data/schedules.json (checkSchedule.init.js) -->
|
||||
|
||||
@@ -27,7 +27,9 @@
|
||||
var ONLY_STOPS_WITH_SCHEDULE = false;
|
||||
|
||||
var sections = []; /* [{ chips:[], times:[], station }] */
|
||||
var netRoute = null; /* routes.json ของสายที่แสดงอยู่ */
|
||||
var netRoute = null;
|
||||
var OTHER_ENTRIES = [];
|
||||
var ROUTE_IDS = []; /* routes.json ของสายที่แสดงอยู่ */
|
||||
var timer = null;
|
||||
|
||||
function $(id) { return document.getElementById(id); }
|
||||
@@ -56,10 +58,15 @@
|
||||
}
|
||||
|
||||
/* ---------- จำแนกประเภทจุดจอดจากข้อมูล + ลำดับในเส้นทาง ---------- */
|
||||
/* บทบาทของจุดในการ์ด:
|
||||
index 0 = ต้นทาง · index สุดท้าย = ปลายทาง
|
||||
ระหว่างนั้น: จุดที่เป็น "สถานีขนส่งหลัก" = กลางทาง (จุดพักรถที่คนขึ้น/ลงได้)
|
||||
จุดป้ายริมทางทั่วไป = ผ่านทาง
|
||||
⚠️ ใช้กับ "ลำดับที่แสดงในหน้านี้" เท่านั้น — ลำดับมาอยู่ที่ station_order ไม่ใช่บทบาทถาวร */
|
||||
function kindOf(st, i, n) {
|
||||
if (i === 0) return { key: 'route.origin', icon: 'ic-map-pin', tone: TONES.origin };
|
||||
if (i === n - 1) return { key: 'route.destination', icon: 'ic-map-pin', tone: TONES.destination };
|
||||
if (st && st.station_type === 'main_terminal') return { key: 'route.transfer', icon: 'ic-refresh-cw', tone: TONES.transfer };
|
||||
if (st && st.station_type === 'main_terminal') return { key: 'route.transfer', icon: 'ic-map-pin', tone: TONES.transfer };
|
||||
return { key: 'route.pass', icon: 'ic-map-pin', tone: TONES.pass };
|
||||
}
|
||||
|
||||
@@ -111,12 +118,12 @@
|
||||
return;
|
||||
}
|
||||
|
||||
/* หัวแถว = ชื่อทิศ (dir_label) → ไม่มีค่อยใช้ dir_note → ไม่มีอีกค่อยบอกว่าอยู่ที่จุดนี้
|
||||
/* หัวแถว = ชื่อทิศ (direction_label) → ไม่มีค่อยใช้ direction_note → ไม่มีอีกค่อยบอกว่าอยู่ที่จุดนี้
|
||||
ทิศที่ไปคนละทางจากจุดเดียวกัน (ป่าโมกไปอ่างทอง / ป่าโมกไปอยุธยา) จึงแยกให้เห็นชัด */
|
||||
var sub = document.createElement('p');
|
||||
sub.className = 'mu-stop-sub';
|
||||
if (r.dir_label) {
|
||||
sub.innerHTML = esc(r.dir_label) +
|
||||
if ((r.direction_label || r.dir_label)) {
|
||||
sub.innerHTML = esc((r.direction_label || r.dir_label)) +
|
||||
(r.direction_note ? ' <span class="mu-direction-tag">' + esc(r.direction_note) + '</span>' : '');
|
||||
} else if (r.direction_note) {
|
||||
sub.innerHTML = esc(r.direction_note) + ' <span class="mu-direction-tag">' + esc(t('check.direction')) + '</span>';
|
||||
@@ -175,32 +182,212 @@
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- แถวข้อมูลแบบ "ชิ้น" (segment) ----------
|
||||
แต่ละชิ้นเป็น flex item → ตัดบรรทัดเป็นหน่วย ไม่ตัดกลางคำ
|
||||
(สำคัญกับข้อความไทยที่ไม่มีเว้นวรรค เช่น "บขส.อ่างทอง → สถานีเดินรถโดยสารขนาดเล็ก (จตุจักร)"
|
||||
จะไม่ถูกตัดกลางชื่อสถานี) · ตัวคั่น "·" วาดด้วย CSS (.mu-zone-seg + .mu-zone-seg::before) */
|
||||
function icSvg(name) {
|
||||
return '<svg class="ic" aria-hidden="true"><use href="#' + name + '"/></svg>';
|
||||
}
|
||||
/* seg = "ข้อความล้วน" หรือ { html: "...", icon: "ic-xxx" } (html ต้อง esc() มาก่อน) */
|
||||
function setSegments(host, segs) {
|
||||
if (!host) return;
|
||||
host.innerHTML = '';
|
||||
segs.forEach(function (s) {
|
||||
var seg = document.createElement('span');
|
||||
seg.className = 'mu-zone-seg';
|
||||
if (s && typeof s === 'object') {
|
||||
seg.innerHTML = (s.icon ? icSvg(s.icon) : '') + (s.html || '');
|
||||
} else {
|
||||
seg.textContent = String(s == null ? '' : s); /* ข้อความล้วน — ปลอดภัยจาก HTML */
|
||||
}
|
||||
host.appendChild(seg);
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- "อัปเดตล่าสุด N วันที่แล้ว" จากฟิลด์ updated (ISO) ----------
|
||||
เทียบ "วันนี้" กับวันที่ในฟิลด์ updated (ไม่ใช้เวลา → ไม่มีปัญหา timezone)
|
||||
วันเดียวกัน → "วันนี้" · เมื่อวาน → "เมื่อวาน"
|
||||
< 7 วัน → N วันที่แล้ว · < 30 วัน → N สัปดาห์ที่แล้ว
|
||||
< 365 วัน → N เดือนที่แล้ว · มากกว่า → N ปี M เดือนที่แล้ว
|
||||
หมายเหตุ: ใช้ mtime/Last-Modified จากเบราว์เซอร์ไม่ได้ (fetch ข้ามโดเมนไม่ให้อ่าน)
|
||||
→ ค่ามาจาก resource/tools/stamp-schedules.py ที่เติมจาก mtime จริง */
|
||||
function daysAgo(iso) {
|
||||
var m = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(iso || '').trim());
|
||||
if (!m) return null;
|
||||
var then = new Date(Date.UTC(+m[1], +m[2] - 1, +m[3]));
|
||||
if (isNaN(then.getTime())) return null;
|
||||
var now = new Date();
|
||||
var today = new Date(Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()));
|
||||
return Math.round((today - then) / 86400000);
|
||||
}
|
||||
function agoLabel(days) {
|
||||
if (days == null) return '';
|
||||
if (days <= 0) return t('check.agoToday');
|
||||
if (days === 1) return t('check.agoYesterday');
|
||||
if (days < 7) return t('check.agoDays', { n: days });
|
||||
if (days < 30) return t('check.agoWeeks', { n: Math.floor(days / 7) });
|
||||
if (days < 365) return t('check.agoMonths', { n: Math.floor(days / 30) });
|
||||
var y = Math.floor(days / 365), mo = Math.floor((days % 365) / 30);
|
||||
return mo ? t('check.agoYearsMonths', { y: y, m: mo }) : t('check.agoYears', { y: y });
|
||||
}
|
||||
|
||||
function appendSubStopCards(listEl, rid, groups, schedDoc, recs) {
|
||||
if (!window.OtherStop || !OtherStop.allStops || !window.Schedules) return;
|
||||
/* allStops() คืน "รายการแบน": [{ index, name, city_th, province_th, lat, lng, offsetMin, hasCoord, entry }] */
|
||||
var sub = OtherStop.allStops(OTHER_ENTRIES, rid, ROUTE_IDS);
|
||||
if (!sub || sub.length < 2) return; /* มีจุดเดียว = การ์ดหลักแสดงอยู่แล้ว */
|
||||
|
||||
var first = sub[0].name;
|
||||
|
||||
/* จุดอ้างอิง = จุดแรกของจุดย่อย (index 0 · offset = 0) ซึ่งตรงกับการ์ดหลัก (station 8)
|
||||
แต่ละทิศมี "จุดอ้างอิงของตัวเอง" — ทิศที่มีข้อมูล (station_id = จุดอ้างอิง) ให้ offset คงที่ (+0)
|
||||
สายที่วิ่ง 2 ทาง (ไป-กลับ) จึงแสดงครบทั้ง 2 ทิศในทุกจุดย่อย
|
||||
ทิศที่ยังไม่มีตาราง (แค่ชื่อทิศ) → ไม่แสดง (ห้ามเดาเวลาที่ไม่มีต้นทาง) */
|
||||
/* จุดอ้างอิง = "จุดขึ้นรถประจำทางอื่นๆ" (station 8) — จุดแรกของ other_stop คือจุดที่มีตารางจริง
|
||||
ไม่ใช้ "record แรก" เพราะ recs เรียงตาม station_order (บขส.อ่างทองมาก่อน) จะได้จุดอ้างอิงผิด */
|
||||
var hubSid = null, hubDir = null; /* hubDir = ชื่อทิศ "ของจุดอ้างอิง" (ตัวตั้งเวลา) */
|
||||
groups.forEach(function (g) {
|
||||
if (String(g.sid) === '8') hubSid = '8';
|
||||
});
|
||||
if (hubSid === null) { /* ไม่มี station 8 → ใช้จุดแรกที่มีเวลาตามเดิม */
|
||||
groups.forEach(function (g) {
|
||||
g.recs.forEach(function (r) {
|
||||
if ((r.departure_times || []).length && hubSid === null) hubSid = String(r.station_id);
|
||||
});
|
||||
});
|
||||
}
|
||||
/* ทิศตั้งต้น = ทิศที่ "เริ่มจากจุดอ้างอิง" (จุดแรกของ other_stop = วัดสีบัวทอง)
|
||||
ตัวชี้ที่ใช้ได้: ชื่อทิศตรงกับ "จาก<ชื่อจุดแรก>" หรือ note ของจุดย่อย */
|
||||
var hubName = sub[0].name;
|
||||
recs.forEach(function (r) {
|
||||
if (String(r.route_id) !== rid) return;
|
||||
if (hubDir !== null || !(r.departure_times || []).length) return;
|
||||
var lbl = String((r.direction_label || r.dir_label) || '');
|
||||
var note = String((r.direction_note || r.dir_note) || '');
|
||||
if (lbl.indexOf(hubName) !== -1 || note.indexOf(hubName) === 0) hubDir = (r.direction_label || r.dir_label);
|
||||
});
|
||||
if (hubSid === null) return; /* ไม่มีตารางจริงเลย → คำนวณไม่ได้ */
|
||||
|
||||
/* ทุกทิศของสายนี้: ทิศของจุดอ้างอิง = เวลาต้นทาง · ทิศอื่น = จุดอ้างอิง + offset ของจุดนี้ */
|
||||
var legs = [];
|
||||
recs.forEach(function (r) {
|
||||
if (String(r.route_id) !== rid) return; /* เฉพาะสายนี้ — recs มีทุกสาย */
|
||||
if (!(r.departure_times || []).length) return; /* ทิศนี้ยังไม่มีตาราง → ข้าม */
|
||||
legs.push({ rec: r, fixed: ((r.direction_label || r.dir_label) === hubDir) ? 0 : null });
|
||||
});
|
||||
if (!legs.length) return; /* ไม่มีทิศที่คำนวณได้ → ไม่แสดงการ์ดย่อย */
|
||||
|
||||
/* จุดแรกของจุดย่อย = จุดอ้างอิงเอง (แสดงเป็นการ์ดหลักอยู่แล้ว) → เริ่มที่จุดที่ 2
|
||||
และข้ามจุดที่พิกัด/ชื่อซ้ำกับจุดอ้างอิง */
|
||||
sub.slice(1).forEach(function (x) {
|
||||
if (x.name === hubName) return; /* ชื่อซ้ำกับการ์ดต้นทาง → ไม่แสดงซ้ำ */
|
||||
var off = (x.offsetMin == null ? null : Number(x.offsetMin));
|
||||
var li = document.createElement('li');
|
||||
var det = document.createElement('details');
|
||||
det.className = 'mu-stop-card';
|
||||
det.open = true;
|
||||
var where = [x.city_th, x.province_th].filter(Boolean).join(' · ');
|
||||
var sum = document.createElement('summary');
|
||||
sum.innerHTML =
|
||||
'<span class="mu-stop-head ' + TONES.transfer + '">' +
|
||||
'<span class="mu-stop-kind"><svg class="ic" aria-hidden="true"><use href="#ic-map-pin"/></svg> <span>' +
|
||||
esc(t('stops.subStop')) + '</span></span>' +
|
||||
'<span class="mu-stop-title"><strong>' + esc(x.name) + '</strong><small>' + esc(where) + '</small></span>' +
|
||||
'<span class="mu-stop-chevron">\u2304</span>' +
|
||||
'</span>';
|
||||
det.appendChild(sum);
|
||||
|
||||
var body = document.createElement('div');
|
||||
body.className = 'mu-stop-body';
|
||||
|
||||
if (off == null) { /* ยังไม่ระบุเวลาเดินทาง → คำนวณไม่ได้ */
|
||||
var na = document.createElement('p');
|
||||
na.className = 'mu-stop-sub';
|
||||
na.textContent = t('stops.noOffset');
|
||||
body.appendChild(na);
|
||||
} else {
|
||||
legs.forEach(function (leg) {
|
||||
var r = leg.rec;
|
||||
var raw = (r.departure_times || []).length ? r.departure_times : [];
|
||||
if (!raw.length) return; /* ทิศนี้ยังไม่มีตารางจริง → ข้าม */
|
||||
|
||||
/* ทิศของจุดอ้างอิงเอง (fixed = 0) → เวลาเท่าต้นทาง · ทิศอื่น → บวก offset ของจุดนี้ */
|
||||
var o = (leg.fixed === 0) ? 0 : off;
|
||||
var times = (o === 0) ? raw.slice() : Schedules.shiftTimes(raw, o);
|
||||
|
||||
var head = document.createElement('p');
|
||||
head.className = 'mu-stop-sub';
|
||||
head.textContent = (r.direction_label || r.dir_label) || r.direction_note || ('จาก ' + first);
|
||||
body.appendChild(head);
|
||||
|
||||
var grid = document.createElement('div');
|
||||
grid.className = 'mu-time-grid' + (o === 0 ? '' : ' is-est');
|
||||
var chips = [];
|
||||
times.forEach(function (tm) {
|
||||
var chip = document.createElement('div');
|
||||
chip.className = 'mu-time-chip';
|
||||
chip.textContent = tm;
|
||||
grid.appendChild(chip);
|
||||
chips.push(chip);
|
||||
});
|
||||
body.appendChild(grid);
|
||||
/* ให้จุดย่อยอยู่ในระบบ "รอบถัดไป" ด้วย (refreshHighlights วน sections[])
|
||||
ไม่งั้นชิปของจุดย่อยไม่ถูกไฮไลต์ และรอบถัดไปมองไม่เห็นเวลาของจุดนี้ */
|
||||
sections.push({ chips: chips, times: times, station: x.name });
|
||||
|
||||
if (o !== 0) {
|
||||
var note = document.createElement('p');
|
||||
note.className = 'mu-est-note';
|
||||
note.textContent = t('time.derived', { base: first, n: Schedules.offsetLabel(o) });
|
||||
body.appendChild(note);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
det.appendChild(body);
|
||||
li.appendChild(det);
|
||||
listEl.appendChild(li);
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- ไฮไลต์เที่ยวถัดไป + บรรทัดเวลาปัจจุบัน ---------- */
|
||||
function refreshHighlights() {
|
||||
var nowm = nowMin();
|
||||
var next = null; /* เที่ยวถัดไปที่เร็วที่สุดในทุกจุดจอด */
|
||||
|
||||
/* เลือกเที่ยวถัดไปของจุดหนึ่ง ๆ
|
||||
- ถ้ามีเที่ยวที่ยังไม่ผ่านวันนี้ → ใช้ตัวแรกนั้น
|
||||
- ถ้าหมดทุกเที่ยวของวันแล้ว → วนไปเที่ยวแรกของ "วันถัดไป" (+1440 เพื่อเทียบลำดับข้ามวันได้)
|
||||
หน้าจอแสดงแค่ HH:MM (ไม่ติดป้าย "พรุ่งนี้" — เจ้าของข้อมูลกำหนด) แต่ไฮไลต์ชิปแบบเดียวกัน */
|
||||
function pick(sec, idx, m) {
|
||||
if (idx < 0 || !sec.chips[idx]) return;
|
||||
sec.chips[idx].classList.add('next');
|
||||
if (next === null || m < next.m) next = { m: m, time: sec.times[idx], station: sec.station };
|
||||
}
|
||||
|
||||
sections.forEach(function (sec) {
|
||||
sec.chips.forEach(function (c) { c.classList.remove('next'); });
|
||||
if (!sec.times.length) return;
|
||||
for (var i = 0; i < sec.times.length; i++) {
|
||||
var m = toMin(sec.times[i]);
|
||||
if (m >= nowm) { /* เที่ยวแรกที่ยังไม่ผ่าน */
|
||||
sec.chips[i].classList.add('next');
|
||||
if (next === null || m < next.m) next = { m: m, time: sec.times[i], station: sec.station };
|
||||
break;
|
||||
}
|
||||
if (m >= nowm) { pick(sec, i, m); return; }
|
||||
}
|
||||
pick(sec, 0, toMin(sec.times[0]) + 1440); /* หมดวัน → เที่ยวแรกพรุ่งนี้ */
|
||||
});
|
||||
|
||||
setStat('check-stat-next', next ? next.time : '');
|
||||
|
||||
var line = $('check-now-line');
|
||||
if (!line) return;
|
||||
var clock = '<svg class="ic" aria-hidden="true"><use href="#ic-clock"/></svg> ';
|
||||
var body = esc(t('check.now')) + ' <b>' + hhmm(nowm) + '</b>';
|
||||
if (next) body += ' · ' + esc(t('check.nextAt')) + ' <b>' + esc(next.time) + '</b> (' + esc(next.station) + ')';
|
||||
else if (sections.length) body += ' · <b>' + esc(t('check.noMoreToday')) + '</b>';
|
||||
line.innerHTML = clock + body;
|
||||
var nowSegs = [{ icon: 'ic-clock', html: esc(t('check.now')) + ' <b>' + hhmm(nowm) + '</b>' }];
|
||||
if (next) {
|
||||
nowSegs.push({ html: esc(t('check.nextAt')) + ' <b>' + esc(next.time) + '</b> ' +
|
||||
'<span class="mu-zone-at">(' + esc(next.station) + ')</span>' });
|
||||
} else if (sections.length) {
|
||||
nowSegs.push({ html: '<b>' + esc(t('check.noMoreToday')) + '</b>' });
|
||||
}
|
||||
setSegments(line, nowSegs);
|
||||
}
|
||||
|
||||
/* ---------- โหลด + แสดงผล ---------- */
|
||||
@@ -212,9 +399,12 @@
|
||||
Promise.all([
|
||||
fetchJSON(DATA + 'routes.json'),
|
||||
fetchJSON(DATA + 'stations.json'),
|
||||
Schedules.load().then(function (sd) { return Schedules.normSub(sd); })
|
||||
Schedules.load().then(function (sd) { return Schedules.normSub(sd); }),
|
||||
fetchJSON(DATA + '8 other_stop.json').catch(function () { return null; }) /* จุดย่อยของ "จุดขึ้นรถอื่นๆ" */
|
||||
]).then(function (res) {
|
||||
var routes = (res[0] || {}).routes || [];
|
||||
OTHER_ENTRIES = (res[3] || {}).other_stop || [];
|
||||
ROUTE_IDS = routes.map(function (r) { return String(r.route_id); });
|
||||
var sts = (res[1] || {}).stations || [];
|
||||
if (window.Schedules && Schedules.setStationNames) Schedules.setStationNames(sts); /* ให้ข้อความ "คำนวณจาก ..." มีชื่อจุด */
|
||||
var recs = window.Schedules ? Schedules.records(res[2]) : ((res[2] || {}).schedules || res[2] || []);
|
||||
@@ -248,6 +438,15 @@
|
||||
var hero = $('check-hero-route');
|
||||
if (hero) hero.textContent = 'สาย ' + rid + (route.route_name_th ? ' · ' + route.route_name_th : '');
|
||||
|
||||
/* "อัปเดตล่าสุด N วันที่แล้ว" — วันที่จากฟิลด์ updated ของไฟล์ตารางสายนี้ (Schedules.updatedOf)
|
||||
แยกบรรทัดของตัวเอง (#check-updated-line) เพราะ #check-now-line แสดงเวลาปัจจุบันอยู่แล้ว */
|
||||
var updLine = $('check-updated-line');
|
||||
if (updLine) {
|
||||
var upd = (window.Schedules && Schedules.updatedOf) ? Schedules.updatedOf(rid) : null;
|
||||
var nDays = daysAgo(upd);
|
||||
updLine.textContent = nDays == null ? '' : t('check.updatedAgo', { ago: agoLabel(nDays) });
|
||||
}
|
||||
|
||||
/* จัดกลุ่มตามลำดับจุดจอดของสาย แล้วต่อด้วยจุดที่เหลือ (ถ้ามีข้อมูล) */
|
||||
var order = (route.station_ids || []).slice();
|
||||
/* schema 2: ใช้ station_order ที่ตรวจทิศทางมาแล้วจากไฟล์ (ถ้ามี) */
|
||||
@@ -257,12 +456,21 @@
|
||||
if (String(r.route_id) === rid && order.indexOf(r.station_id) === -1) order.push(r.station_id);
|
||||
});
|
||||
|
||||
/* จุดที่เป็น "จุดขึ้นรถประจำทางอื่นๆ" (station 8) ให้ใช้ชื่อจริงของสายนั้น
|
||||
จาก 8 other_stop.json (จุดแรก) เช่น 954 → "ตลาดท่าช้าง" แทนชื่อกลาง ๆ */
|
||||
var firstSubName = null;
|
||||
if (window.OtherStop && OtherStop.allStops) {
|
||||
var allSub = OtherStop.allStops(OTHER_ENTRIES, rid, ROUTE_IDS);
|
||||
if (allSub.length) firstSubName = allSub[0].name; /* จุดแรกของจุดย่อย = ชื่อจริงของสายนี้ */
|
||||
}
|
||||
|
||||
var groups = order.map(function (sid) {
|
||||
var st = byId[sid] || null;
|
||||
var isOtherHub = String(sid) === '8'; /* จุดรวม "จุดขึ้นรถอื่นๆ" */
|
||||
return {
|
||||
sid: sid,
|
||||
st: st,
|
||||
name: st ? st.station_name_th : 'จุดจอด ' + sid,
|
||||
name: isOtherHub && firstSubName ? firstSubName : (st ? st.station_name_th : 'จุดจอด ' + sid),
|
||||
city: st ? st.city_th : '',
|
||||
code: st ? st.station_code : '',
|
||||
recs: recs.filter(function (r) { return String(r.route_id) === rid && r.station_id === sid; })
|
||||
@@ -272,7 +480,12 @@
|
||||
});
|
||||
|
||||
var listEl = $('check-schedule-list');
|
||||
if (listEl) renderList(listEl, route, groups);
|
||||
if (listEl) {
|
||||
renderList(listEl, route, groups);
|
||||
/* จุดย่อยของสายนั้น (จาก 8 other_stop.json) — จุดที่ 2 เป็นต้นไปของสาย 8
|
||||
เช่น 2194: ① วัดหัวเวียง ② วัดถนน (เวลาจุดถัดไป = เวลาจุดแรก + offsets_min) */
|
||||
appendSubStopCards(listEl, rid, groups, res[2], recs);
|
||||
}
|
||||
|
||||
var desc = $('check-zone-desc');
|
||||
if (desc) {
|
||||
@@ -280,7 +493,7 @@
|
||||
/* บอกว่า "ตารางวันนี้" เป็นของวันไหน — เฉพาะสายที่มีการแยกตารางตามวัน (service) เท่านั้น
|
||||
สายอื่นข้อความเหมือนเดิมทุกตัวอักษร */
|
||||
/* ป้ายบอกว่า "ตารางที่เห็นอยู่นี้เป็นของวันไหน" — ใช้ผลตรวจวันจากตัวอ่านกลาง (ไม่คำนวณเองในหน้านี้) */
|
||||
var dayLine = '';
|
||||
var dayText = '';
|
||||
if (window.Schedules && Schedules.dayInfo && Schedules.directions) {
|
||||
var di = Schedules.dayInfo();
|
||||
var infos = (Schedules.directions(res[2], rid) || []).map(function (d) { return d.service || { from: 'ไม่ระบุ' }; });
|
||||
@@ -288,17 +501,20 @@
|
||||
var unknown = infos.some(function (x) { return x.unknown; }); /* ยังไม่ระบุวันเลย */
|
||||
var selectedByDay = infos.some(function (x) { return x.from === 'service' || x.from === 'ระบุตรง' || x.from === 'คำในโน้ต'; });
|
||||
if (unknown) {
|
||||
dayLine = ' · ' + t('check.dayUnknown');
|
||||
dayText = t('check.dayUnknown');
|
||||
} else if (conflict) {
|
||||
dayLine = ' · ' + t('check.dayMixed');
|
||||
dayText = t('check.dayMixed');
|
||||
} else if (selectedByDay) {
|
||||
dayLine = ' · ' + t(di.dayType === 'holiday' ? 'check.dayHoliday' : 'check.dayWeekday') +
|
||||
dayText = t(di.dayType === 'holiday' ? 'check.dayHoliday' : 'check.dayWeekday') +
|
||||
' (' + t('check.dayOfWeek') + ' ' + di.weekday_th + ')';
|
||||
}
|
||||
}
|
||||
desc.textContent = 'สาย ' + rid + ' · ' +
|
||||
(names.length > 1 ? names[0] + ' \u2192 ' + names[names.length - 1] + ' · ' : '') +
|
||||
groups.length + ' ' + t('check.stopsCount') + dayLine;
|
||||
/* แยกเป็นชิ้น ๆ เพื่อให้ตัดบรรทัดได้เป็นหน่วย (ไม่ตัดกลางชื่อสถานี/ชื่อวัน) */
|
||||
var segs = ['สาย ' + rid];
|
||||
if (names.length > 1) segs.push(names[0] + ' \u2192 ' + names[names.length - 1]);
|
||||
segs.push(groups.length + ' ' + t('check.stopsCount'));
|
||||
if (dayText) segs.push(dayText);
|
||||
setSegments(desc, segs);
|
||||
}
|
||||
|
||||
/* KPI */
|
||||
|
||||
@@ -41,8 +41,10 @@
|
||||
<h2><span data-i18n="credits.fonts">ฟอนต์ — Google Fonts</span></h2>
|
||||
<p class="src">แหล่งที่มา: <a href="https://fonts.google.com" rel="noopener">fonts.google.com</a> · ใบอนุญาต: <a href="https://openfontlicense.org" rel="noopener">SIL Open Font License 1.1</a></p>
|
||||
<ul>
|
||||
<li><strong>Noto Sans Thai</strong> — ฟอนต์เนื้อหาหลัก (โหลดผ่าน Google Fonts CDN)</li>
|
||||
<li><strong>Prompt</strong> — ฟอนต์หัวเรื่อง/ตัวหนา</li>
|
||||
<li><strong>K2D</strong> — ฟอนต์หลักของเว็บ (เนื้อหา + หัวเรื่อง) · มีหัวแบบไทย น้ำหนัก 300–800</li>
|
||||
<li><strong>Noto Sans Thai</strong> — ตัวสำรองเนื้อหา (โหลดผ่าน Google Fonts CDN)</li>
|
||||
<li><strong>Prompt</strong> — ตัวสำรองหัวเรื่อง/ตัวหนา</li>
|
||||
<li><strong>IBM Plex Mono</strong> — เวลา · เลขสาย · ตัวเลข (เรียงตรงกัน)</li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
@@ -56,5 +58,19 @@
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<section class="mu-credit-section">
|
||||
<h2><span data-i18n="credits.photos">ขอขอบคุณภาพรถประจำทาง</span></h2>
|
||||
<p class="src">ภาพรถโดยสารประจำทางที่แสดงในหน้ารายละเอียดสาย มาจากแหล่งข้อมูลสาธารณะด้านล่างนี้ — ขอบคุณเจ้าของภาพและผู้รวบรวมทุกท่าน</p>
|
||||
<ul>
|
||||
<li><strong>สาย 2194</strong> หัวเวียง-อยุธยา — จาก <a href="http://www.bangkokbusclub.com/cms/showthread.php?t=4968" rel="noopener">bangkokbusclub.com</a></li>
|
||||
<li><strong>สาย 8</strong> กรุงเทพ-สรรคบุรี-ชัยนาท — จาก <a href="https://web.facebook.com/groups/431811197419587/posts/2006978336569524/" rel="noopener">กลุ่ม Facebook (web.facebook.com)</a></li>
|
||||
<li><strong>สาย 954</strong> กรุงเทพ-ท่าช้าง — จาก <a href="https://gogo.town/route/bangkok-rangsit-angthong-thachang/" rel="noopener">gogo.town</a></li>
|
||||
<li><strong>รถไฟฟ้าสายสีแดง </strong> กรุงเทพ-ชุมทางบ้านภาชี — จาก <a href="https://thelist.group/realist/blog/%E0%B8%A3%E0%B8%96%E0%B9%84%E0%B8%9F%E0%B8%9F%E0%B9%89%E0%B8%B2%E0%B8%AA%E0%B8%B2%E0%B8%A2%E0%B8%AA%E0%B8%B5%E0%B9%81%E0%B8%94%E0%B8%87/" rel="noopener">thelist.group</a></li>
|
||||
</ul>
|
||||
<p class="mu-license">
|
||||
<span data-i18n="credits.photosNote">และสายอื่น ๆ ที่ไม่ได้ระบุ ขอขอบคุณมา ณ ที่นี้</span>
|
||||
</p>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
</main>
|
||||
@@ -63,7 +63,7 @@
|
||||
<section class="mu-sponsor-marquee" aria-label="ผู้สนับสนุนและพาร์ทเนอร์">
|
||||
<div class="mu-sponsor-head">
|
||||
<h4 data-i18n="footer.sponsors">ผู้สนับสนุน & พาร์ทเนอร์</h4>
|
||||
<p class="lead" data-i18n="footer.sponsorsLead">จองตั๋ว · สั่งของ · เช็กของฝาก ที่ร้านค้าและบริการพันธมิตรของเรา</p>
|
||||
<p class="lead" data-i18n="footer.sponsorsLead">ร่วมเป็นผู้สนับสนุนเราได้ เมื่อซื้อของออนไลน์ หรือซื้อตั๋วรถทัวร์ เครื่องบิน ออนไลน์กดเลือกสินค้า หรือบริการผ่านลิงค์นายหน้าของเราไม่มีค่าใช้จ่ายเพิ่ม</p>
|
||||
</div>
|
||||
<div class="mu-marquee">
|
||||
<div class="mu-marquee-track">
|
||||
|
||||
+31
-22
@@ -7,7 +7,7 @@
|
||||
รองรับ schedules.json 2 รูปแบบ:
|
||||
schema 1 (เดิม): { "schedules": [ { route_id, station_id, direction_note, departure_times[], schedule_note } ] }
|
||||
schema 2 (ใหม่): { "schema": 2, "routes": [ { route_id, station_order[], directions: [
|
||||
{ dir_id, dir_label, service?, stops: [ { station_id, times[], dir_note?, note?, groups? } ] } ] } ] }
|
||||
{ direction_id, direction_label, service?, stops: [ { station_id, times[], direction_note?, note?, groups? } ] } ] } ] }
|
||||
|
||||
── เรื่องวันทำงาน / วันหยุด (ไม่ต้องแก้โค้ดหน้าไหนเลย) ────────────────
|
||||
เพิ่มฟิลด์ "ไม่บังคับ" 2 ระดับ:
|
||||
@@ -24,7 +24,7 @@
|
||||
API:
|
||||
Schedules.records(doc, opts) → record แบน (schema เดิม) สำหรับโค้ดเดิม
|
||||
Schedules.route(doc, routeId, opts) → { route_id, station_order[], directions[], entries[] }
|
||||
Schedules.directions(doc, routeId, opts) → [{ dir_id, dir_label, service, dayType, fallback, stops[] }]
|
||||
Schedules.directions(doc, routeId, opts) → [{ direction_id, direction_label, service, dayType, fallback, stops[] }]
|
||||
Schedules.times(doc, routeId, opts) → เวลาทั้งหมดของสาย (เรียงแล้ว)
|
||||
Schedules.countTrips(doc, routeId, opts) → จำนวนเที่ยวของสาย
|
||||
Schedules.todayType() → 'weekday' | 'holiday'
|
||||
@@ -118,13 +118,13 @@
|
||||
var from = (src.from_station_id != null) ? Number(src.from_station_id) : null;
|
||||
var stops = [];
|
||||
if (from != null && times.length) {
|
||||
stops.push({ station_id: from, times: times, dir_note: grp.label || null });
|
||||
stops.push({ station_id: from, times: times, direction_note: grp.label || null });
|
||||
} else if (from != null) {
|
||||
stops.push({ station_id: from, times: [], dir_note: grp.label || null });
|
||||
stops.push({ station_id: from, times: [], direction_note: grp.label || null });
|
||||
}
|
||||
out.push({
|
||||
dir_id: kind + ':' + name,
|
||||
dir_label: name,
|
||||
direction_id: kind + ':' + name,
|
||||
direction_label: name,
|
||||
service: { day: kind, from: 'schema 3', matches: kind === todayType() },
|
||||
station_order: doc.station_order || [],
|
||||
stops: stops,
|
||||
@@ -184,7 +184,7 @@
|
||||
ลำดับการตัดสิน:
|
||||
1) ถ้าทิศมี "days" ระบุตรง ๆ (อา จ อ พ พฤ ศ ส) → ใช้ตามนั้น (แม่นสุด)
|
||||
2) ถ้ามี service = weekday/holiday → เทียบกับวันนี้
|
||||
3) ถ้าไม่มีอะไรระบุ → อ่านคำใน dir_label / dir_note / note ของสายนั้น (ตรวจคำอัตโนมัติ)
|
||||
3) ถ้าไม่มีอะไรระบุ → อ่านคำใน direction_label / direction_note / note ของสายนั้น (ตรวจคำอัตโนมัติ)
|
||||
4) ตัดสินไม่ได้ → แสดงทุกวัน (ไม่ซ่อนข้อมูล) พร้อมป้ายว่า "ยังไม่ระบุวัน" */
|
||||
var DAYS = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat']; /* ตรงกับ Date.getDay() */
|
||||
var DAY_TH = { sun: 'อาทิตย์', mon: 'จันทร์', tue: 'อังคาร', wed: 'พุธ', thu: 'พฤหัสบดี', fri: 'ศุกร์', sat: 'เสาร์' };
|
||||
@@ -216,7 +216,7 @@
|
||||
return { dayType: t, weekday: DAYS[d.getDay()], weekday_th: DAY_TH[DAYS[d.getDay()]], date: ymd(d),
|
||||
label_th: t === 'holiday' ? 'วันหยุด (ส–อา/นักขัตฤกษ์)' : 'วันทำงาน (จ–ศ)' };
|
||||
}
|
||||
/* ตรวจคำในข้อความ (dir_label / dir_note / note) ว่าหมายถึงวันไหน */
|
||||
/* ตรวจคำในข้อความ (direction_label / direction_note / note) ว่าหมายถึงวันไหน */
|
||||
function detectDay(text) {
|
||||
var t = String(text == null ? '' : text).trim();
|
||||
if (!t) return null;
|
||||
@@ -231,9 +231,9 @@
|
||||
คืน { day, from, text } หรือ null (ยังไม่ระบุ) */
|
||||
function detectDayOfDir(d) {
|
||||
var texts = [];
|
||||
if (d && d.dir_label) texts.push(d.dir_label);
|
||||
if (d && (d.direction_label || d.dir_label)) texts.push((d.direction_label || d.dir_label));
|
||||
((d && d.stops) || []).forEach(function (s) {
|
||||
if (s.dir_note) texts.push(s.dir_note);
|
||||
if ((s.direction_note || s.dir_note)) texts.push((s.direction_note || s.dir_note));
|
||||
if (s.note) texts.push(s.note);
|
||||
});
|
||||
var verdicts = [], conflicts = false, hasHol = false, hasWk = false, sample = null;
|
||||
@@ -332,7 +332,8 @@
|
||||
if (!sub) return null;
|
||||
var dirs = isSchema3(sub) ? directionsFromSchema3(sub) : (sub.directions || []);
|
||||
SUBS[String(sub.route_id)] = { route_id: sub.route_id, station_order: sub.station_order || [],
|
||||
directions: dirs, schema3: isSchema3(sub) };
|
||||
directions: dirs, schema3: isSchema3(sub),
|
||||
updated: sub.updated || null };
|
||||
return SUBS[String(sub.route_id)];
|
||||
}).catch(function () { return null; });
|
||||
})).then(function (list) {
|
||||
@@ -344,7 +345,14 @@
|
||||
return subsReady;
|
||||
}
|
||||
/* โหลดสายเดียว (เร็ว — ใช้ตอนเปิดหน้า check/routes ของสายนั้น) */
|
||||
function loadRoute(rid) {
|
||||
/* วันที่อัปเดตไฟล์ตารางของสาย (ฟิลด์ "updated" ใน scheduleslist/schedules<id>.json)
|
||||
— ค่ามาจาก mtime ของไฟล์จริง (เติมโดย resource/tools/stamp-schedules.py) */
|
||||
function updatedOf(rid) {
|
||||
var s = SUBS[String(rid)];
|
||||
return (s && s.updated) ? String(s.updated) : null;
|
||||
}
|
||||
|
||||
function loadRoute(rid) {
|
||||
var key = String(rid);
|
||||
if (SUBS[key]) return Promise.resolve({ schema: 2, routes: [SUBS[key]] });
|
||||
if (!subsReady) return loadSubs().then(function () { return SUBS[key] ? { schema: 2, routes: [SUBS[key]] } : null; });
|
||||
@@ -416,8 +424,8 @@
|
||||
if (!r) return [];
|
||||
list = (r.directions || []).map(function (d) {
|
||||
return {
|
||||
dir_id: d.dir_id,
|
||||
dir_label: d.dir_label,
|
||||
direction_id: (d.direction_id || d.dir_id),
|
||||
direction_label: (d.direction_label || d.dir_label),
|
||||
days: Array.isArray(d.days) ? d.days.map(String) : null, /* ระบุวันตรง ๆ (อา จ อ พ พฤ ศ ส) */
|
||||
service: serviceOf(d, d), /* ตรวจวัน + เหตุผล (จากคำ/service/days) */
|
||||
autoTimes: !!d.autoTimes, /* true = คำนวณจุดที่ไม่มีตารางให้ */
|
||||
@@ -431,7 +439,7 @@
|
||||
station_id: s.station_id,
|
||||
times: s.times || [],
|
||||
km: (typeof s.km === 'number') ? s.km : null, /* กม. จากต้นทาง (วัดโดย resource/tools/stop-km.py) */
|
||||
dir_note: s.dir_note || null,
|
||||
direction_note: (s.direction_note || s.dir_note) || null,
|
||||
note: s.note || null,
|
||||
groups: s.groups || null,
|
||||
derive: s.derive || null /* กฎ "จุดนี้ = เวลาจุดอ้างอิง ± n นาที" */
|
||||
@@ -441,10 +449,10 @@
|
||||
});
|
||||
} else {
|
||||
/* schema 1 → ยังใช้ได้เหมือนเดิม (ไม่แยกวัน) */
|
||||
list = [{ dir_id: 'all', dir_label: null, service: 'all', stops: (doc && doc.schedules ? doc.schedules : []).filter(function (r) {
|
||||
list = [{ direction_id: 'all', direction_label: null, service: 'all', stops: (doc && doc.schedules ? doc.schedules : []).filter(function (r) {
|
||||
return String(r.route_id) === rid;
|
||||
}).map(function (r) {
|
||||
return { station_id: r.station_id, times: r.departure_times || [], dir_note: r.direction_note || null, note: r.schedule_note || null, groups: null };
|
||||
return { station_id: r.station_id, times: r.departure_times || [], direction_note: r.direction_note || null, note: r.schedule_note || null, groups: null };
|
||||
}) }];
|
||||
}
|
||||
|
||||
@@ -498,10 +506,10 @@
|
||||
if (calc && calc.length) { t = calc; est = true; }
|
||||
}
|
||||
}
|
||||
return { station_id: s.station_id, times: t, km: s.km, dir_note: s.dir_note, note: s.note,
|
||||
return { station_id: s.station_id, times: t, km: s.km, direction_note: (s.direction_note || s.dir_note), note: s.note,
|
||||
groups: s.groups, estimated: est, estimateFrom: estFrom, derive: s.derive || null };
|
||||
});
|
||||
return { dir_id: d.dir_id, dir_label: d.dir_label, service: d.service, days: d.days, autoTimes: d.autoTimes,
|
||||
return { direction_id: (d.direction_id || d.dir_id), direction_label: (d.direction_label || d.dir_label), service: d.service, days: d.days, autoTimes: d.autoTimes,
|
||||
travelMin: d.travelMin, baseEnd: d.baseEnd, baseSid: d.baseSid, autoFor: d.autoFor,
|
||||
speedKmh: Math.round(speed.kmh * 10) / 10,
|
||||
speedFrom: speed.source, dayType: day, fallback: fallback, stops: stops };
|
||||
@@ -519,14 +527,14 @@
|
||||
out.push({
|
||||
route_id: r.route_id,
|
||||
station_id: s.station_id,
|
||||
direction_note: s.dir_note || null,
|
||||
dir_label: d.dir_label || null, /* ชื่อทิศ (ป่าโมกไปอยุธยา ฯลฯ) — ใช้เป็นหัวแถว */
|
||||
direction_note: (s.direction_note || s.dir_note) || null,
|
||||
direction_label: (d.direction_label || d.dir_label) || null, /* ชื่อทิศ (ป่าโมกไปอยุธยา ฯลฯ) — ใช้เป็นหัวแถว */
|
||||
departure_times: s.times || [],
|
||||
schedule_note: s.note || null,
|
||||
estimated: !!s.estimated, /* true = เวลาคำนวณ ไม่ใช่ตารางจริง */
|
||||
estimateFrom: s.estimateFrom || null, /* { station_id, name, offsetMin } เมื่อคำนวณ */
|
||||
km: s.km,
|
||||
dir_id: d.dir_id,
|
||||
direction_id: (d.direction_id || d.dir_id),
|
||||
service: d.service,
|
||||
days: d.days,
|
||||
dayType: d.dayType,
|
||||
@@ -605,6 +613,7 @@
|
||||
serviceOf: serviceOf,
|
||||
timesFor: timesFor,
|
||||
computeTimes: computeTimes,
|
||||
updatedOf: updatedOf, /* วันที่อัปเดตไฟล์ตารางของสาย (ISO) — ใช้แสดง "อัปเดตล่าสุด ..." */
|
||||
speedOf: speedOf,
|
||||
absKm: absKm,
|
||||
relKms: relKms,
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
line-height: 1;
|
||||
color: #1f2a44;
|
||||
font-weight: 800;
|
||||
font-family: "Prompt", "Noto Sans Thai", sans-serif;
|
||||
font-family: "K2D", "Prompt", "Noto Sans Thai", sans-serif;
|
||||
}
|
||||
.mu-live-clock-note {
|
||||
margin: 0;
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
Schedules.directions(sched, r.route_id).forEach(function (d) {
|
||||
d.stops.forEach(function (s) {
|
||||
if (s.station_id !== sid) return;
|
||||
legs.push({ dir_id: d.dir_id, label: s.dir_note || d.dir_label || null, times: s.times || [], note: s.note || null, estimated: !!s.estimated, estimateFrom: s.estimateFrom || null });
|
||||
legs.push({ direction_id: (d.direction_id || d.dir_id), label: (s.direction_note || s.dir_note) || (d.direction_label || d.dir_label) || null, times: s.times || [], note: s.note || null, estimated: !!s.estimated, estimateFrom: s.estimateFrom || null });
|
||||
});
|
||||
});
|
||||
var trips = legs.reduce(function (n, l) { return n + l.times.length; }, 0);
|
||||
@@ -93,7 +93,10 @@
|
||||
if (station.photo) return station.photo; /* ระบุพาธเองได้ใน stations.json (ทับค่าเริ่มต้น) */
|
||||
var n = station.__seq || 1; /* รูปเสริมของสถานีเดียวกัน: 2-2.jpg, 2-3.jpeg … */
|
||||
var base = PHOTO_DIR + station.station_id + (n > 1 ? '-' + n : '');
|
||||
return PHOTO_EXTS.map(function (e) { return base + '.' + e; }); /* เรียง候选ให้ renderHero ไล่ลอง */
|
||||
return PHOTO_EXTS.map(function (e) { /* เรียงตัวเลือกให้ renderHero ไล่ลอง */
|
||||
var u = base + '.' + e;
|
||||
return (window.ImgURL && ImgURL.of) ? ImgURL.of(u) : u; /* ?v= กัน cache-first ของ SW */
|
||||
});
|
||||
}
|
||||
|
||||
/* ---------- ตัวเลขสรุป ---------- */
|
||||
|
||||
+21
-4
@@ -116,7 +116,18 @@ main.mu-container { padding-top: 24px; padding-bottom: 24px; }
|
||||
/* --- โซนเส้นทาง + การ์ด — ระยะห่างกระชับ --- */
|
||||
main.mu-container { padding-top: 14px; padding-bottom: 14px; }
|
||||
.mu-zone { margin-bottom: 20px; }
|
||||
.mu-zone-head { margin-bottom: 10px; gap: 10px; }
|
||||
.mu-zone-head { margin-bottom: 10px; gap: 4px 10px; }
|
||||
|
||||
/* --- หัวโซน: ป้ายหัวข้อ + บรรทัดข้อมูล (มือถือ = เรียงลงมาเต็มความกว้าง) ---
|
||||
ใช้ #view เพื่อชนะ <style> ของ partial ที่ inject ทีหลัง */
|
||||
#view .mu-zone-head .mu-zone-desc { flex-basis: 100%; min-width: 0; line-height: 1.65; }
|
||||
#view .mu-zone-meta { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; }
|
||||
#view .mu-zone-seg { display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
|
||||
#view .mu-zone-seg:not(:last-child)::after { content: "\00b7"; color: #c4bcd8; margin-left: 8px; } /* คั่นท้ายชิ้น → ตัดบรรทัดแล้วจุดไม่ไปอยู่ต้นบรรทัด */
|
||||
#view .mu-zone-seg .ic { align-self: center; flex: none; }
|
||||
#view .mu-zone-now b { color: #1f2a44; font-variant-numeric: tabular-nums; }
|
||||
#view .mu-zone-at { color: #8a93a8; } /* ชื่อสถานีในวงเล็บ — จางกว่ารอบรถ */
|
||||
#view .mu-zone-updated { color: #8a7aa8; font-size: .95rem; }
|
||||
.mu-grid { gap: 12px; }
|
||||
.mu-route-info { padding: 16px 16px 18px; }
|
||||
.mu-route-name { margin-bottom: 6px; }
|
||||
@@ -163,9 +174,9 @@ main.mu-container { padding-top: 14px; padding-bottom: 14px; }
|
||||
/* --- footer --- */
|
||||
.mu-site-footer { margin-top: 24px; padding: 28px 0 0; }
|
||||
.mu-site-footer .mu-container { padding: 0 16px; }
|
||||
.mu-footer-grid { grid-template-columns: 1fr; gap: 20px; }
|
||||
.mu-footer-col ul a { padding: 10px 0; min-height: 44px; } /* tap target */
|
||||
.mu-footer-contact a { min-height: 44px; } /* tap target */
|
||||
.mu-footer-grid { grid-template-columns: 1fr; gap: 16px; }
|
||||
.mu-footer-col ul a { padding: 5px 0; min-height: 34px; } /* tap target (กดได้ ≥34px) */
|
||||
.mu-footer-contact a { min-height: 34px; } /* tap target */
|
||||
.mu-sponsor-strip { grid-template-columns: repeat(2, 1fr); gap: 8px; }
|
||||
|
||||
/* ============================================================
|
||||
@@ -220,6 +231,12 @@ main.mu-container { padding-top: 14px; padding-bottom: 14px; }
|
||||
#view .mu-hero-panel { grid-template-columns: 1.1fr .9fr; padding: 18px; }
|
||||
.mu-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1.1fr; }
|
||||
.mu-sponsor-strip { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
|
||||
|
||||
/* หัวโซนบนจอใหญ่: ป้ายหัวข้ออยู่ซ้าย · บรรทัดข้อมูลเป็นคอลัมน์ขวา
|
||||
(อ่านง่ายกว่าเดิมที่ข้อความยืดเต็มความกว้างจอ ~1144px) */
|
||||
#view .mu-zone-head { display: grid; grid-template-columns: auto minmax(0, 1fr);
|
||||
align-items: start; column-gap: 14px; row-gap: 5px; }
|
||||
#view .mu-zone-head .mu-zone-desc { grid-column: 2; max-width: 82ch; }
|
||||
}
|
||||
|
||||
/* ============================================================
|
||||
|
||||
+4
-4
@@ -6,7 +6,6 @@
|
||||
- #/stops → ป้ายหยุดรถ (partials/busStop.html)
|
||||
- #/routes → รายละเอียดสาย (partials/busDetail.html)
|
||||
- #/routes/:id → สายเดียวกัน + ระบุ routeId
|
||||
- #/routes/expanded → ตารางขยาย (partials/busDetailExpanded.html)
|
||||
- #/stops/:code → รายละเอียดป้าย (partials/stopDetail.html)
|
||||
- #/credits → เครดิต (partials/credits.html)
|
||||
|
||||
@@ -21,7 +20,6 @@
|
||||
home: { partial: 'partials/home.html', nav: '/', title: 'หน้าแรก' },
|
||||
stops: { partial: 'partials/busStop.html', nav: '/stops', title: 'ป้ายหยุดรถ' },
|
||||
routes: { partial: 'partials/busDetail.html', nav: '/routes', title: 'รายละเอียดสายรถ' },
|
||||
expanded: { partial: 'partials/busDetailExpanded.html', nav: '/routes/expanded', title: 'ตารางขยาย' },
|
||||
check: { partial: 'partials/checkSchedule.html', nav: '/check', title: 'เช็กเวลาเดินรถ' },
|
||||
stop: { partial: 'partials/stopDetail.html', nav: '/stops/', title: 'รายละเอียดป้าย' },
|
||||
credits: { partial: 'partials/credits.html', nav: '/credits', title: 'เครดิต' },
|
||||
@@ -42,7 +40,6 @@
|
||||
|
||||
var seg = path.split('/').filter(Boolean);
|
||||
if (seg[0] === 'routes') {
|
||||
if (seg[1] === 'expanded') return { name: 'expanded', params: {}, query: query };
|
||||
if (seg[1]) return { name: 'routes', params: { routeId: decodeURIComponent(seg[1]) }, query: query };
|
||||
return { name: 'routes', params: {}, query: query };
|
||||
}
|
||||
@@ -135,5 +132,8 @@
|
||||
render();
|
||||
});
|
||||
|
||||
render();
|
||||
/* รอไฟล์คำแปลโหลดเสร็จก่อนวาดหน้าแรก — ไม่งั้นข้อความที่ JS สร้างจะได้แค่ key
|
||||
(ข้ามไปเลยถ้าไม่มี I18N หรือเบราว์เซอร์เก่าที่ไม่รองรับ Promise) */
|
||||
if (window.I18N && window.I18N.ready) window.I18N.ready.then(render);
|
||||
else render();
|
||||
})();
|
||||
@@ -17,7 +17,8 @@
|
||||
<link rel="stylesheet" href="../map.css">
|
||||
<link rel="icon" href="../../.image/icons/minibus-512x512.png">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css2?family=Prompt:wght@400;500;600;700;800&family=Noto+Sans+Thai:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600;700&display=swap" rel="stylesheet">
|
||||
<link href="../vendor/fonts/k2d.css" rel="stylesheet">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Prompt:wght@400;500;600;700&family=Noto+Sans+Thai:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600;700&display=swap" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
/* ============================================================
|
||||
@@ -49,8 +50,8 @@
|
||||
--radius-sm: 4px;
|
||||
--line-w: 1px;
|
||||
/* ฟอนต์ */
|
||||
--font-display: "Prompt", "Noto Sans Thai", sans-serif;
|
||||
--font-body: "Noto Sans Thai", "Sarabun", sans-serif;
|
||||
--font-display: "K2D", "Prompt", "Noto Sans Thai", sans-serif;
|
||||
--font-body: "K2D", "Noto Sans Thai", "Sarabun", sans-serif;
|
||||
--font-mono: "IBM Plex Mono", ui-monospace, monospace;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
- ขั้นตอนอัปเดต: ดู AGENTS.md หัวข้อ PWA
|
||||
============================================================ */
|
||||
|
||||
const VERSION = "2026.09.27.15"; // ← bump ทุกครั้งที่แก้ SW เอง
|
||||
const VERSION = "2026.09.27.74"; // ← bump ทุกครั้งที่แก้ SW เอง
|
||||
const CACHE = `at-transit-${VERSION}`;
|
||||
|
||||
const PRECACHE = [
|
||||
@@ -21,11 +21,13 @@ const PRECACHE = [
|
||||
"./offline.html",
|
||||
"./busStop.html",
|
||||
"./busDetail.html",
|
||||
"./busDetailExpanded.html",
|
||||
"./stopDetail.html",
|
||||
"./credits.html",
|
||||
"./_shared.css",
|
||||
"./responsive.css",
|
||||
"./imageurl.js",
|
||||
"./locales/th.json",
|
||||
"./locales/en.json",
|
||||
"./pwa.js",
|
||||
"./i18n.js",
|
||||
"./router.js",
|
||||
@@ -35,7 +37,6 @@ const PRECACHE = [
|
||||
"./partials/busStop.init.js",
|
||||
"./partials/busStop.search.js",
|
||||
"./partials/busDetail.html",
|
||||
"./partials/busDetailExpanded.html",
|
||||
"./partials/checkSchedule.html",
|
||||
"./partials/stopDetail.html",
|
||||
"./partials/stopDetail.init.js",
|
||||
@@ -48,7 +49,27 @@ const PRECACHE = [
|
||||
"./partials/checkSchedule.init.js",
|
||||
"./partials/schedules.js",
|
||||
"../resource/data/holidays.json",
|
||||
"../resource/data/8 other_stop.json",
|
||||
"./partials/otherStop.js",
|
||||
"./vendor/fonts/k2d.css",
|
||||
"./vendor/fonts/k2d-300-latin-ext.woff2",
|
||||
"./vendor/fonts/k2d-300-latin.woff2",
|
||||
"./vendor/fonts/k2d-300-thai.woff2",
|
||||
"./vendor/fonts/k2d-400-latin-ext.woff2",
|
||||
"./vendor/fonts/k2d-400-latin.woff2",
|
||||
"./vendor/fonts/k2d-400-thai.woff2",
|
||||
"./vendor/fonts/k2d-500-latin-ext.woff2",
|
||||
"./vendor/fonts/k2d-500-latin.woff2",
|
||||
"./vendor/fonts/k2d-500-thai.woff2",
|
||||
"./vendor/fonts/k2d-600-latin-ext.woff2",
|
||||
"./vendor/fonts/k2d-600-latin.woff2",
|
||||
"./vendor/fonts/k2d-600-thai.woff2",
|
||||
"./vendor/fonts/k2d-700-latin-ext.woff2",
|
||||
"./vendor/fonts/k2d-700-latin.woff2",
|
||||
"./vendor/fonts/k2d-700-thai.woff2",
|
||||
"./vendor/fonts/k2d-800-latin-ext.woff2",
|
||||
"./vendor/fonts/k2d-800-latin.woff2",
|
||||
"./vendor/fonts/k2d-800-thai.woff2",
|
||||
"./vendor/leaflet/leaflet.js",
|
||||
"./vendor/leaflet/leaflet.css",
|
||||
"./map.js",
|
||||
|
||||
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
BIN
Binary file not shown.
Loaded 100 of 109 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user