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
56
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
60
Stupid (and possibly illegal) stuff you can do with SMS, but probably shouldn't
aaronbassett
0
320
Hello to the World in 8 Web Frameworks (Micro, Batteries Included & Async)
aaronbassett
0
61
When The __future__ Becomes The Present; Dropping Python 2 Support In A Commercial Client
aaronbassett
1
73
Real-time transcription and sentiment analysis of audio streams; on the phone and in the browser
aaronbassett
0
82
Django and the testing pyramid - DjangoCon Europe 2017
aaronbassett
0
860
Avoiding the "left-pad" problem: How to secure your pip install process
aaronbassett
0
370
Sun, Sea & Pi - A Raspberry Pi day talk
aaronbassett
0
120
Having fun with testing
aaronbassett
0
75
Other Decks in Technology
See All in Technology
Webアクセシビリティ入門
recruitengineers
PRO
3
1.3k
クラウドセキュリティを支える技術と運用の最前線 / Cutting-edge Technologies and Operations Supporting Cloud Security
yuj1osm
2
200
AIとTDDによるNext.js「隙間ツール」開発の実践
makotot
6
790
Grafana MCPサーバーによるAIエージェント経由でのGrafanaダッシュボード動的生成
hamadakoji
0
690
事業価値と Engineering
recruitengineers
PRO
6
4.8k
絶対に失敗できないキャンペーンページの高速かつ安全な開発、WINTICKET × microCMS の開発事例
microcms
0
250
コスト削減の基本の「キ」~ コスト消費3大リソースへの対策 ~
smt7174
2
290
攻撃と防御で実践するプロダクトセキュリティ演習~導入パート~
recruitengineers
PRO
3
1.5k
実践アプリケーション設計 ①データモデルとドメインモデル
recruitengineers
PRO
5
1.2k
Product Management Conference -AI時代に進化するPdM-
kojima111
0
260
実践データベース設計 ①データベース設計概論
recruitengineers
PRO
4
1.7k
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
30k
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
40
2k
Code Reviewing Like a Champion
maltzj
525
40k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
How to Ace a Technical Interview
jacobian
279
23k
The World Runs on Bad Software
bkeepers
PRO
70
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
9
790
Reflections from 52 weeks, 52 projects
jeffersonlam
351
21k
Art, The Web, and Tiny UX
lynnandtonic
302
21k
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Visualization
eitanlees
147
16k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
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!