Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <h2 id="overview">Overview</h2> | |
| 2 <p> | |
| 3 To start retrieving the location, you need to create a location watch by | |
|
Andy
2013/07/30 20:26:14
"the location" --> "location information"
vadimt
2013/08/01 00:02:02
Done.
| |
| 4 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 to $ref:location.onLocationUpdate event. | |
|
Andy
2013/07/30 20:26:14
"to" --> "for the"
vadimt
2013/08/01 00:02:02
Done.
| |
| 12 Chrome will fire this event after you create your location watch. After this, | |
|
Andy
2013/07/30 20:26:14
It's not clear what "this" refers to in "After thi
vadimt
2013/08/01 00:02:02
Done.
| |
| 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> | |
| OLD | NEW |