5 ms·
Using HTML5 geolocation API to get the distance of the visitor from me
- tadruj 15y agoSince JavaScript has 64-bit floating points you could use simpler Spherical law of Cosines (cos c = cos a cos b + sin a sin b cos C) instead of Haversine to calculate distance.
- deleted 15y ago[deleted]
- ColinWright 15y agoI have a feeling that it was only trivial to you because it closely matches the technology that you use. For me it was interesting and novel. I don't write web apps or web sites, I don't use HTML5 or JavaScript. I program safety-critical and security services on big iron and embedded devices, and this was a decent insight into a different world. My knowledge is different from yours. As you said: "What happened to Hacker News? It evolved." There are people here other than just clones of you.
- abava 15y agoYou can see that on the map. Visiting http://wayn.linkstore.ru http://wayn.linkstore.ru (on phones with Javascript support) will open the phone's email app with a canned message titled "Where are you now?" and a link to GeoMail in the email body. If the recipient is using a phone that supports the HTML5 location provider API, such as an Android or Samsung Bada device or an iPhone, when they click the link it will launch GeoMail webapp which lets them reply with a link to a Google Map showing their location.
- klinquist 15y agoThe author is incorrect about that being html5 - it's javascript. I did this over two years ago with the same js call - I work for a company with multiple buildings. Go to a web page and you'll see a list of conference rooms in the buildings you are closest to and their availability. Found a web page to batch convert addresses to lat/long - made it pretty easy. Here's something I wrote at the same time that shows your proximity to a city zip code. http://www.linquist.net/geo.php http://www.linquist.net/geo.php
- Volpe 15y agoNo, he is right. It is html5 (or commonly referred to as such). html5 is used to describe more than just the markup, it is also used to describe, location services, localStorage, etc.
- sleepyhead 15y agoBut please don't do this. "X.com wants to know your location - Ok - Cancel". Meh.
- obtino 15y agoGeolocation is not a part of the HTML5 specification!