July 12, 2006

Google Maps Bookmarklet

Make a bookmarklet of this code and you can put a marker up on the centre of any Google Maps page. Select it all on one line in the box below, or peruse it on several lines below that.

javascript:var h=document.getElementById('link').href;
var l=h.substr(h.indexOf('ll='));
l=l.substring(3,l.indexOf('&',1));
var s=h.substr(h.indexOf('spn='));
s=s.substring(4,s.indexOf('&',1));
var i=h.substr(h.indexOf('ie='));
i=i.substring(3,i.indexOf('&',1));
l=encodeURI(prompt('Location',l));
var m=encodeURI(prompt('Label','My Label'));
var n='?ie='+i+'&q='+l+'('+m+')'+'&ll='+l+'&spn='+s;
location.href=h.substring(0,h.indexOf('/'))+n;
Posted by Oxygenik at July 12, 2006 2:45 PM