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"> |
+ To create a location watch, call $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'll also need to add a listener |
+ to its <code>onChanged</code> event. |
+ 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. |
+</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> |