Skip to content

Instantly share code, notes, and snippets.

@paulmwatson
Created May 17, 2013 09:28
Show Gist options
  • Save paulmwatson/5598004 to your computer and use it in GitHub Desktop.
Save paulmwatson/5598004 to your computer and use it in GitHub Desktop.
Bookmarklet for getting the latitude and longitude of the center of the map in new Google Maps (which has lost the What's Here? feature which got the lat/lng easily.)
javascript:var d=document,w=window,l=d.location.href;lats=l.indexOf('!2d')+3;late=l.indexOf('!3d',lats);lat=l.substring(lats,late);lngs=l.indexOf('!3d')+3;lnge=l.indexOf('!',lngs);lnge==-1?lnge=l.length:lnge=lnge;lng=l.substring(lngs,lnge);w.location='http://maps.google.com?q='+lng+','+lat;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment