Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

323
Views
How to get route distance with Mapquest.js?

I am writing a code to find the optimum route. I am using L.mapquest and I am getting the route plot on leaflet. However, I need the distance and time of such route but I can't figure out how to do this. Can someone help me, please?

The following is a piece of code:

function findRouteForWaypoints(event){
    event.preventDefault();
    L.mapquest.key = config.MY_API_TOKEN;

    var dir = L.mapquest.directions().route({
      start: ''.concat(startPointLatitude,',',startPointLongitude),
      end: ''.concat(endPointLatitude,',',endPointLongitude),
      waypoints: binWaypoints,
      optimizeWaypoints: true
    })
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can use the route callback function to get other route parameters like distance. https://developer.mapquest.com/documentation/mapquest-js/v1.3/l-mapquest-directions-route/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!