$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to Geolocation
Search
Aaron Bassett
July 01, 2009
Technology
0
58
Introduction to Geolocation
Just after the Geolocation APIs were released I gave an introductory talk about them at Techmeetup
Aaron Bassett
July 01, 2009
Tweet
Share
More Decks by Aaron Bassett
See All by Aaron Bassett
When your wetware has too many threads - Tips from an ADHDer on how to improve your focus
aaronbassett
1
63
Stupid (and possibly illegal) stuff you can do with SMS, but probably shouldn't
aaronbassett
0
350
Hello to the World in 8 Web Frameworks (Micro, Batteries Included & Async)
aaronbassett
0
64
When The __future__ Becomes The Present; Dropping Python 2 Support In A Commercial Client
aaronbassett
1
81
Real-time transcription and sentiment analysis of audio streams; on the phone and in the browser
aaronbassett
0
84
Django and the testing pyramid - DjangoCon Europe 2017
aaronbassett
0
890
Avoiding the "left-pad" problem: How to secure your pip install process
aaronbassett
0
380
Sun, Sea & Pi - A Raspberry Pi day talk
aaronbassett
0
130
Having fun with testing
aaronbassett
0
80
Other Decks in Technology
See All in Technology
30分であなたをOmniのファンにしてみせます~分析画面のクリック操作をそのままコード化できるAI-ReadyなBIツール~
sagara
0
140
エンジニアリングマネージャー はじめての目標設定と評価
halkt
0
280
AWS re:Invent 2025で見たGrafana最新機能の紹介
hamadakoji
0
370
Ruby で作る大規模イベントネットワーク構築・運用支援システム TTDB
taketo1113
1
280
regrowth_tokyo_2025_securityagent
hiashisan
0
230
Kubernetes Multi-tenancy: Principles and Practices for Large Scale Internal Platforms
hhiroshell
0
120
生成AIでテスト設計はどこまでできる? 「テスト粒度」を操るテーラリング術
shota_kusaba
0
740
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
120
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
AIと二人三脚で育てた、個人開発アプリグロース術
zozotech
PRO
1
720
Debugging Edge AI on Zephyr and Lessons Learned
iotengineer22
0
180
品質のための共通認識
kakehashi
PRO
3
260
Featured
See All Featured
Designing for humans not robots
tammielis
254
26k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
RailsConf 2023
tenderlove
30
1.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Mobile First: as difficult as doing things right
swwweet
225
10k
What's in a price? How to price your products and services
michaelherold
246
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
Code Review Best Practice
trishagee
74
19k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Thoughts on Productivity
jonyablonski
73
5k
Transcript
Geolocation
Aaron Bassett aaronbassett.com twitter.com/aaronbassett
“Geolocation is the identification of the real-world geographic location of
an Internet-connected computer, mobile device, website visitor or other.” Wikipedia
Devices
Geolocation API
Privacy Have to give permission Can alter accuracy Might reject
you Be trustworthy
http://bit.ly/please-work
<header> <hgroup> <h1>Geolocation Demo</h1> <h2>for <a href='http://techmeetup.co.uk/blog/2009/11/announcing-techmeetup-glasgow-7/'> Glasgow Tech Meetup</a></h2>
</hgroup> </header> <div id='map'> <p><small><!-- map goes here --></small></p> </div> <p id='message'><strong>Status:</strong> <em id='status'>waiting...</em></p> <footer> <p><a href='https://github.com/aaronbassett/TMU-Geolocation'>download source from Github</a></p> </footer> <script type='text/javascript'> function success(position) { var s = document.getElementById('status'); if (s.className == 'success') { // not sure why we're hitting this twice in FF, // I think it's to do with a cached result coming back return; } s.innerHTML = "found you!"; s.className = 'success'; var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); var myOptions = { zoom: 15, center: latlng, mapTypeControl: false, navigationControlOptions: {style: google.maps.NavigationControlStyle.SMALL}, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map"), myOptions); var marker = new google.maps.Marker({ position: latlng, map: map, title:"You are here!" }); } function error(msg) { var s = document.getElementById('status'); s.innerHTML = typeof msg == 'string' ? msg : "failed"; s.className = 'error'; } if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(success, error); } else { error('not supported'); } </script>
Example function success(pos) { alert(pos.coords.latitude+" : "+pos.coords.longitude); } function error(msg)
{ msg = (typeof msg == 'string') ? msg : "couldn't find you :("; alert(msg); } if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(success, error); } else { error('not supported'); }
/* GeoFill by Christian Heilmann Version: 1.1 Homepage: http://icant.co.uk/geofill Copyright
(c) 2009, Christian Heilmann Code licensed under the BSD License */
In the wild
What not to do
github.com/aaronbassett/TMU- Geolocation
Thank you for listening no hard questions, plzkthnx!