Skip to content

Instantly share code, notes, and snippets.

@tordans
Created August 19, 2011 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tordans/1156477 to your computer and use it in GitHub Desktop.
Save tordans/1156477 to your computer and use it in GitHub Desktop.
Bookmarklet: Get a clean, shareable Google Maps Place URL on every Google Maps Place-Page
/**
* How to install:
* 1. Open the Firefox or Chrome and Add a new Bookmark-Dialogue
* 2. Copy the line of JS from below and provide whatever name and shortcut-tags you whant
*
* How to use and test it:
* 1. Search for a place in Google Maps, click on the title to get to the place's details page. This is where google could just place a clean place-url in your browser bar but doen't.
* 2. Click the bookmarklet and the Page reloads so you get a clean google place URL in your browser-bar.
* 3. Jump to your browserbar with cmd+L (strg+L) and press strg+c to copy the clean URL.
**/
var urlchunks = document.getElementById('link').getAttribute('href').split(/[&?]+/); for(key in urlchunks) { if(urlchunks[key].indexOf('cid')===0) { window.location.href = (urlchunks[0] + "?" + urlchunks[key]); } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment