Bookmarklets for Google Maps Directions

Share

I just made a set of bookmarklets to give me Google Maps directions to the text I’ve selected in my browser. I thought I’d share them in case they’re useful to anyone else!

If you want to use a bookmarklet, click and drag any of the below links into your browser’s bookmarks bar. If that doesn’t work, you can try one of the other options here.

Bookmarklet #1: Driving Directions

Code:

javascript:window.open('https://maps.google.ca/maps?saddr=Your+Address+Here&daddr='+encodeURIComponent(document.getSelection()));

Bookmarklet #2: Transit Directions

Code:

javascript:window.open('https://maps.google.ca/maps?saddr=Your+Address+Here&daddr='+encodeURIComponent(document.getSelection())+'&dirflg=r&ttype=now&noexp=0&noal=0&sort=def&start=0');

Bookmarklet #3: Walking Directions

Code:

javascript:window.open('https://maps.google.ca/maps?saddr=Your+Address+Here&daddr='+encodeURIComponent(document.getSelection())+'&dirflg=w');

Bookmarklet #4: Biking Directions

Code:

javascript:window.open('https://maps.google.ca/maps?saddr=Your+Address+Here&daddr='+encodeURIComponent(document.getSelection())+'&dirflg=b&lci=bike');

These bookmarklets open the map in a new window, but if you’d like the map to open in the same window, you can edit the bookmarklet by replacing javascript:window.open( with javascript:location.href= and removing the closing parenthesis ) at the end. For example:

javascript:window.open('https://maps.google.ca/maps?saddr=Your+Address+Here&daddr='+encodeURIComponent(document.getSelection())+'&dirflg=b&lci=bike');

would become

javascript:location.href='https://maps.google.ca/maps?saddr=Your+Address+Here&daddr='+encodeURIComponent(document.getSelection())+'&dirflg=b&lci=bike';

Hope these come in handy!

Share