I am working in a polyline and I need to obtain the distance of this. So if anyone can help I would be very gratefully.
Best regards.
This is my code:
<
It's easy - using built in functions in the geometry library...
const polyLengthInMeters = google.maps.geometry.spherical.computeLength(yourPolyline.getPath().getArray());
To use the geometry library you declare it when you load the map api
for more info see:
Google API Polyline reference
Google API mcvArray reference
Google API Spherical geometry reference