| OLD | NEW |
| (Empty) | |
| 1 <p id="classSummary"> |
| 2 To create a location watch, call $ref:location.watchLocation passing in |
| 3 the location watch details via the <code>requestInfo</code> parameter: |
| 4 </p> |
| 5 |
| 6 <pre>chrome.location.watchLocation(name, requestInfo);</pre> |
| 7 <p> |
| 8 You'll also need to add a listener |
| 9 to its <code>onChanged</code> event. |
| 10 Chrome will fire this event after you create your location watch. After this, |
| 11 it will keep firing the event every time the geographical location of your |
| 12 computer changes until you call $ref:location.clearWatch. |
| 13 </p> |
| 14 <p> |
| 15 Here's sample code |
| 16 to listen for location updates: |
| 17 </p> |
| 18 <pre> |
| 19 chrome.location.onLocationUpdate.addListener(function(position) { |
| 20 console.log(JSON.stringify(position)); |
| 21 }); |
| 22 </pre> |
| OLD | NEW |