July 7, 2009

OpenStreetMap and Geolocation

Inspired by johnath, here's a bookmarklet you can use if you want to geolocate yourself on the OpenStreetMap map:

javascript:navigator.geolocation.getCurrentPosition(function(a){c=a.coords;window.location="http://www.osm.org/?zoom=15&mlat="+c.latitude+"&mlon="+c.longitude;},function(){alert("Rejected!")});

It actually works a bit differently, because unlike Google Maps, OpenStreetMap doesn't have a search box which takes you straight to a location. As a side-effect, you don't need to be viewing OSM already to use it - it's more like a bookmark.

Posted by gerv at July 7, 2009 9:05 AM | TrackBack
Comments

This caused me to see bug 502891

Posted by: adrian at July 7, 2009 7:29 PM
Post a comment





(not published)




Remember personal info?


This entry box accepts some HTML. You will need to escape < as &lt; and > as &gt;. Useful tags: <blockquote>, <b>.