# TrailPaint 路小繪

> Hand-drawn style trail map maker. Build routes from photos, maps, or AI prompts, then export as PNG illustration, complete project backup, or GeoJSON / KML interop formats. Free, open-source (GPL-3.0), no account, no backend.

Language: zh-TW / en / ja (auto-detected)
Version: 1.8.4
License: GPL-3.0
Source: https://github.com/notoriouslab/trailpaint
Try it: https://trailpaint.org/app/
Stories: https://trailpaint.org/stories/
Player: https://trailpaint.org/app/player/
Church landing: https://trailpaint.org/church/

## 這是什麼 / What is TrailPaint

TrailPaint 是一個純瀏覽器端的手繪風路線地圖工具，適合登山、單車、旅遊部落客、生態導覽、教育單位、教會 NGO 等使用。所有資料存在瀏覽器本地，不上傳伺服器；支援 PWA 可安裝到手機主畫面像原生 App。

TrailPaint is a browser-only hand-drawn style trail map maker, designed for hikers, cyclists, travel bloggers, ecology guides, educators, and churches/NGOs. All data is stored locally in the browser; PWA-installable on phones, tablets, and desktops.

## 網站導覽 / Site Sections

- **首頁 /**：當季特展（目前是「大安森林公園」定點時間軸）、每日一選（從歷史故事與旅行路線依日期輪替）、出門走走入口，下方是「走進歷史」與「出門走走」兩排作品。Homepage: a featured story, a daily pick, and two rows of finished maps (history and travel).
- **故事地圖 /stories/**：聖經、宣教、中國歷史、大航海等互動故事。Curated story maps.
- **台灣百年 /taiwan/**：同一個地方的一百年，疊上 1904 年臺灣堡圖到今天的歷史地圖（大安區百年、大安森林公園）。Taiwan Century: one place across a hundred years on historical maps.
- **出門走走 /examples/**：登山步道、古道、親子散步與海外旅行路線，可播放或下載 `.trailpaint.json`。Hiking and travel routes, playable or downloadable.
- **功能 /features/**、**FAQ /faq/**、**教會應用 /church/**、**編輯器 /app/**。

## 三種建立路線的方式 / Three Ways to Build a Trail

1. **從照片建立**：拖 20 張照片 → EXIF GPS 自動建景點。支援 iPhone HEIC、Android JPEG。無 GPS 照片歸入「待定位」分組。Photon（主）/ Nominatim（備援）反向地理編碼自動補地名。
   _From Photos: drag up to 20 photos; EXIF GPS auto-creates spots. iPhone HEIC and Android JPEG supported._

2. **在地圖上手動建**：搜尋地點、畫路線、放景點卡片。3 步引導教學 + 8 條範例路線試玩。
   _Manually on the Map: search locations, draw routes, place spot cards. 3-step tutorial, 8 sample trails._

3. **用 AI 生成**：複製內建提示詞給 ChatGPT / Claude，描述行程 → 產可匯入的 JSON。
   _Generated by AI: copy prompt template to ChatGPT / Claude; describe your trip; get importable JSON._

## 匯入格式 / Import Formats

- `.trailpaint` project file (native)
- Photo EXIF (JPEG, HEIC with GPS)
- KML (Google My Maps, geojson.io)
- GeoJSON (Google Takeout, Mapbox, D3)
- GPX (hiking apps, Garmin)
- Screenshot basemap (drag any image)

## 輸出格式 / Output Formats (unified ExportWizard)

Three tabs for three use cases:

### Image tab
- PNG at multiple ratios: 1:1 (IG feed), 9:16 (Story), 4:3, original
- 3 border styles: Classic double, Paper sketch, Minimal thin
- 2 style filters: Original, Sketch
- Share link via Cloudflare Workers + KV short URL (TTL 180 days sliding, Open Graph cover from first photo)
- AI prompts in 4 styles: Japanese hand-drawn, Treasure map, Kawaii cartoon, Minimal line art
- Player embed code (`<iframe>` with project data baked in; compilation embed uses lightweight URL ref instead of inline data, v1.4)
- Electronic postcard (1080×1080 IG square with map + spot card + era stamp, v1.4)

### Backup tab
- `.trailpaint` project file (preserves all spots, routes, photos)
- Import `.trailpaint` bridge to ImportWizard

### Interop tab
- GeoJSON (for geojson.io, Mapbox, D3 visualizations)
- KML (for Google My Maps, Google Earth, Gaia GPS)
- Pure geographic structure, no photos (open data boundary)

## Story Player (/app/player/)

Standalone entry for auto-guided playback:
- fly-to animation through each spot (1.8s settle delay so user sees the new map before popup covers it, v1.4)
- popup shows photo and description
- playback interval 2s/4s/6s/8s, loop 1×/2×/3×/∞
- 5 basemaps + 16 historical overlays: Academia Sinica CCTS Han BC 7 / Three Kingdoms 262 / Tang 741 / Song 1208 / Yuan 1330 / Ming 1582 / Qing 1820; Taiwan jm200k 1897 / 1904 / jm20k 1921 / 1945 / 1955 / Corona 1966 / 1989 / 1993; DARE Roman Empire AD 200
- background music via direct MP3/M4A URL
- fullscreen mode for exhibits, classroom, events
- one-click embed code for blogs, church sites, Notion
- URL params: `?src=/stories/foo/bar.trailpaint.json` (single segment) · `?compilation=silk-road-2000` (multi-segment compilation, v1.4)

## Story Page (/stories/)

Curated collections:
- **Taiwan Missionaries' Footprints** (1865–2024): George Mackay, Thomas Barclay, David Landsborough, James L. Maxwell, Doris Brougham across Tamsui, Tainan, Changhua, Hualien, Taipei
- **Passion Week** (ca. AD 30): Jesus' final week in Jerusalem from Triumphal Entry to Resurrection and Ascension
- **Paul's Three Missionary Journeys** (AD 46–62): three Mediterranean crossings + journey to Rome, 34 spots along Acts 13–28
- **Jesus' Galilean Ministry** (AD 27–30): early teaching + Transfiguration road, 16 spots
- **Silk Road raw segments**: Zhang Qian first/second mission BC 138/119; Xuanzang's westward & return journey AD 629/643; Marco Polo's east journey & west return AD 1271/1291
- **Wen Tianxiang** (AD 1275–1283): Southern Song's last stand + Yuan captivity
- **Xu Xiake's Southwest Journey** (AD 1636–1640): final four-year exploration through Yunnan, Guizhou, Guangxi

## v1.4 Era Slider, Compilations, Postcards, Church Landing (2026-05)

Pushes TrailPaint from "static hand-drawn map" to "spatio-temporal storytelling". Designed for church Sunday school / weekly bulletins / personal devotion, but applies equally to history teaching and cultural routes.

### Era Slider (TimeSlider)

Horizontal pill at the top of the map, oldest left → modern right. Drags cross-fade the historical overlay tile layer; spots whose `era` window doesn't overlap the current year fade to 0.15 opacity (route shape preserved, only contemporary spots stay vivid).

Two scale groups toggle:
- 🗺️ Historical maps (default): 10 ticks aligned with the 9 overlays + modern
- 📖 Biblical narrative: Exodus BC 1446 / King David BC 1000 / Babylonian Exile BC 586 / Jesus AD 30 / Paul AD 50 / Revelation AD 95

Slider auto-filters overlays whose geographic bounds intersect the current spots. A London route shows only "modern + Roman AD 200"; a Taiwan hike shows only the three Taiwan overlays.

### Compilation (multi-story bundles)

`catalog.compilations[]` schema groups multiple story segments into one Player session. URL: `/app/player/?compilation=<id>`.

Two playback modes:
- `sequential` — preserves segment order (e.g., Paul's first → second → Rome)
- `chronological` — sorts spots by `era.start` globally (Zhang Qian BC 138 → Xuanzang AD 629 → Marco Polo AD 1271, mixed across human authors)

Partial-fail tolerant: one failed segment doesn't block the others.

Three default compilations:
- `paul-three-journeys` — 34 spots, AD 46–62, sequential
- `four-gospels-map` — 33 spots, AD 27–30, sequential (Galilean ministry + Transfiguration + Passion Week)
- `silk-road-2000` — 59 spots, BC 138–AD 1295, chronological (cross-author Silk Road dialogue)

### Electronic Postcard (1080×1080 IG square)

Click 📮 on any spot → downloads a PNG postcard with three sections:
- Top half: current map view (auto-zoomed to 10 for low-res overlays / 12 for hi-res Taiwan jm series, capped against overlay's native zoom pyramid so historical tiles stay sharp)
- Middle: spot card (280×280 photo + title + scripture ref + description + project name in italic bottom-right)
- Bottom: era stamp (公元 X 年 / AD X / 西暦 X 年 in three locales) + "via TrailPaint · trailpaint.org" watermark

Smart fallback: if the spot sits outside the active overlay's geographic bounds, the postcard renders against the modern basemap instead (no Taiwan historical map floating over London).

### Church Landing Page (/church/)

Vertical landing for church usage with three iframe-embedded use cases:
- Sunday school: embed Four Gospels Map
- Weekly bulletin: embed Paul's Three Journeys
- Personal devotion: embed Silk Road 2000

Embed code is one-click copy from Player ⚙ menu — paste into WordPress / Wix / Google Slides.

### Spot Era Schema (v5)

`Spot.era?: { start: number; end: number }` — calendar years, BC negative, AD positive, range [-3000, 3000]. Drives postcard era stamp + TimeSlider opacity fade. 17 historical segments / 150 spots already tagged: Paul × 3, Galilean ministry × 2, Passion Week × 3, Zhang Qian × 2, Xuanzang × 2, Marco Polo × 2, Wen Tianxiang × 2, Xu Xiake × 1. Modern stories (Taiwan hikes, 19th-century missionaries) stay era-agnostic intentionally — their spots remain visible at any TimeSlider position.

## v1.8.4 Story Pages You Can Read (2026-11)

Every story page now lists its spots below the map: name, year, photo with credit, full description, sources and scripture references, each with a link that opens the spot on the map above. The same content is available as Markdown (add `index.md` to a story URL) and as `ItemList` structured data with coordinates. 每個故事頁在地圖下方列出全部景點（名稱、年份、照片與授權、說明、出處與經文），可點「在地圖上看」跳到該景點；同一份內容另有 Markdown 版（故事網址加 `index.md`）與帶座標的結構化資料。The `/stories/` page links to every story without JavaScript, help pages have Markdown mirrors, and the Story Player URL parameter reference was corrected against the code.

## v1.8.3 Lighter Stories and Spot Links (2026-10)

Bundled stories now keep their photos as separate image files instead of inline base64, so all story files together shrink from 78 MB to about 0.6 MB and a story opens on a phone without downloading every photo first; the Player loads a photo when its popup opens and fetches the next one during playback. A new 🔗 button shares a link to the current spot at the current year, on the story page or in the Player (`?spot=` and `?year=`). Photos can now also come from named contributors under CC BY 4.0.

## v1.8.2 Gongguan to Jingmei (2026-10)

[Gongguan to Jingmei: Two Centuries of Canals](https://trailpaint.org/taiwan/taipei-gongguan-jingmei/), 29 places along the Liugong and Wulixue canals from 1724 to today, following an eco-tour course route. Early years before the decade grid fold into one lead tick ("1724–1876"); each tick shows the latest street-scale map drawn within its span; during playback the clock shows each place's own year. Taiwan century stories now come from one shared generator, and a story check script guards sources, Traditional Chinese copy and listings.

## v1.8.1 Da'an District Enrichment (2026-10)

[Da'an District, a Century](https://trailpaint.org/taiwan/taipei-daan/) grows from 24 to 33 places and now starts in 1762: the Liugong Canal, the Toad Mountain agricultural station, the Qingtian Street professors' houses, the Huanmin military village, Wistaria Tea House, Yin Hai-kuang's residence, the Horikawa drain under today's Xinsheng South Road, the rise of the East District and Fuyang Eco Park. When the earliest year would coarsen the whole slider it gets a tick of its own, and the first ticks show the 1904 map rather than an empire-wide one. Spot photos can now credit the maintainer's own photos or public-domain archive photos (Copyright Act §34) besides Wikimedia Commons.

## v1.8 Site Timeline (2026-10)

A new player layout for one place across eras. The map stays on the place (no fly-to, no popups); dragging the era slider or pressing play lists, in a side panel (below the map on phones), every phase that existed in that year, with full text, sources and photos. Playback steps through the years where a phase appears or disappears. First story: [Da'an Forest Park](https://trailpaint.org/taiwan/taipei-daan-park/) — one Taipei block from the 1904 rice fields and Chaizhuwei hamlet, the 1932 "Park No. 7" plan, military villages and the International House, to the forest park opened in 1994. Only phases with a quoted source are included.

## v1.7 Cumulative Timeline + Taiwan Historical Maps (2026-10)

The era slider gains a cumulative mode: at any year it shows only places that already existed (not yet built or already demolished = hidden), with tick spacing chosen from the story's own event span and playback stopping at each event year. Five Academia Sinica Taiwan maps join the overlays (1904 colonial map, 1945 US Army city plans, 1955, 1989 and 1993 topographic maps); in cumulative mode the basemap switches to the latest map not later than the slider year, and maps with no coverage at the story's location are skipped. First story: [Da'an District, a Century](https://trailpaint.org/taiwan/taipei-daan/) — 24 public facilities in Taipei's Da'an District, 1904 to today, each with its opening year at the current site and sources.

## v1.5–v1.6.5 Editor IA Redesign, Basemap Refresh, Route Hiding (2026-08)

### Editor IA redesign (v1.5)

Cold-start screen with three action cards (Import Photos / Paste AI JSON / Start on the Map). Desktop gets a Photoshop-style tool dock (top action bar, left tools, collapsible list column, right properties panel); mobile is mode-less — tap the map to add a spot. Photos sort chronologically by EXIF capture time; "connect spots" builds one route per capture day.

### Basemap refresh (v1.6)

Default basemap is now Protomaps vector (labels follow UI language: zh-Hant / en / ja, retina-sharp). Lineup: Protomaps Standard / OSM Trails (best mountain-trail detail) / OpenTopoMap / Esri Satellite / Protomaps Dark. Historical-overlay opacity slider now renders inline right under the selected overlay.

### Route hiding (v1.6.5, community contribution)

Routes can be hidden individually from the route list; spots bound to a hidden route hide with it. WYSIWYG: hidden state carries through Player playback, PNG export stats, and GeoJSON export. Single-photo days form a route too (exported as GeoJSON Point per RFC 7946). Hidden state round-trips through share links.

## Who It's For

- Hikers / trekking: route planning, GPX import, elevation profile
- Cyclists: route marking, distance stats
- Travel bloggers: Instagram / Story share card export
- Ecology guides: spot markers, info cards, photos
- Educators: environmental education, course materials, historical maps
- Churches / NGOs: missionary footprints, service route stories

## Privacy and Data

- **Zero backend**: all project data stored in browser localStorage, never uploaded
- **Zero account**: no signup required
- External calls only: map tiles (Protomaps / OSM / OpenTopoMap / Esri), Photon (primary) / Nominatim (fallback) reverse geocoding, Open-Meteo elevation, Cloudflare Workers share-link backend (user-triggered)

## Tech Stack

- Framework: Vite + React 19 + TypeScript 5 (strict)
- Map: Leaflet + react-leaflet + protomaps-leaflet
- State: Zustand + zundo (temporal undo/redo)
- PWA: vite-plugin-pwa + Workbox (active update prompt)
- Import: exifr (EXIF GPS incl. HEIC), @tmcw/togeojson (KML), custom GeoJSON parser
- Export: html-to-image + Canvas post-processing + style filters
- Multi-page build: Editor at /app/, Player at /app/player/
- Story Page: static HTML + vanilla JS (native SEO/OG)

## License

GPL-3.0 — free to use, modify, remix. Derivative works must remain GPL-3.0 open source.

## Author

NotoriousLab — https://github.com/notoriouslab/trailpaint
