New Google Maps URLs – Directions Options (Part 2)

In this second post on URL options for Google Maps directions, we will look at specifying waypoints – locations which Maps will require a route to pass through – for both simple and multi-stop directions.


Let’s look at a simple set of directions – driving from Estes Park Resort in Estes Park, CO down to the Colorado School of Mines in Golden, CO. A simple URL for this would be:

https://www.google.com/maps/dir/Estes+Park+Resort/CO+School+of+Mines

Now, suppose you’ve never seen the Central City/Black Hawk casinos, so you decide to go a bit out of your way to drive past them on the way down. You select 39.80165,-105.49442 (the middle of the street between the casinos) as your waypoint. The resulting URL would look like this:

https://www.google.com/maps/dir/Estes+Park+Resort/CO+School+of+Mines/data=!4m6!4m5!1m4!3m3!1m2!1d-105.49442!2d39.80165

The data options become a little easier to read if we break that section down:

!4m6 – Map/route/display contents, 6 elements
   |
   +-!4m5 – Directions options, 5 elements
        |
        +-!1m4 – Leg of route, 4 elements
             |
             +-!3m3 – Waypoint, 3 elements
                  |
                  +-!1m2 – Waypoint location, 2 elements
                       |
                       +-!1d-105.49442 – Longitude
                       +-!2d39.80165 – Latitude

If you check back on the Data Options Reference page you will see that there are many elements that we have omitted, but Maps can supply them automatically so we don’t have to worry about them.

Now, suppose we are going to stop at the Gates Camp in Ward, CO first before continuing on to Golden via Central City. Our revised URL will look like:

https://www.google.com/maps/dir/Estes+Park+Resort/Gates+Camp,Ward,CO/CO+School+of+Mines/data=!4m7!4m6!1m0!1m4!3m3!1m2!1d-105.49442!2d39.80165

Breaking down the data options section:

!4m7 – Map/route/display contents, 7 elements
   |
   +-!4m6 – Directions options, 6 elements
        |
        +-!1m0 – Leg of route, no elements
        |
        +-!1m4 – Leg of route, 4 elements
             |
             +-!3m3 – Waypoint, 3 elements
                  |
                  +-!1m2 – Waypoint location, 2 elements
                       |
                       +-!1d-105.49442 – Longitude
                       +-!2d39.80165 – Latitude

Note that we have an empty !1m element for the first leg. If we did not include that, Maps would treat our waypoint as belonging to the first leg of the route, resulting in a very different set of directions.

You can specify waypoints on more than one leg, as well as multiple waypoints within the same leg. So, let’s say you decide that on your way out of Estes Park you’re going to swing past Solitude Cabins to see if it looks like a nice place to stay for your next visit; you pick 40.36852,-105.49161 (the middle of Sketch Box Lane) as your waypoint. Then, after driving past the casinos, you want to swing through Idaho Springs and get on I-70 there to head back towards Golden; you use the I-70 on-ramp (39.74052,-105.51960) as your waypoint. Now we have the following URL:

https://www.google.com/maps/dir/Estes+Park+Resort/Gates+Camp,Ward,CO/CO+School+of+Mines/data=!4m15!4m14!1m4!3m3!1m2!1d-105.49161!2d40.36852!1m8!3m3!1m2!1d-105.49442!2d39.80165!3m3!1m2!1d-105.51960!2d39.74052

Breaking down the data options section:

!4m15 – Map/route/display contents, 15 elements
   |
   +-!4m14 – Directions options, 14 elements
        |
        +-!1m4 – First leg of route, 4 elements
        |    |
        |    +-!3m3 – Waypoint, 3 elements
        |         |
        |         +-!1m2 – Waypoint location, 2 elements
        |              |
        |              +-!1d-105.49161 – Longitude
        |              +-!2d40.36852 – Latitude
        |
        +-!1m8 – Second leg of route, 8 elements
             |
             +-!3m3 – First waypoint, 3 elements
             |    |
             |    +-!1m2 – Waypoint location, 2 elements
             |         |
             |         +-!1d-105.49442 – Longitude
             |         +-!2d39.80165 – Latitude
             |
             +-!3m3 – Second waypoint, 3 elements
                  |
                  +-!1m2 – Waypoint location, 2 elements
                       |
                       +-!1d-105.51960 – Longitude
                       +-!2d39.74052 – Latitude

Return to New Google Maps URLs introduction

Advertisements
This entry was posted in Google Maps, Online Maps and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s