July 6, 2005
Google Maps Route Planner
More Google Maps goodness…this time, I created a way to plan out your route.
Say, for example, you have multiple stops you need to complete. This application will provide you with a way to set a lot of markers of all the places you need to stop at, then it will tell you which places to stop by in which order.
Here is how to use it:
- pan and zoom to the place you’d like to start at then click “Recenter” to set your starting point.
- Click to add markers for all your intermediate stops (doesn’t matter which order). You can click on the markers to remove them.
- When you are done adding markers, click “Get Route”
- You will be presented with lines representing the order in which you should travel, with a different-colored line representing your trip back “home.”
- You can click to set/remove markers and click “Get Route” again or start over altogether by clicking “Start Over”
Issues/Bugs:
- Distances are calculated “as the bird flies”
- No complicated algos here…just the closest point from the previous point
- currently, no input taken…everything is done with mouse…no keyboard…this is intentional but may change if enough people complain
- I am already calculating the distances but am not currently displaying them
Try it out here.


(24 votes, average: 4 out of 5)






emad said,
July 12, 2005 @ 4:33 pm
Distances are now provided below the map. Additionally, you can now see either “as the crow flies” distances or “driving” distances.
Be careful when asking to see driving distances over larger distances and/or when you have selected many points.
emad said,
July 13, 2005 @ 3:15 pm
Driving directions added below distances.
Andrew said,
August 11, 2005 @ 9:06 am
I’ve really been looking for a route planner for a long time and I thought I’d finally found on with yours, but it doesn’t really do any route planning at all. All you are doing it drawing straight lines between each way point that I click. Does the Google Map API support drawing multiple directions on the same map? If so, you should try to get directions from point a to b, then b to c, and so on. I don’t know if their API supports it though. If it doesn’t…that sucks…Let me know what you find out!
emad said,
August 11, 2005 @ 10:09 am
Andrew, I think you need to check out an update I posted to the routeplanner.
Information is here with the actual application changes located here.
Let me know what you think.
Andrew said,
August 11, 2005 @ 10:43 am
Cool, that is much better. I did just post to the Google Maps API group on google groups and they said that there isn’t an API to the directions portion. So i guess your hack was the way to do it for now. I do get some wierd results some times though. Also, what ever it is doing is eating CPU cycles like mad! Especially if you have a lot of way points. Firefox/mozilla keeps warning me about a script running out of control and want me to kill it. I can’t get it to finish for a large/complex route. Otherwise, this is a great start to a real route planner. Thanks!
emad said,
August 11, 2005 @ 10:47 am
Thanks, Andrew.
Remember, the script finds the best path for you to take rather than draw them in the order you provide them. That’s means the more points you select, 1) the longer it will take to find the best directions and 2) the more points will be needed to draw the polyline overlay. You can get similar behavior for number 2 when you select points that are further apart from each other (more points are needed to be generated). The 1st issue is most limited by my bandwidth and the second issue is more limited by users’ bandwidth and CPU power. You might have run into a problem with one or both of those.
Thanks for the feedback!
Mike Pegg said,
October 16, 2005 @ 2:15 pm
Hi there,
I’m from the Google Maps Mania blog - wanted to chat with you about your app. Drop me a line at the email I left with this post.
Mike.
http://www.gmapsmania.com
Rob Ciaccio said,
February 3, 2006 @ 1:42 pm
Hello,
I think you’ve got the start of a really great tool here. I must admit that I am a bit disappointed, though, because if you enter in all your points and then realize that you’re in the wrong mode (in this case i was in “as the crow flies” and needed to be in driving mode), if you click the other mode you have to enter all your points over again.
Jon said,
February 23, 2006 @ 1:42 pm
Is code for this available to others ? if so where to obtain ?
Andrei said,
March 29, 2006 @ 7:35 pm
This is pretty cool except it seems to insert a random point near the middle of the map. I would like to use this to plan out jogging paths, but cant seem to be able to get rid of the random point.
Some other features that would be useful to me:
1. It would be nice to have it trace a path in the exact order it was specified.
2. Because I’d like to know how long my jog will be, it would be nice if the disatances were totaled.
Let me know if the code for this is available.
emad said,
March 30, 2006 @ 10:02 am
Andrei and Rob Ciaccio,
Both of your requests have been added.
Thanks
Emad
John said,
May 3, 2006 @ 7:43 am
emad,
Thanks for this great service! This is espeically useful for us [pedal] bikers and joggers! Is is possible to allow entry of ‘average MPH’ since us bikers and joggers don’t quite go as fast as cars (except maybe in traffic!
Also, back a couple of years ago MapQuest used to have the ability to plan routes by ‘avoiding major roads’ — they lost this ability when they switched over to Microsoft MapPoint as their ‘backend’
Do you have any plans to add this type of capability or do you know of a mapping site that provides this?
Thanks again for a great service!
John
Richard said,
May 10, 2006 @ 8:05 am
Hi,
This is pretty cool. I am not familiar with the capabilities of hte G-maps API, but as an avid cyclist, i have been looking for something like this for a while. I was wondering if there is any way to allow the user to rename the waypoints, so i could make them more descriptive (even describe landmarks). I was also wondering if there is any way to do the turn-by-turn maps with the directions?
Notwithstanding my comments, this is great stuff!
Richard
Richard said,
May 10, 2006 @ 8:15 am
Hi,
Me again… would also be great if we could enlarge the map pane… my 19″ monitor is going to waste!
Cheers,
Richard
emad said,
June 13, 2006 @ 1:50 pm
Screen resolutions are built dynamically now. Let me know if you see any javascript errors. Thanks for the input, Richard!
Ry said,
July 15, 2006 @ 5:18 am
Amazing App! Would it be possible to set up a round trip and/or specify start and end points? If this is already a feature I missed it…
Ry
vin said,
July 24, 2006 @ 12:20 pm
it’d be cool if you could link to the map URL
emad said,
July 24, 2006 @ 2:04 pm
Hi Vin…added!
Jen Z said,
August 11, 2006 @ 1:13 am
Just wanted to say thanks for your hard work on this, it’s excellent. I’m doing an around the world trip and am using it to show visitors to my site a graphical representaion of my route.
Shawn Banks said,
August 15, 2006 @ 7:04 am
Is this Code available for others to use and incorporate into their own site and if so how would I go about getting it.
Great funcitioanity
Marc said,
August 28, 2006 @ 11:22 pm
Is there a way to add captions to the pushpins?
jacob said,
September 8, 2006 @ 4:04 pm
love the map! however - would LOVE to see a version that allows you to input physical street address to create the route….i’m taking such a random guess at this point that it’s really far from where i’m actually going….thx!
emad said,
September 8, 2006 @ 4:31 pm
Hi Jacob…added!
simon wright said,
July 3, 2007 @ 5:42 pm
Really cool app mate…. Was wondering if you had thought about a facility to add 20-30 pre defined addresses with map lat/long references in bulk. Then have the app work out the best route.
Just a thought… keep up the great work
Simon
christopher said,
February 12, 2008 @ 4:22 pm
Hello, Emad:
I was preparing to build one that served a similar purpose. Same thing with a little more functionality but I would like to speak with you before I commit to building one. How can I contact you? Thanks.
-Christopher
michael said,
May 2, 2008 @ 3:46 pm
You should add scroll functionality to zoom in and out using mouse scroll wheel. Also i planned out a route, but then it did not give me the driving direcitions, it just said go from a to b, b to c, etc