• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 845
  • Last Modified:

Google MAPS DirectionsRenderer()

I am using this object to calculate dirving directions for service techs.

It seems that if there are more than 8 waypoints, the process fails.

I can post my code (mostly copied from the Google API documentation).

We will likely need about 20 waypoints in some instances.

Is there a way around this?
Richard Korts
Richard Korts
1 Solution
Ray PaseurCommented:
Google has a set of "enterprise-level" applications.  It's my sense that these paid application interfaces are more robust.  You might contact them about it.

But to the philosophical question... Have a look at this.  If I ask Google how to get from my home to the White House, I get something like these instructions.

1. Head south on Colleen Ln toward Loch Raven Dr
2. Turn left onto Loch Raven Dr
3. Turn left onto Kirby Rd
4. Turn right onto Dolley Madison Blvd
5. Take the ramp onto George Washington Memorial Pkwy
6. Take the exit onto I-66 E toward US-50 E/Washington
7. Continue onto US-50 E/Constitution Ave NW
8. Turn left onto 15th St NW
9. Take the 1st left onto E St NW

The first five pieces of information in that list take me from my front door to the first major road, only about a mile away.  Not to put too fine a point on it, but I am pretty sure I know how to get out of my neighborhood, and I don't need to devote half of the driving instructions to that part of the route.  

You might want to consider whether 20 waypoints is too much information.  A plain map with a zoom feature (and some common sense) might be more useful to your drivers.  Just a thought. ~Ray
Richard KortsAuthor Commented:
To Ray_Paseur:

Thanks Ray.

I'm looking for a more automated thing.

The customer has almost 4,000 customers (Wichita KS area). Look at this example.


Click "Calc Route".

This is just a mock up; in this simple case, I hard coded all the addresses in JavaScript.

The real cust appts. are in a database. They want to be able to select a date (like tomorrow), AM or PM or all & get driving directions to the selected appts, where the directions are optimized via the "waypoints" as Google Maps calls them, from their office (1527 S. Washington)

I have this programmed in php. The problem is if there are more than 8 "waypoints", it fails. I have found docs that state an awareness of this but NOT the solution.

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now