GPX Route Planner is an open-source route planning application released under the MIT License.
© 2026 Patrick Marie
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.
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.
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.
https://patricklmarie.github.io/GPX-Route-Planner/