Trail Cache, Faster Maps, and a New Homepage
Big batch of updates this week. OpenRoutes now has local trail data, a redesigned homepage, and a proper about page. Here's what changed.
Local Trail Cache with Spatial Index
The browse map used to hit the Overpass API live every time you panned or zoomed β slow, unreliable, and rate-limited. That's gone now.
OpenRoutes fetches IMBA rated trail data from OpenStreetMap and stores it in a local SQLite database with an R-tree spatial index. Trail queries that used to take seconds (or time out entirely) now return quickly from the local cache. The fetch script handles retries with exponential backoff, skips recently-fetched states, and works within Overpass rate limits so it plays nice with the public mirror.
No more spinner waiting on a third-party API just to see trails on the map.
Map Performance Fixes
A round of fixes to both the browse map and activity detail map:
- No more layer thrashing. The IMBA trail layer was being destroyed and recreated on every pan and zoom. Now it updates in-place and only builds layers on first load.
- Event handler leak fixed. Activity click/hover handlers were stacking up on every filter change. Now they register once.
- Parallel data loading. Activities and trail data load concurrently instead of sequentially β faster initial render.
- Bounds caching. Track bounds are computed once and cached instead of iterating the full point array three separate times.
- XSS fix. Trail names in map popups are now properly escaped.
- Shared map utilities. Duplicated IMBA color styles and layer helpers are extracted into a shared
map-utils.jsmodule used by both map components.
New Homepage
The homepage got a refresh. Instead of jumping straight to the map, there's now a compact intro section with the project name, a subtitle, and feature chips highlighting what OpenRoutes does. On mobile, the intro stays minimal so you get to the map fast.
The map itself gained a few features:
- Fullscreen mode
- Geolocation
- Compass heading arrow
About Page
OpenRoutes now has an about page at openroutes.co/about. It covers what the platform does, highlights key features, and uses plain language β "upload from your Garmin or Wahoo" instead of "supports GPX and FIT file formats."
The footer got a redesign to multi-column layout with links to the blog, about page, and browse map.
Under the Hood
- Migrated from
venv/pipto uv for dependency management. Faster installs, proper lockfile, cleaner Docker builds. - Moved datetime stripping into the GPX parser so callers get clean JSON-safe data without mutation side effects.
- Trimmed the Dockerfile (removed unused
libpq-dev) and the entrypoint (removed unnecessary sleep). - Trail cache lives on a Docker volume now for persistence across deploys.
That's the update. More coming soon.