I have been inspired by PPete work and his original work https://github.com/ppete2/Leaflet.PolylineMeasure
In this plugin we provide two different mesurement methods to measure the distance between two points. Those methodes are:
As a user you'll have the ability to toggle between the two methodes and each time the distance measurement will be rendered based on your selection, One path .. render twice!!
- Please take a look at the following Demo
Add 2 lines within your HTML-code to load the .css and .js files of the plugin:
<link rel="stylesheet" href="https://ppete2.github.io/Leaflet.PolylineMeasure/Leaflet.PolylineMeasure.css" />
<script src="https://ppete2.github.io/Leaflet.PolylineMeasure/Leaflet.PolylineMeasure.js"></script>
Add 1 line within your Javascript-code to add the plugin's control into your Leaflet map.
L.control.polylineMeasure(options).addTo(map);