1

Google maps can give you "my location" automatically. Does it exist in OpenStreetMap ?

Thx !

asked 11 Feb '12, 10:03

donbirman's gravatar image

donbirman
40115
accept rate: 0%

edited 11 Feb '12, 10:04

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.

(12 Feb '12, 07:41) andy mackey

5 Answers:
4

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 solid black arrow icon pointing to top-right in the side bar). See: blog post explaining the new map controls.

permanent link

answered 30 Jul '13, 16:42

aseerel4c26's gravatar image

aseerel4c26 ♦
32.2k16239552
accept rate: 18%

3

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.

permanent link

answered 11 Feb '12, 21:42

Tordanik's gravatar image

Tordanik
10.9k1394134
accept rate: 33%

edited 30 Jul '13, 17:14

3

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.

permanent link

answered 11 Feb '12, 22:07

SomeoneElse's gravatar image

SomeoneElse ♦
33.0k65343778
accept rate: 16%

1

Try for example openstreetbrowser.org ... this site has an automated geo location feature.

permanent link

answered 13 Feb '12, 16:15

stephan75's gravatar image

stephan75
12.5k454209
accept rate: 6%

-3

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

permanent link

answered 11 Feb '12, 19:00

skorasaurus's gravatar image

skorasaurus
1.3k152736
accept rate: 12%

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 ♦

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×64
×34

question asked: 11 Feb '12, 10:03

question was seen: 37,673 times

last updated: 30 Jul '13, 17:14

powered by OSQA