Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5968793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:08:23+00:00 2026-05-22T20:08:23+00:00

The GDirections class of Google maps API helped me in displaying the route between

  • 0

The GDirections class of Google maps API helped me in “displaying” the route between two supplied coordinates.

Now I want a list of ALL the coordinates on that route.

Any hints on how to get this?

EDIT
Just now discovered http://code.google.com/apis/maps/documentation/javascript/reference.html#DirectionsRoute

Its overview_path property gives the list of ALL the waypoints of the route.
Is DirectionsRoutethe right class for this problem Or I am missing some point?

EDIT – 2

With the help of this link shown by mkram0 below, I have modified the code as follows:

The Map IS getting displayed.
The Route IS getting displayed.

I was thinking of placing markers on the first four coordinates on the route. Those markers don’t get displayed. Any helps? Please.

directionsService.route (request, 
                            function (result, status) 
                            {
                                if (status == google.maps.DirectionsStatus.OK)
                                {
                                    directionsDisplay.setDirections (result);

                                    for (var route in result.routes) 
                                    {
                                        for (var leg in route.legs) 
                                        {
                                            for (var step in leg.steps) 
                                            {
                                                for (var latlng in step.path) 
                                                {
                                                    pointsArray.push(latlng);
                                                }
                                            }
                                        }
                                    }

                                    var point1 = new google.maps.Marker ({
                                        position:pointsArray[0],
                                        draggable:true,
                                        map:map,
                                        flat:true
                                        });

                                    var point2 = new google.maps.Marker ({
                                        position:pointsArray[1],
                                        draggable:true,
                                        map:map,
                                        flat:true
                                        });

                                    var point3 = new google.maps.Marker ({
                                        position:pointsArray[2],
                                        draggable:true,
                                        map:map,
                                        flat:true
                                        });

                                    var point4 = new google.maps.Marker ({
                                        position:pointsArray[3],
                                        draggable:true,
                                        map:map,
                                        flat:true
                                        });
                                }
                            });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T20:08:24+00:00Added an answer on May 22, 2026 at 8:08 pm

    Solved this myself 🙂
    The overview_path was the correct method w.r.t displaying the coordinates:
    Just for checking if this really shows something, I have displayed markers on the resulting first four coordinates.

    directionsService.route (request, 
                                function (result, status) 
                                {
                                    alert(status);
                                    if (status == google.maps.DirectionsStatus.OK)
                                    {
                                        directionsDisplay.setDirections (result);
    
                                        var pointsArray = [];
    
                                        pointsArray = result.routes[0].overview_path;
    
                                        var point1 = new google.maps.Marker ({
                                            position:pointsArray[0],
                                            draggable:true,
                                            map:map,
                                            flat:true
                                            });
    
                                        var point2 = new google.maps.Marker ({
                                            position:pointsArray[1],
                                            draggable:true,
                                            map:map,
                                            flat:true
                                            });
    
                                        var point3 = new google.maps.Marker ({
                                            position:pointsArray[2],
                                            draggable:true,
                                            map:map,
                                            flat:true
                                            });
    
                                        var point4 = new google.maps.Marker ({
                                            position:pointsArray[3],
                                            draggable:true,
                                            map:map,
                                            flat:true
                                            });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of links that all go to a google maps api.
I have a google maps directions link shown in XML: http://maps.googleapis.com/maps/api/directions/xml?origin=111%20Davisville%20Avenue,Toronto,ON&destination=469%20King%20Street%20West,%20Toronto,%20ON&sensor=false&dirflg=r Even though it
I'm writing a bijective dictionary class , but I want to ensure the two
I'm having a puzzling little problem with the Google Maps API which has had
I am successfully calling GDirections to get a map with directions between a point
Is it possible to create a custom route for GDirections to walk around? Like
In my project, i have imported some third party frameworks like google-maps. EveryThing work
I have several questions regarding the Google Map V3 API and its library for
In my android app i am displaying route b/w current_location and user selected near
I am developing an Android app and want to get the road distance between

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.