Skip to content

Repository files navigation

OpenTrailMap

opentrailmap.us

This is a prototype web map application for viewing OpenStreetMap (OSM) trail data. The tool is being developed in support of our Trails Stewardship Initiative, a community project to improve the quality of trail data in OSM.

Warning

This tool is still in early development and serves as a proof-of-concept. OpenStreetMap US is seeking funding partners to build out the tool as the primary app for visualizing, updating, validating, and maintaining OpenStreetMap trail data in the United States. The app will close the feedback loop between trail users, trail managers, and trail mappers. If you or your organization are interested in supporting this tool, please contact us or consider donating.

Prototype functionality

UI features

  • View OpenStreetMap trail data using various map styles.
  • Click a feature to view its current tags, relations, and metadata.
  • Use quick links to open the feature on openstreetmap.org, iD, JOSM, and other viewers.

Map styles

OpenTrailMap aims to display all land trails, snow trails, and water trails present in OpenStreetMap.

Land and snow trails

The following styles show allowed trail access for different travel modes. Dark green lines are public paths, while striped pale green lines are restricted or infeasible for the given travel mode. Dashed lines are informal=yes, while solid lines are infomal=no or informal not given.

  • Hiking & Walking Trails (foot access)
  • Wheelchair Trails (wheelchair access)
  • Biking Trails (bicycle access)
  • Mountain Biking Trails (mtb access)
  • Inline Skating Trails (inline_skates access)
  • Horseback Riding Trails (horse access)
  • ATV Trails (atv access)
  • Cross-Country Ski Trails (ski:nordic access)
  • Snowmobile Trails (snowmobile access)

Selecting a lens highlights the presence and values of a single trail attribute tag. Purple lines mean an attribute is missing, incomplete, or needs review, while teal lines indicate the attribute is good to go. The set of lenses offered depends on the selected travel mode.

In all the land and snow styles, some trail-related points of interest are included on the map:

Water trails

Currently, just one marine travel mode is supported:

The following water trail attribute styles are supported:

Static stylesheet

The basemap is a general-purpose trail map in its own right, independent of the QA overlay. npm run build writes it to dist/style.json as a plain MapLibre stylesheet, published at opentrailmap.us/style.json, for use in other applications. The stylesheet is subject to the same license as the rest of OpenTrailMap (see below), but note that the tiles it points at are not currently available for public use.

Embedding

An embeddable version of the basemap is served from opentrailmap.us/embed.html, intended for use in an <iframe>. It accepts two parameters:

  • #map=zoom/lat/lon sets the initial camera position.
  • ?highlight=relation/123 highlights one or more parks or protected areas, as a comma-separated list of OSM element IDs.

Get involved

Code of Conduct

Participation in OpenTrailMap is subject to the OpenStreetMap US Code of Conduct. Please take a moment to review the CoC prior to contributing, and remember to be nice :)

Contributing

You can open an issue in this repository if you have a question or comment. Please search existing issues first in case someone else had the same thought. Pull request are public, but we recommend opening or commenting on an issue before writing any code so that we can make sure your work is aligned with the goals of the project.

We also collaborate via the #opentrailmap channel on OpenStreetMap US Slack. Anyone is free to join.

Development setup

Requires Node.js 22 or newer.

  1. Clone the repository
  2. Open your terminal and cd into the repo's directory
  3. Run npm install (first-time setup only)
  4. Run npm run dev to start the development server
  5. Visit http://localhost:5173 in your browser
  6. That's it!

Building sprites

Source vector images for use in the map are located at /style/sprites/icons/. Most are vendored from the CC0-licensed Pinhead icon library. Each icon is composited into plain, rounded-rectangle and circular variants, then packed into SDF sprite sheets under public/sprites/, which are committed to the repository. If you add or change any icon, you'll need to rebuild the sheets.

  1. Install the spreet command line tool
  2. Run npm run sprites
  3. Commit the regenerated files in public/sprites/

License

The OpenTrailMap source code is distributed under the MIT license. Dependencies are subject to their respective licenses.

The icons used in OpenTrailMap are available under the CC0 license and are in the public domain. See style/sprites/LICENSE for details.

About

Trail map based on OpenStreetMap

Resources

Stars

50 stars

Watchers

7 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages