Google maps can give you "my location" automatically. Does it exist in OpenStreetMap ? Thx ! asked 11 Feb '12, 10:03 donbirman |
As far as I understand, donbirman is looking for a feature that is used in firefox (and other browsers), that when visiting a website utilizing this feature (and a pop-up asking to 'find my location'), it will (amongst other things) reformat the map to your location (roughly). http://www.mozilla.org/en-US/firefox/geolocation/#geo-demo Unfortunately, it relies upon a google API and I don't know of any other alternatives (OSS or otherwise). This could be a pretty useful feature for OSM, for the map could automatically change to a user's location when the visit openstreetmap.org answered 11 Feb '12, 19:00 skorasaurus 1
In a nutshell, I think that he's asking for this: var options; navigator.geolocation.getCurrentPosition( geolocationWorked, geolocationFailed, options ); Where "geolocationWorked" and "geolocationFailed" are Javascript functions. An Internet search for "navigator.geolocation.getCurrentPosition" gets lots of info. How geolocation is handled varies by browser and hardware implementation - on a phone the browser will usually use the inbuilt GPS by default, for example. On a PC with no GPS hardware the browser tries to guess and can just ask you. It's not a "Google API".
(11 Feb '12, 19:45)
SomeoneElse ♦
|
Some technical background: Websites that find your location can be built using the Geolocation API (Wikipedia, W3C) available in modern browsers. This API can also be used together with Leaflet and OpenLayers - see this simple demo for the latter. So it is easily possible to add an user interface element like Google's "my location" when creating a website that displays OpenStreetMap data, and some OSM based maps already offer such a feature. Since a recent redesign in July 2013, the openstreetmap.org front page itself is among them. By the way, for those who don't know the Google Maps feature, its use is explained here. answered 11 Feb '12, 21:42 Tordanik |
I wondered about this, and so I asked over on the #osm-dev IRC channel. They said that although osm.org does do IP-address based Geolocation (if you go to the front page in the UK, and it's not seen you before, you'll get a map of the UK) it doesn't do browser-based geolocation. It's been asked before (there's a trac ticket here, and there may be others). In a nutshell, the problem is that an automatic geolocation request could be seen as an annoyance by the majority of users who are desktop rather than mobile. A "take me to where I am" button would need to be fitted on the main screen, and there's not a lot of free space there. That trac entry is still open as an enhancement, so comments there about what sort of geolocation would make sense is probably the best place - but it's fair to say that the job of convincing the people who actually give up their time to design and run OSM that it's a good idea hasn't been successful yet. There's also a related perennial discussion of "what should the front page actually be like" - if you read through the various mailing lists there's lots of history about that. answered 11 Feb '12, 22:07 SomeoneElse ♦ |
Try for example openstreetbrowser.org ... this site has an automated geo location feature. answered 13 Feb '12, 16:15 stephan75 |
As of 19th July 2013 that is possible now on http://www.openstreetmap.org/ : you can now use browser geo-location to locate the map where you are (click on the symbol in the side bar). See: blog post explaining the new map controls. answered 30 Jul '13, 16:42 aseerel4c26 ♦ |
We could do a better job for you with a bit more information such as the circumstances and the equipment you will be using when you wish to find your location. Ideally you should edit you question to achieve this.
http://support.google.com/maps/bin/answer.py?hl=en&answer=153802