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
52
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
56
Stupid (and possibly illegal) stuff you can do with SMS, but probably shouldn't
aaronbassett
0
280
Hello to the World in 8 Web Frameworks (Micro, Batteries Included & Async)
aaronbassett
0
54
When The __future__ Becomes The Present; Dropping Python 2 Support In A Commercial Client
aaronbassett
1
63
Real-time transcription and sentiment analysis of audio streams; on the phone and in the browser
aaronbassett
0
77
Django and the testing pyramid - DjangoCon Europe 2017
aaronbassett
0
810
Avoiding the "left-pad" problem: How to secure your pip install process
aaronbassett
0
360
Sun, Sea & Pi - A Raspberry Pi day talk
aaronbassett
0
120
Having fun with testing
aaronbassett
0
60
Other Decks in Technology
See All in Technology
内製化を加速させるlaC活用術
nrinetcom
PRO
2
130
Perlの生きのこり - エンジニアがこの先生きのこるためのカンファレンス2025
kfly8
2
260
Cracking the Coding Interview 6th Edition
gdplabs
14
28k
「正しく」失敗できる チームの作り方 〜リアルな事例から紐解く失敗を恐れない組織とは〜 / A team that can fail correctly
i35_267
4
780
ESXi で仮想化した ARM 環境で LLM を動作させてみるぞ
unnowataru
0
160
わたしのOSS活動
kazupon
2
340
AWSを活用したIoTにおけるセキュリティ対策のご紹介
kwskyk
0
310
Snowflakeの開発・運用コストをApache Icebergで効率化しよう!~機能と活用例のご紹介~
sagara
1
380
プロダクトエンジニア 360°フィードバックを実施した話
hacomono
PRO
0
140
AIエージェント元年
shukob
0
150
クラウドサービス事業者におけるOSS
tagomoris
4
990
分解して理解する Aspire
nenonaninu
2
880
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
52k
The Cost Of JavaScript in 2023
addyosmani
47
7.4k
Mobile First: as difficult as doing things right
swwweet
223
9.4k
The Cult of Friendly URLs
andyhume
78
6.2k
Building an army of robots
kneath
303
45k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
How to train your dragon (web standard)
notwaldorf
91
5.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Git: the NoSQL Database
bkeepers
PRO
427
65k
GraphQLとの向き合い方2022年版
quramy
44
14k
Making Projects Easy
brettharned
116
6k
Building Applications with DynamoDB
mza
93
6.2k
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!