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

roughlycuboid
11112
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:

https://switch2osm.org/using-tiles/getting-started-with-leaflet/

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 ♦
32.1k63332751
accept rate: 15%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

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:

×207
×87
×62
×22
×15

question asked: 05 Jun '15, 13:17

question was seen: 3,797 times

last updated: 05 Jun '15, 13:31

powered by OSQA