Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
51
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
50
Stupid (and possibly illegal) stuff you can do with SMS, but probably shouldn't
aaronbassett
0
250
Hello to the World in 8 Web Frameworks (Micro, Batteries Included & Async)
aaronbassett
0
50
When The __future__ Becomes The Present; Dropping Python 2 Support In A Commercial Client
aaronbassett
1
59
Real-time transcription and sentiment analysis of audio streams; on the phone and in the browser
aaronbassett
0
71
Django and the testing pyramid - DjangoCon Europe 2017
aaronbassett
0
750
Avoiding the "left-pad" problem: How to secure your pip install process
aaronbassett
0
350
Sun, Sea & Pi - A Raspberry Pi day talk
aaronbassett
0
110
Having fun with testing
aaronbassett
0
54
Other Decks in Technology
See All in Technology
Storybook との上手な向き合い方を考える
re_taro
5
1.2k
アプリエンジニアのためのGraphQL入門.pdf
spycwolf
0
110
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
アジャイルチームがらしさを発揮するための目標づくり / Making the goal and enabling the team
kakehashi
3
160
Mastering Quickfix
daisuzu
1
190
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
Next.jsとNuxtが混在? iframeでなんとかする!
ypresto
1
150
エンジニア人生の拡張性を高める 「探索型キャリア設計」の提案
tenshoku_draft
1
130
OCI Vault 概要
oracle4engineer
PRO
0
9.7k
VideoMamba: State Space Model for Efficient Video Understanding
chou500
0
200
テストコード品質を高めるためにMutation Testingライブラリ・Strykerを実戦導入してみた話
ysknsid25
7
2.7k
静的解析で実現した効率的なi18n対応の仕組みづくり
minako__ph
1
120
Featured
See All Featured
Scaling GitHub
holman
458
140k
What's new in Ruby 2.0
geeforr
343
31k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
GraphQLとの向き合い方2022年版
quramy
43
13k
Bash Introduction
62gerente
608
210k
Designing for humans not robots
tammielis
250
25k
Making Projects Easy
brettharned
115
5.9k
Agile that works and the tools we love
rasmusluckow
327
21k
How to train your dragon (web standard)
notwaldorf
88
5.7k
Unsuck your backbone
ammeep
668
57k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
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!