User:Frankh

From OpenStreetMap Wiki
Jump to navigation Jump to search

OSM bookmarklet

Sometimes I want to view OSM for a particular location, and it is very slow to navigate around if I want to see a location far from the default view. Entering lat/long into the url by hand is a bit clunky too. So, inspired by the Tagzania 'bookmarklets' I have a bookmarklet for OSM that can be used with Multimap to view a particular location in OSM.

To make the bookmarklet, save this as a favourite in your browser:

 javascript:location.href='http://www.openstreetmap.org/edit/view-map.html?lat='+location.href.substring(location.href.indexOf('lat=')+4,location.href.indexOf('&',location.href.indexOf('lat=')+4))+'&lon='+location.href.substring(location.href.indexOf('lon=')+4,location.href.indexOf('&',location.href.indexOf('lon=')+4))+'&scale=4.4444444e-05'                               

To use it:

  1. go to the Multimap site
  2. search for your location, for example a postcode or street name.
  3. in the Map Information box below the map, click the link called 'Web Address:'
  4. the page that loads will be the same location, but with a short url containing lat/long
  5. select your OSM bookmarklet - the location currently in view in Multimap will then load in OSM.

This sounds complicated but it is really quick. I use this with Firefox Search Keywords for very rapid location of postcodes and place names. It is handy if you have got some uploaded data an you want to view it without having to work out lat/long manually.

I imagine this is fair use of the multimap url, but I haven't checked and would be interested to hear any feedback via the Mailing Lists.