In a map in a web application, I would like to illustrate distance along a path, like how it is done with the measure distance tool in Google Maps (see attached image).
Is there a way to do this in Leaflet? Maybe with a plugin?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityIn a map in a web application, I would like to illustrate distance along a path, like how it is done with the measure distance tool in Google Maps (see attached image).
Is there a way to do this in Leaflet? Maybe with a plugin?
I just refreshed and published the leaflet-measure-distance plugin for leaflet.
There's a demo here: https://onaci.github.io/leaflet.measure/
It does pretty much exactly what you are described, except it doesn't have ticks... PR's welcome!
I eventually found the plugin leaflet-distance-markers (listed in the Leaflet Plugins database) which was sufficient for my use case.