2. me
• Director of Consumer Products at Skyhook
Wireless
• Founded Locationaware.org which
eventually became W3C Geolocation API
Working Group
• Follow @rsarver to get the SlideShare link
for slides after I post them
Wednesday, April 1, 2009
3. practical tools to allow you to
add location capabilities to
your website today
Wednesday, April 1, 2009
4. What is Geolocation?
History of Geolocation on the web
Current State of the Union
Location Technologies
Code Examples
Questions
Wednesday, April 1, 2009
15. Business Search APIs
• Yahoo Local Search API
• Yelp API
• Localeze - sells business listing
information
• small businesses are tough, no db is
totally complete
Wednesday, April 1, 2009
16. how you display it
can be used as a way
of blurring location
Wednesday, April 1, 2009
29. state of the union
http://www.flickr.com/photos/xrrr/2478140383/
Wednesday, April 1, 2009
30. 2009 is the year of
location in the
Browser
Wednesday, April 1, 2009
31. • Geode Extension in Mozilla Labs.
Powered by Skyhook
• W3C Geolocation API support
natively in 3.1 (now called 3.5)
• Opera Labs release with W3C
Geolocation API support. Powered
by Skyhook
• Support in Chrome for Windows
and Android
Wednesday, April 1, 2009
32. http://bit.ly/mozilla-geode
http://bit.ly/opera-geolocation
http://google.com/chrome
Wednesday, April 1, 2009
34. Two primary methods
1. IP Geolocation
2. Triangulation
• GPS
• Wi-Fi
• Cell Tower
Wednesday, April 1, 2009
35. IP Geolocation
Pros
• Widely available
• Detection happens server-side
Cons
• Only accurate to the city-level
• Only in the right state 85% of the time
• Costly
• Produces false positives
Wednesday, April 1, 2009
36. IP Geolocation
Vendors
• MaxMind - http://www.maxmind.com
• Has a free database - GeoLite City
• Quova - http://www.quova.com
• IPligence - http://www.ipilgence.com
• IP2Location - http://www.ip2location.com
Wednesday, April 1, 2009
37. Triangulation
GPS 10 m
Wi-Fi 20 m
Cell Tower 1000 m
Wednesday, April 1, 2009
38. GPS
Pros
• Accurate after it gets a fix
• Highly accurate in rural area
Cons
• Doesn’t work indoors
• Difficulty with Urban Canyons
• Long Time to First Fix
Wednesday, April 1, 2009
40. Wi-Fi Positioning (WPS)
Pros
• Accurate
• Works indoors and in Urban Areas
• Quick Time to First Fix
• Software-only, leverages existing Wi-Fi
Cons
• Doesn’t work well in rural areas
Wednesday, April 1, 2009
41. • Cross-platform, cross-browser plugin for
adding geolocation to any website
• Locate a user down to their exact street
address with a few lines of javascript
• http://loki.com/how
• </plug>
Wednesday, April 1, 2009
42. Cell Triangulation
Pros
• Works where there is cell coverage (most
areas)
• Quick Time to First Fix
• Software-only, leverages existing cellular
radio
Cons
• Very inaccurate
Wednesday, April 1, 2009
43. short answer
hyrbid is the way
Wednesday, April 1, 2009
44. W3C Geolocation API
... shut up and get to the code
Wednesday, April 1, 2009
45. Single shot lookup
navigator.geolocation.getCurrentPosition(function(pos){
//show map at (pos.coords.latitude, pos.coords.longitude)
});
Wednesday, April 1, 2009
47. Single shot lookup w/
callbacks
function showMap(pos) {
//show map at pos.coords.latitude, pos.coords.longitude
}
function showError(err) {
alert(err.message + ‘, ’ + err.code);
}
navigator.geolocation.getCurrentPosition(showMap, showError);
Wednesday, April 1, 2009
48. PositionError Object
interface PositionError {
const unsigned short UNKNOWN_ERROR = 0;
const unsigned short PERMISSION_DENIED = 1;
const unsigned short POSITION_UNAVAILABLE = 2;
const unsigned short TIMEOUT = 3;
readonly unsigned short code;
readonly DOMString message;
};
Wednesday, April 1, 2009
49. Single shot lookup w/
callbacks & options
function showMap(pos) {
//show map at pos.coords.latitude, pos.coords.longitude
}
function showError(err) {
alert(err.message + ‘, ’ + err.code);
}
navigator.geolocation.getCurrentPosition(showMap, showError,
{enableHighAccuracy:true});
Wednesday, April 1, 2009
50. PositionOptions
interface PositionOptions {
attribute boolean enableHighAccuracy;
attribute long timeout;
attribute long maximumAge;
};
Wednesday, April 1, 2009
51. Single shot lookup w/
cached position
function showMap(pos) {
//show map at pos.coords.latitude, pos.coords.longitude
}
function showError(err) {
alert(err.message + ‘, ’ + err.code);
}
navigator.geolocation.getCurrentPosition(showMap, showError,
{maximumAge:300000, timeout:0});
Wednesday, April 1, 2009
52. Periodic lookup w/
callbacks
function moveMap(pos) {
//update map to pos.coords.latitude, pos.coords.longitude
}
function showError(err) {
alert(err.message + ‘, ’ + err.code);
}
// Track location with periodic updates
watchId = navigator.geolocation.watchPosition(moveMap, showError);
function stopTracking() {
navigator.geolocation.clearWatch(watchId);
}
Wednesday, April 1, 2009
53. Upcoming Geo Events
• Where 2.0
San Jose, CA
May 19th - 21st
• WhereCamp
San Francisco, CA
May 23rd - 24th
Wednesday, April 1, 2009
54. Questions?
tweet @rsarver with questions as well
Wednesday, April 1, 2009
Notes de l'éditeur
- who here runs a website?
- who here uses location of some kind on their website?
- mobile?
- who here already knows Skyhook?
- its important that you can leave here
- leave lots of time for questions at the end
- location is a proxy to lots of metadata - rich demographic data
- context about the physical surroundings of the user
- events they might be at
- nearby POIs
- time of day, weather
- the more context you have the more relevant the experience you can delivery
- deliver the most highly relevant experience to your users
- use most accurate location available
- so lets define “location”
- what does that mean?
- going to become important that sites can work with lat/lon
- w3c api will always deliver you a lat/lon
- start to architect your apps to store lat/lon as well
- anyone here use brightkite or foursquare?
- disambiguate lat/lon into something meaningful. business names are great
- also consider using custom place names
- some location information is only relevant to nearby users
- placenames, neighborhoods
- add higher-level context for other users
- maps can be a misnomer bc users dont always want to share exact location
- EXAMPLE: user is in San Francisco -- where do you put the marker?
- consider text display
- Here is a video of BrightKite using auto-location
- gives you a feel for how other sites are doing it
- relevancy. too much noise, not enough signal
- location is a piece of metadata that can make the entire web more relevant
- better user experience
- geotag photos, share location on social networks, local search, local news
- Lets take a store finder as an example
- each dot represents a Dunkin Donuts in Boston
- if you ask a user to tell you where they are, they will say “boston” or “02218”
- using precise location allows you to instantly show them the correct location and start to route them there
- A lot has changed in one year, since i was here last
- last year i was talking about the how it was coming together and some tools
- now, W3C working group and 3 major browser vendors you can download today
- Loki was launched at Where 2.0 in 2006
- toolbar to get skyhook’s technology into the browser
- eventually made a javascript API to the toolbar
- May 2006
- i realized the only way for this to grow was to get consensus among browser vendors
- needed to evangelize the idea of location on the web
- no one knew you could make a laptop a gps-like device
- pre iPhone
- google picked it up, added it to Gears
- started with cell positioning for mobile devices
- created their own Javascript API
- June 2008
- standardize the way geolocation is exposed through the browser
- all major vendors are involved
- already getting to draft
- KISS
“its all coming together”
- bold proclamation
- location was always the technology of next year, well its finally next year
- desktops, laptops and netbooks will all be location enabled
- accuracy is directly proportional to cell size
- gps, wps = street address accuracy
- cell = neighborhood / city accuracy
- instead of waiting for all the browsers, add it now
- cross platform, cross browser
- on MapQuest.com/findme
- Wi-Fi positioning is primary, IP as a fallback
- REALLY this simple to add location to your website
enableHighAccuracy will probably change
do this to save a new location request. power friendly
position <= 5 minutes
timeout:0 = return cached position
do this to save a new location request. power friendly
position <= 5 minutes
timeout:0 = return cached position
- if you are looking to get more involved in geo, there are some great events to attend