Skip to content

Small route planning application designed to enable hikers, cyclists, or motorists to plan their trips by plotting a route on a map. Also a GPX editor: routes can be exported as GPX files and then used with GPS devices or mobile navigation apps. The application is written in JavaScript, contained in a single HTML file, and makes use of OSM tools.

License

Notifications You must be signed in to change notification settings

patricklmarie/GPX-Route-Planner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 

Repository files navigation

GPX Route Planner

GPX Route Planner is an open-source route planning application released under the MIT License.

© 2026 Patrick Marie

Overview

GPX Route Planner is a small route planning application. It is designed to enable hikers, cyclists, and even motorists to plan their trips by plotting a route on a map.

It is also a GPX editor: the route can be exported as a GPX file and then used with GPS devices or mobile navigation apps such as OsmAnd or Locus.

The application is written in JavaScript, contained in a single HTML file (GPX_Route_Planner.html), and can be run simply by opening this file in a web browser.

This application is entirely based on open-source technologies part of the OpenStreetMap ecosystem: Leaflet to render the map and the route, Nominatim to locate places from their addresses, BRouter to calculate routes between locations. The browser’s Geolocation API is used to determine the user’s position.

Route structure

In this tool, a route consists of:

  • One or more stages. A stage represents a journey planned to be completed in one go or in a single day. It consists of:
    • A starting point, an end point, and optional waypoints. These points are rendered on the map using Leaflet circle markers.
    • One or more sections. A section is a path (curved or straight) connecting two points of a stage. Sections are rendered on the map using Leaflet polylines. Their position and shape are calculated using BRouter or by drawing a straight segment, depending on the selected option.

Event-driven design

The tool provides functions to create, modify, and delete stages, as well as their points and sections.

A key feature of this application is its extensive use of Leaflet event handlers attached to various objects: the map, circle markers, and polylines. Depending on the context (stage editing mode or supervision mode), the required event handlers differ, and most of them cannot be assigned once and for all. Instead, they must be registered, in order to be dynamically retrieved, removed, and replaced by others as the context changes.

Live demo

https://patricklmarie.github.io/GPX-Route-Planner/

image

About

Small route planning application designed to enable hikers, cyclists, or motorists to plan their trips by plotting a route on a map. Also a GPX editor: routes can be exported as GPX files and then used with GPS devices or mobile navigation apps. The application is written in JavaScript, contained in a single HTML file, and makes use of OSM tools.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages