Why not ask your question on the new OpenStreetMap Community Forum?

Ok here's the story so far... I'm a beginner programmer messing around with the GPS functionality on my browser, Google Chrome. I'm looking at different tutorials for displaying the current location of the user on a website @ W3schools and I decide to see it it were possible to do the same with Open Street Map, instead of Google Maps. How can I utilize the OSM api to take the latitude and longitude returned from my browser? I've messed around with the default iframe offered by the OSM website, but to no avail. Any tips?

asked 05 Jun '15, 13:17

roughlycuboid's gravatar image

accept rate: 0%

For a bit of background about creating a simple browser-based map that uses map tiles from OSM, have a read of this:


Leaflet (the Javascript library) supports a "locate" call - see http://leafletjs.com/reference.html . That allows you to centre the map display using the HTML Geolocation API.

permanent link

answered 05 Jun '15, 13:31

SomeoneElse's gravatar image

SomeoneElse ♦
accept rate: 16%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

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:


question asked: 05 Jun '15, 13:17

question was seen: 6,135 times

last updated: 05 Jun '15, 13:31

powered by OSQA