Google Maps Bookmarklet

Posted in: Technology

Until Google Maps allows you to save locations, a bookmarklet (tested in Firefox and Safari) is in order.

Google Directions

To use:

  1. Drag the link below to your bookmarks
  2. Edit the URL to put in your own address
  3. Go to maps.google.com
  4. Click the bookmarklet

What it does:

  1. Activate the directions tab
  2. Fill the ’start’ field with your address
  3. Set focus to the ‘end’ field

Hope someone else finds it useful.

Popularity: 7% [?]

Posted February 9th, 2005 @ 9:07 PM

17 Replies

  1. David adds this Comment:

    I’m a fan of using keyword shortcuts in Camino and Firefox, so I made one for keyword ‘gd’ (Google Directions) with this URL which will fill in my destination and show me the map all at once. A much more simple one is just http://maps.google.com/maps?q=%s to fill in the query string yourself.

    February 9th, 2005 at 9:33 pm

  2. Geof F. Morris adds this Comment:

    Thanks, Alex. :)

    February 9th, 2005 at 10:01 pm

  3. Alex adds this Comment:

    David, your URLs don’t seem to work for me.

    February 9th, 2005 at 10:10 pm

  4. David adds this Comment:

    Alex, you need to bookmark them in Firefox, and add a keyword to the bookmark. For instance, I have a bookmark with keyword “gd” with the url “http://maps.google.com/maps?q=from%20123%20Street%2099999%20to%20%s” (except my real address. Now, if I type “gd new york” in Camino’s location bar and hit enter, it magically goes to “this URL“, which gives me directions from my house to new york. The key is that Camino (and Firefox) will replace “%s” in the URL with whatever you have after the keyword (properly encoding spaces as %20 and other entities with their hex equivalents).

    You might wanna check Mozilla Custom Keywords. There are a couple hacks to get keywords in Safari: Sogudi and SafariKeywords. I can’t vouch for either since I’m hooked to Camino/Firefox. You can also do similar searches in Quicksilver.

    Hope that clears it up a bit. Anyways, nice site, keep up the good work.

    February 9th, 2005 at 10:46 pm

  5. David adds this Comment:

    One last note, the directions URL in the last one won’t retrieve anything because 123 Street 99999 is a fake address.

    Here’s real directions from a real address: Directions from the White House to New York

    February 9th, 2005 at 10:54 pm

  6. Alex adds this Comment:

    I know about custom keywords, but I don’t use them (Saft also adds them to Safari). I generally search templates in LaunchBar.

    February 9th, 2005 at 11:19 pm

  7. echeng adds this Comment:

    David — that is awesome. Thank you! I wasn’t aware of keywording bookmarks. It’s going to change my life. :)

    February 10th, 2005 at 4:38 am

  8. Greg adds this Comment:

    Here’s my contribution to the google maps bookmarklets:
    Google Maps
    If you just click the bookmark it will take you to Google Maps, but if you select an address on the page first it will show you the map for that address. If the address isn’t complete (ex. you only have the street address, the search filed will be populated with that and you can add the city to get the map).
    Here’s a sample address to try it out on: 1600 Pennsylvania Avenue Washington, DC

    February 10th, 2005 at 11:28 am

  9. Greg adds this Comment:

    Here’s my contribution (let’s try this again) to the google maps bookmarklets:

    Google Maps

    I couldn’t get the link to post correctly, so you’ll want to edit it to look like: javascript:window.location.href=’http://maps.google.com/maps?q=’+window.getSelection();

    If you just click the bookmark it will take you to Google Maps, but if you select an address on the page first it will show you the map for that address. If the address isn’t complete (ex. you only have the street address, the search filed will be populated with that and you can add the city to get the map).

    Here’s a sample address to try it out on: 1600 Pennsylvania Avenue Washington, DC

    I’ve only tested this on Firefox, as that’s what I use.

    February 10th, 2005 at 11:50 am

  10. Greg adds this Comment:

    Here’s an updated version that should work anywhere:

    javascript:var url = ‘http://maps.google.com/maps?q=’;if(window.getSelection){url+=window.getSelection();}else if(document.getSelection){url+=document.getSelection();}else if(document.selection){url+=document.selection.createRange().text;}window.location.href=url;

    February 10th, 2005 at 12:06 pm

  11. brianpuccio.net adds this Trackback:

    Google Maps Bookmarklet
    Following up on

    February 10th, 2005 at 6:00 pm

  12. Follower adds this Comment:

    The following bookmarklet will follow a plotted route from start to finish, moving the map as appropriate:

    javascript: (function () {mv = function(i) { c = _m.map.directions.polyline.getPoint(i);_m.map.recenterOrPanToLatLng(c); if (i < _m.map.directions.polyline.numPoints - 1) {window.setTimeout("mv("+(i+1) + ")",500)}}; mv(0)})();
    

    It works best when you’ve zoomed in pretty closely. It has no error checking so ensure you have actually got directions currently listed. It takes no notice of the zoom level nor how many points there are in the route, so it could take a long time if the route is long. Obviously there are improvements that can be made along those lines.

    I’ve tested this under FireFox 1.0 on Mac OS X, I’d be interested to know if it works successfully elsewhere.

    More details can be found in the comments at: http://jgwebber.blog[...]-google.html

    (Apologies for the multiple attempts the “less than” character was not being converted to an entity by the comment post code.

    February 10th, 2005 at 7:44 pm

  13. Hermes adds this Trackback:

    links for 2005-02-11
    flickr graph - marcos weskamp (categories: API Art Design flickr Photo Software tags WebServices) 2004 Tier Program Page Ugh? (categories: Google Libraries Speaking Software) The New York Times > Books > The Founder of Salon Is Passing the Mouse…

    February 11th, 2005 at 12:19 am

  14. Tales from the Motherboard adds this Trackback:

    My House! And Yours!

    This is a picture of the top of my house taken by a satellite and gathered by me simply by typing my address into Google Maps. Well, almost the top of my house. I don’t actually live in a rabbit-hole in the park….

    April 5th, 2005 at 9:32 pm

  15. ColumnNetwork.org adds this Trackback:

    Google Maps

    Google Mapping Location-Based Narratives

    “My colleague Ken Tompkins recently sent along a link to John Udell’s Walking Tour of Keene. The short video demonstrates how Udell used Google Maps in concert with a bookmarklet to create a walking to…

    April 12th, 2005 at 6:21 pm

  16. JanMartin adds this Comment:

    I had to made a small change to get this to work at Linux (Kanotix, a Debian SID), running Firefox 1.0.4:

    Original
    javascript:window.location.href=’http://maps.google.com/maps?q=’+window.getSelection();
    changed:
    javascript:window.location.href=”http://maps.google.com/maps?q=”+window.getSelection();

    All i did is replace the ’ by ”

    JanMartin

    May 27th, 2005 at 12:25 pm

  17. JanMartin adds this Comment:

    OK,
    this will open any selected address in a new window (or tab if you set Firefox to do so) and show a googel map:

    javascript:window.open(href=’http://maps.google.com/maps?q=’+window.getSelection())();

    JanMartin

    May 27th, 2005 at 12:44 pm

Add a Comment

Please note: Use of a non-personal web site or blog in the field below and/or comments that are off-topic, personal attacks, or support requests will likely be removed at my discretion.

Note: This post is over 3 years old. You may want to check later in this blog to see if there is new information relevant to your comment.

I was Run-ning » « Idiot-proof iPod Battery

About This Site

This is the personal web site of Alex King, a web developer in Denver, Colorado USA. More...


Crowd Favorite

Crowd Favorite is my software and web development business.

We build web applications, design and develop custom WordPress themes and plugins, and build custom sites using WordPress as a CMS.


I also have a tumblog that aggregates my online content from other services (Twitter, Flickr, del.icio.us. etc.).

America

Ads

Get Group Health Insurance
Car Loans available here