Skip to content
Enables drawing tracks
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
dist
docs
src
test
.eslintrc.json
.gitignore
LICENSE
README.md
index.html
karma.conf.js
package-lock.json
package.json

README.md

Leaflet TrackDrawer

Leaflet TrackDrawer is a plugin for Leaflet to easily draw tracks while using custom routing algorithms.

L.TrackDrawer.Track provides the low-level APIs to add, move & delete waypoints. It also supports saving and restoring state, as well as undoing and redoing actions.

The plugin also comes with an optional toolbar L.TrackDrawer.ToolBar which implements all the interactions for you.

If you wish to have multiple routing algorithms, there is an additional toolbar L.TrackDrawer.TraceModeBar which lets the user easily switch between modes.

Demo

A real-case usage of this plugin is for map2gpx.

API

See doc.

Extending TrackDrawer

Other plugins are available to extend/use TrackDrawer:

  • Leaflet.TrackDrawer.FileLayer: enables loading GPX, KML, GeoJSON from the users's computer or from a URL
  • Leaflet.TrackStats: computes statistics (distance, altitude, slope, etc.) for Leaflet's Polyline objects and for TrackDrawer's Track objects
You can’t perform that action at this time.