Skip to content
fewmetPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Trailhead

A trail discovery and navigation app for you and your friends. Runs as a web app you add to the iPhone home screen — no App Store, no developer account, no subscriptions, no ads. Free forever because everything it uses is free.

Putting it online (about 10 minutes, once)

You need it on the internet over HTTPS, because GPS and offline maps only work on a secure site. GitHub Pages is free with no limits that matter here.

  1. Make a free account at github.com if you don't have one.
  2. Click + (top right) → New repository. Name it trailhead. Set it to Public. Click Create repository.
  3. On the next page click uploading an existing file.
  4. Unzip trailhead.zip on your computer, then drag everything inside the folder into the browser — all the files plus the lib and icons folders. Click Commit changes.
  5. Go to Settings → Pages (left sidebar). Under "Branch" pick main / / (root) and click Save.
  6. Wait about a minute, then reload that page. It shows your URL: https://YOURNAME.github.io/trailhead/

That link is the app. Text it to your friends.

Installing on each iPhone

Open the link in Safari (not Chrome — Chrome on iOS can't install web apps), tap the share button at the bottom, scroll down, tap Add to Home Screen, tap Add.

It now behaves like a normal app: own icon, full screen, no browser bars. The first time you tap the location button, allow location — choose Allow While Using App.

Before a hike

Open the trail, tap Offline map, pick a detail level, and let it download on Wi-Fi. Do this at home. GPS works with no signal, so once the map is downloaded, the whole app works in a canyon with zero bars — finding yourself, following the route, off-route alerts, and recording.

What it does

Finding trails — Search a city, park, or place name, or pan the map and tap "Find trails in this area". Filter by activity (hiking, running, biking), difficulty, and max length. Trails come from OpenStreetMap, which covers California well.

Trail pages — Length, elevation gain, high point, estimated time (Naismith's rule, the standard hiking-time formula), loop vs. point-to-point, an elevation profile, surface, dog rules, wheelchair access, operator. Plus current weather at the middle of the route with a 3-day outlook, and warnings for snow depth, mud after heavy rain, fresh snowfall, extreme heat, and freezing temperatures.

Navigation — Tap Start navigation. Your position shows against the route, with distance and percentage remaining. Stray more than 55 m off the line for three GPS fixes in a row and it goes red, beeps three times, and tells you. It beeps again every 45 seconds until you're back, and tells you when you are.

Recording — Tracks distance, elapsed and moving time, elevation gain, and pace. Junk GPS fixes (worse than 40 m accuracy) and sub-4 m jitter are discarded so your distances aren't inflated. Saved on your phone.

Sharing — Two ways. "Send a link to friends" makes a link that opens the route directly in their Trailhead. "Export GPX" gives a standard GPX file for Garmin Connect, a GPS watch, Gaia, or Strava.

Saving and lists — Save trails, group them into lists you name ("Weekend trips", "Best viewpoints").

Printable maps — A one-page route card with the shape of the route, stats, and trailhead coordinates. A paper backup for when the battery dies.

Map styles — Four built-in looks: Trail (a warm paper topo), Dusk (dark, easy on the eyes at night), Sierra (high contrast for bright sun), and Paper (near-monochrome, prints well). Plus OpenTopoMap and satellite if you want them. Tap the layers button on the right.

Terrain — Shaded relief makes ridges and valleys readable at a glance. Contour lines are generated on your phone from elevation data, so they work offline and you can set the spacing. And 3D terrain tilts the map so you can see the actual shape of a climb before you do it.

Every colour is yours to change — Layers button, then Customise. Land, forest, rock, water, trails, fire roads, contours, hill shadow, labels, summits, your route, your recording, your position dot — each one has a colour picker, and the map redraws as you drag. There are also sliders for how thick trails are drawn, how strong the shading is, and how big labels get, plus switches for buildings and points of interest. Everything is saved on your phone. Export gives you the palette as text you can send to a friend, and Import applies one they send you.

Honest limitations

These come from Apple's rules for web apps, not from how this is built. A native app on the App Store would fix the first two, but that means a Mac, Xcode, and $99 a year.

  • Recording pauses if you leave the app. iOS cuts GPS to web apps when the screen locks or you switch apps. The app keeps your screen awake while recording or navigating, but if you lock the phone and put it in your pocket, the track stops until you open it again. Keep it open, screen on, brightness low.
  • No vibration alerts. iOS Safari can't vibrate. Off-route alerts are a beep plus the red banner, so keep the volume up or don't pocket the phone during navigation.
  • No user reviews or photos. Those need a server with accounts and moderation, which can't be free. Trail descriptions and tags come from OpenStreetMap instead. If you want reviews within your group, that's the natural next thing to add.
  • No flythrough previews. 3D terrain is there, but an automatic cinematic flythrough of a route isn't.
  • Trail coverage depends on OpenStreetMap. Well-mapped near cities and popular parks, patchier in remote areas. Anything unnamed is skipped, since a list of a thousand nameless path fragments is useless. If a trail you know is missing, anyone can add it at openstreetmap.org and it shows up here within a day or so.
  • Please keep offline downloads small. The map tiles come from volunteer-run community servers. Download the area around your trail, not a whole county.

Files you can edit

You don't need to touch any of this, but it's all plain text if you want to.

  • theme.js — the four map palettes, at the very top of the file. Every colour on the map is one line here. Change one, reload, done. Everything the app knows about map appearance is in this one file.
  • index.html — the first block of CSS is the app's own appearance: fonts, sizes, corner radii, button size, and the light and dark interface colours.
  • icons/*.svg — the five buttons (filter, layers, terrain, locate, search-here) and the map pin. Open them in any editor, or replace them with your own SVGs at the same filenames. They're drawn as masks, so whatever colour the app is using shows through — you're editing the shape, not the colour.
  • icons/app-icon.svg — the home screen icon. Edit it, then run node make-icons.js to regenerate the three PNG sizes. Or just replace icon-180.png, icon-192.png and icon-512.png directly with your own.

Updating it later

Edit the file on GitHub (or upload a new copy) and everyone gets the new version next time they open the app while online. Nobody reinstalls anything.

Credits

Vector map tiles from OpenFreeMap, built on OpenMapTiles. Trail and map data © OpenStreetMap contributors (ODbL). Terrain and elevation shading from AWS Terrain Tiles (Mapzen/Tilezen Joerd, public domain and open-licensed sources). Contour lines generated with maplibre-contour. Topographic tiles by OpenTopoMap (CC-BY-SA). Satellite imagery © Esri. Elevation and weather from Open-Meteo. Map rendering by MapLibre GL. Place search by Nominatim.

None of these need an account or an API key, which is what makes the whole thing free.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages