Interactive Bit!
Matt Womer: mdw@w3.org
What's a widget?
"A widget is an interactive single purpose application for displaying and/or updating local data or data on the Web, packaged in a way to allow a single download and installation on a user's machine or mobile device. A widget may run as a stand alone application (meaning it can run outside of a Web browser), or may be embedded into a Web document."
Web Applications Working Group
Co-chairs:
Team Contact: Doug Schepers
Requirements gathered in several areas:
The result?
Follow http://twitter.com/widgetspecs
There are a lot of ways to obtain location information:
And if you're lucky enough to have a browser that can access location information, it's likely to not work with another browser...
Creating a single Web API for accessing location information:
Some uses:
function showMap(position) {
// Show a map centered at
// at (position.latitude, position.longitude).
// your code here!
}
// One-shot position request.
navigator.geolocation.getCurrentPosition(showMap);
function scrollMap(position) {
// Scrolls the map so it is centered
// at (position.latitude, position.longitude).
// your code here!
}
// Request repeated updates.
var watchId = navigator.geolocation.watchPosition(scrollMap);
function buttonClickHandler()
{
// Cancel when user clicks button
navigator.geolocation.clearWatch(watchId);
}
interface Geolocation {
readonly attribute Position lastPosition;
void getCurrentPosition(in
PositionCallback successCallback);
…
int watchPosition(in
PositionCallback successCallback);
…
void clearWatch(in int watchId);
};
interface PositionCallback {
void handleEvent(in Position position);
};
interface Position {
readonly attribute double latitude;
readonly attribute double longitude;
readonly attribute double accuracy;
readonly attribute double altitude;
readonly attribute double altitudeAccuracy;
readonly attribute double heading
readonly attribute double velocity
readonly attribute DOMTimeStamp timestamp;
};
We're working in the public!