David David - 1 year ago 133
Javascript Question

Leaflet get sub-polyline with specific start and end point

I want to get a "sub-Polyline" of a given polyline that is determined by a certain start and end point (in meters).

For example I have a polyline that is 500 meters (build using 30 coordinates (not seperated in same spaces)) and I want to color the line between meter 200 and 300 in a different color. Is it possible using Leaflet functions?

Answer Source

Take a look at the LineStringSelect plugin here: https://github.com/w8r/L.Control.LineStringSelect

With the demo (click in 2 different locations on the polyline):


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download