diff options
author | MDN <actions@users.noreply.github.com> | 2021-10-11 00:51:25 +0000 |
---|---|---|
committer | MDN <actions@users.noreply.github.com> | 2021-10-11 00:51:25 +0000 |
commit | a101c2f3857be9d799b0ee5b2c7d04b61f9e2f18 (patch) | |
tree | 344ac9b4f45a5fd982e3a3d2f05c060d3d2e2d43 /files/zh-cn/web/api/positionoptions/index.html | |
parent | b6580b050e7aaea273d6b41f0cda0fc3077afae2 (diff) | |
download | translated-content-a101c2f3857be9d799b0ee5b2c7d04b61f9e2f18.tar.gz translated-content-a101c2f3857be9d799b0ee5b2c7d04b61f9e2f18.tar.bz2 translated-content-a101c2f3857be9d799b0ee5b2c7d04b61f9e2f18.zip |
[CRON] sync translated content
Diffstat (limited to 'files/zh-cn/web/api/positionoptions/index.html')
-rw-r--r-- | files/zh-cn/web/api/positionoptions/index.html | 112 |
1 files changed, 0 insertions, 112 deletions
diff --git a/files/zh-cn/web/api/positionoptions/index.html b/files/zh-cn/web/api/positionoptions/index.html deleted file mode 100644 index 43932e7322..0000000000 --- a/files/zh-cn/web/api/positionoptions/index.html +++ /dev/null @@ -1,112 +0,0 @@ ---- -title: PositionOptions -slug: Web/API/PositionOptions -tags: - - API - - Geolocation API - - Interface - - NeedsTranslation - - Reference - - TopicStub -translation_of: Web/API/PositionOptions ---- -<div>{{APIRef("Geolocation API")}}</div> - -<p><strong><code>PositionOptions</code></strong> 是一个作为 <code><a href="https://developer.mozilla.org/zh-TW/docs/Web/API/Geolocation/getCurrentPosition" title="Geolocation.getCurrentPosition() 方法用來獲取設備當前的位置。">Geolocation.getCurrentPosition()</a>方法</code> 以及 <a href="https://developer.mozilla.org/zh-TW/docs/Web/API/Geolocation/watchPosition" title="Geolocation.watchPosition() 這個方法是用來註冊一個處理的函式,當使用者的裝置位置更新時,這個函式所傳入的回呼函式(callback function) 就會自動被呼叫。你也可以選擇性的定義錯誤時哪些錯誤回呼函式(error callback function) 需要被呼叫。"><code>Geolocation.watchPosition()</code></a> 方法参数的选项,此选项含有3种可以设置的属性。</p> - -<h2 id="属性">属性</h2> - -<p><em><code>PositionOptions</code> 接口不继承任何属性。</em></p> - -<dl> - <dt>{{domxref("PositionOptions.enableHighAccuracy")}}</dt> - <dd>是一个 {{domxref("Boolean")}} 值。这个布尔值用来表明应用是否使用其最高精度来表示结果。如果值为 <code>true</code> ,同时设备能够提供一个更精确的位置,那么设备就会使用这个位置。注意,这会导致较慢的响应时间或者增加电量消耗(比如对于支持gps的移动设备来说)。如果值为<code>false</code> ,设备会通过更快响应以及/或者使用更少的电量等方法来尽可能的节约资源。默认值: <code>false</code>。</dd> - <dt>{{domxref("PositionOptions.timeout")}}</dt> - <dd>的值是一个正的 <code>long</code> 值。它表明的是设备必须在多长时间(单位毫秒)内返回一个位置。默认值是 <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Infinity">Infinity</a></code>,意思是获取到一个位置之后, <code>getCurrentPosition()</code> 才会返回一个值。</dd> - <dt>{{domxref("PositionOptions.maximumAge")}}</dt> - <dd>是一个正的 <code>long</code> 值。它表明可以返回多长时间(即最长年龄,单位毫秒)内的可获取的缓存位置。如果设置为 <code>0</code>, 说明设备不能使用一个缓存位置,而且必须去获取一个真实的当前位置。如果设置为 <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/Infinity">Infinity</a></code> ,那么不管设置的最长年龄是多少,设备都必须返回一个缓存位置。默认值:0。</dd> -</dl> - -<h2 id="方法">方法</h2> - -<p><code>PositionOptions</code> 接口既<em>不实现,也不继承任何方法。</em></p> - -<h2 id="规范">规范</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">规范</th> - <th scope="col">状态</th> - <th scope="col">Commet</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('Geolocation', '#positionoptions', 'PositionOptions')}}</td> - <td>{{Spec2('Geolocation')}}</td> - <td>Initial definition</td> - </tr> - </tbody> -</table> - -<h2 id="浏览器兼容性">浏览器兼容性</h2> - -<p>{{CompatibilityTable}}</p> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Basic support</td> - <td>5</td> - <td>{{CompatGeckoDesktop("1.9.1")}}</td> - <td>9</td> - <td>10.60<br> - {{CompatNo}} 15.0<br> - 16.0</td> - <td>5</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Feature</th> - <th>Android</th> - <th>Chrome for Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Basic support</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatUnknown}}</td> - <td>{{CompatGeckoMobile("4")}}</td> - <td>{{CompatUnknown}}</td> - <td>10.60</td> - <td>{{CompatUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="See_also">See also</h2> - -<ul> - <li><a href="https://developer.mozilla.org/zh-CN/docs/Web/API/Geolocation/Using_geolocation" title="/en-US/docs/WebAPI/Using_geolocation">使用地理位置定位</a></li> - <li>The {{domxref("Geolocation")}} interface that uses it.</li> -</ul> |