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:

  1. pan and zoom to the place you’d like to start at then click “Recenter” to set your starting point.
  2. Click to add markers for all your intermediate stops (doesn’t matter which order). You can click on the markers to remove them.
  3. When you are done adding markers, click “Get Route”
  4. You will be presented with lines representing the order in which you should travel, with a different-colored line representing your trip back “home.”
  5. 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.

Author: emad

Cofounder of Connectivity / YellowBot; Former IAC Exec / CTO Citysearch and Local Search speaker; Husband & Father; BasketBall & Lakers fan

26 thoughts on “Google Maps Route Planner”

  1. 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!

  2. 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!

  3. 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!

  4. 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.

  5. 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.

  6. 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

  7. 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

  8. Hi,

    Me again… would also be great if we could enlarge the map pane… my 19″ monitor is going to waste!

    Cheers,

    Richard

  9. 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

  10. 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.

  11. 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

  12. 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!

  13. 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

  14. 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

  15. 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

Leave a Reply

Your email address will not be published. Required fields are marked *