Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/common/extensions/docs/templates/intros/location.html

Issue 19763008: Adding dev documentation for chrome.location (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Final comments. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <h2 id="overview">Overview</h2>
2 <p>
3 To start retrieving location information, you need to create a location watch
4 by calling $ref:location.watchLocation, passing in
5 the location watch details via the <code>requestInfo</code> parameter:
6 </p>
7
8 <pre>chrome.location.watchLocation(name, requestInfo);</pre>
9 <p>
10 You also need to add a listener
11 for the $ref:location.onLocationUpdate event.
12 Chrome will fire this event after you create your location watch, and
13 it will keep firing the event every time the geographic
14 location of the host machine changes, until you call $ref:location.clearWatch.
15 </p>
16 <p>
17 Here's sample code
18 to listen for location updates:
19 </p>
20 <pre>
21 chrome.location.onLocationUpdate.addListener(function(position) {
22 console.log(JSON.stringify(position));
23 });
24 </pre>
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/location.idl ('k') | chrome/common/extensions/docs/templates/public/apps/location.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698