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

  • Home
  • SEARCH
  • 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 4334512
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:32:22+00:00 2026-05-21T10:32:22+00:00

Greetings, Until now I have mostly been working with google maps v2. I am

  • 0

Greetings,

Until now I have mostly been working with google maps v2. I am now making my way to v3, but I came across a problem I havent been able to find a solution for.

In V2, when using directions, I could add a point on the map with no actual road, and the maps api would automatically figure out the closest possible endpoint where a road exists and display directrions to that point. This seems not to be the case with V3 though. In allot of cases the route is wrong, because I haven’t placed my point on an actual road and the service fails (?) to find the closest one. Here is a screenshot to display what I mean:

enter image description here

I am using the exact same coordinates for both maps. The red pins on V3 show where those coordinates actually point to, but as you can see the directions are wrong. Only if I use coordinates that are exactly on a road, then they show up correctly (not displayed here). I am using the exact same coordinates on V2 and V3, but only V2 displays the correct directions.

Here is a sample of the code I am using for getting the direcrtions:

var directionDisplay;
var directionsService = new google.maps.DirectionsService();
var map;

function initialize() {
    //Works fine, so I ommit the code
}


function calcRoute(endpointCoords) // endpointCoords holds coordinates for end point
{
    var startpoint = '<?=$startPoint[latitude];?>, <?=$startPoint[longitude];?>';
    var endpoint = endpointCoords;

    var request = {
    origin:startpoint,
    destination:endpoint,
    travelMode: google.maps.DirectionsTravelMode.DRIVING
    };

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

The documentation did not help me much further ( http://code.google.com/apis/maps/documentation/javascript/services.html#Directions )

Have you had similar experience with the v3 version of the api? Any ideas why this happens?

UPDATE: Here is a link that shows the code and problem in action:
http://jsfiddle.net/spairus/gNpZ2/

  • 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-21T10:32:23+00:00Added an answer on May 21, 2026 at 10:32 am

    From the graphic, it looks like your lng/lat might be in the wrong order. As suggested here, you might want to make sure you are using the longitude and latitude in the correct order.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings good people - I need some help. I have until now buildt web-pages
Hello i have a simple expandable list activity that was working fine until i
Greetings, I'm trying to find a way to 'unbind' a socket from a particular
Greetings. I'm looking for a way to parse a number of XML files in
Greetings! I'm working on wrapping my head around LINQ. If I had some XML
Greetings, I need a way (either via C# or in a .bat file) to
Greetings, I have a particular object which can be constructed from a file, as
I have modified the guestbook example shipped with google app engine (java) to include
So i've just finished the google app engine greetings tutorial. All well so far.
Greetings. 1 - Let's say I have about 500 folders of variable size with

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.