Chromium Code Reviews| Index: chrome/common/extensions/docs/templates/intros/location.html |
| diff --git a/chrome/common/extensions/docs/templates/intros/location.html b/chrome/common/extensions/docs/templates/intros/location.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9bbb8990e1a05c51843eebd3c08df08d11ac2289 |
| --- /dev/null |
| +++ b/chrome/common/extensions/docs/templates/intros/location.html |
| @@ -0,0 +1,22 @@ |
| +<p id="classSummary"> |
|
Jeffrey Yasskin
2013/07/27 03:00:29
Does this id do anything visible in the UI? Would
vadimt
2013/07/30 01:58:41
Done.
|
| + To create a location watch, call $ref:location.watchLocation passing in |
|
Andy
2013/07/30 00:56:06
Before you explain how to create a location watch,
vadimt
2013/07/30 01:58:41
Done.
|
| + the location watch details via the <code>requestInfo</code> parameter: |
| +</p> |
| + |
| +<pre>chrome.location.watchLocation(name, requestInfo);</pre> |
| +<p> |
| + You'll also need to add a listener |
|
Andy
2013/07/30 00:56:06
Suggestion: "You'll also" --> "You also"
vadimt
2013/07/30 01:58:41
Done.
|
| + to its <code>onChanged</code> event. |
|
Andy
2013/07/30 00:56:06
What does "its" refer to here?
vadimt
2013/07/30 01:58:41
Done.
|
| + Chrome will fire this event after you create your location watch. After this, |
| + it will keep firing the event every time the geographical location of your |
| + computer changes until you call $ref:location.clearWatch. |
|
Andy
2013/07/30 00:56:06
Suggestion: "the geographical location of your com
vadimt
2013/07/30 01:58:41
Done.
|
| +</p> |
| +<p> |
| + Here's sample code |
| + to listen for location updates: |
| +</p> |
| +<pre> |
| + chrome.location.onLocationUpdate.addListener(function(position) { |
| + console.log(JSON.stringify(position)); |
| + }); |
| +</pre> |