w3c geolocation api - making websites location-aware

54
W3C Geolocation API Making Websites Location-aware Wednesday, April 1, 2009

Post on 17-Oct-2014

32.843 views

Category:

Technology


1 download

DESCRIPTION

my slides from the Web 2.0 Expo session on the W3C Geolocation API

TRANSCRIPT

Page 1: W3C Geolocation API - Making Websites Location-aware

W3C Geolocation APIMaking Websites Location-aware

Wednesday, April 1, 2009

Page 2: W3C Geolocation API - Making Websites Location-aware

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

Page 3: W3C Geolocation API - Making Websites Location-aware

practical tools to allow you to add location capabilities to

your website today

Wednesday, April 1, 2009

Page 4: W3C Geolocation API - Making Websites Location-aware

What is Geolocation?

History of Geolocation on the web

Current State of the Union

Location Technologies

Code Examples

Questions

Wednesday, April 1, 2009

Page 5: W3C Geolocation API - Making Websites Location-aware

location = context

Wednesday, April 1, 2009

Page 6: W3C Geolocation API - Making Websites Location-aware

context = higher relevancy

Wednesday, April 1, 2009

Page 7: W3C Geolocation API - Making Websites Location-aware

location = higher relevancy

Wednesday, April 1, 2009

Page 8: W3C Geolocation API - Making Websites Location-aware

location comes in many flavors

Wednesday, April 1, 2009

Page 9: W3C Geolocation API - Making Websites Location-aware

37.78467, -122.40162

Wednesday, April 1, 2009

Page 10: W3C Geolocation API - Making Websites Location-aware

Wednesday, April 1, 2009

Page 11: W3C Geolocation API - Making Websites Location-aware

747 Howard St, San Francisco, CA

Wednesday, April 1, 2009

Page 12: W3C Geolocation API - Making Websites Location-aware

4th St & Howard St

Wednesday, April 1, 2009

Page 13: W3C Geolocation API - Making Websites Location-aware

Soma

Wednesday, April 1, 2009

Page 14: W3C Geolocation API - Making Websites Location-aware

Pete’s Coffee

Wednesday, April 1, 2009

Page 15: W3C Geolocation API - Making Websites Location-aware

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

Page 16: W3C Geolocation API - Making Websites Location-aware

how you display it can be used as a way

of blurring location

Wednesday, April 1, 2009

Page 17: W3C Geolocation API - Making Websites Location-aware

Ryan checked into The Mission

Wednesday, April 1, 2009

Page 18: W3C Geolocation API - Making Websites Location-aware

map markers can be misleading when dealing

with user’s location

... maybe use text insteadWednesday, April 1, 2009

Page 19: W3C Geolocation API - Making Websites Location-aware

Wednesday, April 1, 2009

Page 20: W3C Geolocation API - Making Websites Location-aware

Wednesday, April 1, 2009

Page 21: W3C Geolocation API - Making Websites Location-aware

so, why should I use it?

Wednesday, April 1, 2009

Page 22: W3C Geolocation API - Making Websites Location-aware

Wednesday, April 1, 2009

Page 23: W3C Geolocation API - Making Websites Location-aware

HISTORYa lot has changed in a year

Wednesday, April 1, 2009

Page 24: W3C Geolocation API - Making Websites Location-aware

Wednesday, April 1, 2009

Page 25: W3C Geolocation API - Making Websites Location-aware

locationaware.org

Wednesday, April 1, 2009

Page 26: W3C Geolocation API - Making Websites Location-aware

Google Gears

Wednesday, April 1, 2009

Page 27: W3C Geolocation API - Making Websites Location-aware

W3C Geolocation API

Wednesday, April 1, 2009

Page 28: W3C Geolocation API - Making Websites Location-aware

coalition of the willing

Wednesday, April 1, 2009

Page 29: W3C Geolocation API - Making Websites Location-aware

state of the union

http://www.flickr.com/photos/xrrr/2478140383/Wednesday, April 1, 2009

Page 30: W3C Geolocation API - Making Websites Location-aware

2009 is the year of location in the

Browser

Wednesday, April 1, 2009

Page 31: W3C Geolocation API - Making Websites Location-aware

• 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

Page 33: W3C Geolocation API - Making Websites Location-aware

Location Technologies

Wednesday, April 1, 2009

Page 34: W3C Geolocation API - Making Websites Location-aware

Two primary methods

1. IP Geolocation2.Triangulation

• GPS

• Wi-Fi

• Cell Tower

Wednesday, April 1, 2009

Page 35: W3C Geolocation API - Making Websites Location-aware

IP Geolocation• Widely available

• Detection happens server-side

Pros

• Only accurate to the city-level

• Only in the right state 85% of the time

• Costly

• Produces false positives

Cons

Wednesday, April 1, 2009

Page 36: W3C Geolocation API - Making Websites Location-aware

IP Geolocation

• 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

Vendors

Wednesday, April 1, 2009

Page 37: W3C Geolocation API - Making Websites Location-aware

10 m20 m

1000 m

GPSWi-Fi

Cell Tower

Triangulation

Wednesday, April 1, 2009

Page 38: W3C Geolocation API - Making Websites Location-aware

GPS• Accurate after it gets a fix

• Highly accurate in rural area

Pros

• Doesn’t work indoors

• Difficulty with Urban Canyons

• Long Time to First Fix

Cons

Wednesday, April 1, 2009

Page 39: W3C Geolocation API - Making Websites Location-aware

Wi-Fi Triangulation

Wednesday, April 1, 2009

Page 40: W3C Geolocation API - Making Websites Location-aware

Wi-Fi Positioning (WPS)• Accurate

• Works indoors and in Urban Areas

• Quick Time to First Fix

• Software-only, leverages existing Wi-Fi

Pros

• Doesn’t work well in rural areasCons

Wednesday, April 1, 2009

Page 41: W3C Geolocation API - Making Websites Location-aware

• 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

Page 42: W3C Geolocation API - Making Websites Location-aware

Cell Triangulation• Works where there is cell coverage (most

areas)

• Quick Time to First Fix

• Software-only, leverages existing cellular radio

Pros

• Very inaccurateCons

Wednesday, April 1, 2009

Page 43: W3C Geolocation API - Making Websites Location-aware

short answerhyrbid is the way

Wednesday, April 1, 2009

Page 44: W3C Geolocation API - Making Websites Location-aware

W3C Geolocation API

... shut up and get to the code

Wednesday, April 1, 2009

Page 45: W3C Geolocation API - Making Websites Location-aware

Single shot lookup

navigator.geolocation.getCurrentPosition(function(pos){

//show map at (pos.coords.latitude, pos.coords.longitude)

});

Wednesday, April 1, 2009

Page 47: W3C Geolocation API - Making Websites Location-aware

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

Page 49: W3C Geolocation API - Making Websites Location-aware

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

Page 51: W3C Geolocation API - Making Websites Location-aware

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

Page 52: W3C Geolocation API - Making Websites Location-aware

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

Page 53: W3C Geolocation API - Making Websites Location-aware

Upcoming Geo Events• Where 2.0

San Jose, CAMay 19th - 21st

• WhereCampSan Francisco, CAMay 23rd - 24th

Wednesday, April 1, 2009

Page 54: W3C Geolocation API - Making Websites Location-aware

Questions?tweet @rsarver with questions as well

Wednesday, April 1, 2009