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..0e995327cefd2e998cc714f4e3ff48cef8b09c28 |
--- /dev/null |
+++ b/chrome/common/extensions/docs/templates/intros/location.html |
@@ -0,0 +1,24 @@ |
+<h2 id="overview">Overview</h2> |
+<p> |
+ 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.
|
+ calling $ref:location.watchLocation, passing in |
+ the location watch details via the <code>requestInfo</code> parameter: |
+</p> |
+ |
+<pre>chrome.location.watchLocation(name, requestInfo);</pre> |
+<p> |
+ You also need to add a listener |
+ to $ref:location.onLocationUpdate event. |
Andy
2013/07/30 20:26:14
"to" --> "for the"
vadimt
2013/08/01 00:02:02
Done.
|
+ 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.
|
+ it will keep firing the event every time the geographic |
+ location of the host machine changes, until you call $ref:location.clearWatch. |
+</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> |