aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/geolocationcoordinates/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/web/api/geolocationcoordinates/index.html')
-rw-r--r--files/zh-cn/web/api/geolocationcoordinates/index.html116
1 files changed, 116 insertions, 0 deletions
diff --git a/files/zh-cn/web/api/geolocationcoordinates/index.html b/files/zh-cn/web/api/geolocationcoordinates/index.html
new file mode 100644
index 0000000000..7a17204abf
--- /dev/null
+++ b/files/zh-cn/web/api/geolocationcoordinates/index.html
@@ -0,0 +1,116 @@
+---
+title: Coordinates
+slug: Web/API/GeolocationCoordinates
+tags:
+ - API
+ - Geolocation API
+translation_of: Web/API/GeolocationCoordinates
+---
+<div>{{APIRef("Geolocation API")}}</div>
+
+<p><strong><code>Coordinates</code></strong> (坐标)接口表示设备在地球上的位置和海拔,以及计算这些属性的精确度。</p>
+
+<h2 id="属性">属性</h2>
+
+<p><em>The <code>Coordinates</code> interface </em><em><em>doesn't inherit any property</em></em>.</p>
+
+<dl>
+ <dt>{{domxref("Coordinates.latitude")}} {{readonlyInline}}</dt>
+ <dd>Returns a <code>double</code> representing the position's latitude in decimal degrees.</dd>
+ <dt>{{domxref("Coordinates.longitude")}} {{readonlyInline}}</dt>
+ <dd>Returns a <code>double</code> representing the position's longitude in decimal degrees.</dd>
+ <dt>{{domxref("Coordinates.altitude")}} {{readonlyInline}}</dt>
+ <dd>Returns a <code>double</code> representing the position's altitude in metres, relative to sea level. This value can be <code>null</code> if the implementation cannot provide the data.</dd>
+ <dt>{{domxref("Coordinates.accuracy")}} {{readonlyInline}}</dt>
+ <dd>Returns a <code>double</code> representing the accuracy of the <code>latitude</code> and <code>longitude</code> properties, expressed in meters.</dd>
+ <dt>{{domxref("Coordinates.altitudeAccuracy")}} {{readonlyInline}}</dt>
+ <dd>Returns a <code>double</code> representing the accuracy of the <code>altitude</code> expressed in meters. This value can be <code>null</code>.</dd>
+ <dt>{{domxref("Coordinates.heading")}} {{readonlyInline}}</dt>
+ <dd>Returns a <code>double</code> representing the direction in which the device is traveling. This value, specified in degrees, indicates how far off from heading due north the device is. <code>0</code> degrees represents true true north, and the direction is determined clockwise (which means that east is <code>90</code> degrees and west is <code>270</code> degrees). If <code>speed</code> is <code>0</code>, <code>heading</code> is <code><a href="/en-US/docs/JavaScript/Reference/Global_Objects/NaN" title="/en-US/docs/JavaScript/Reference/Global_Objects/NaN">NaN</a></code>. If the device is unable to provide <code>heading</code> information, this value is <code>null</code>.</dd>
+ <dt>{{domxref("Coordinates.speed")}} {{readonlyInline}}</dt>
+ <dd>Returns a <code>double</code> representing the velocity of the device in meters per second. This value can be <code>null</code>.</dd>
+</dl>
+
+<h2 id="方法">方法</h2>
+
+<p><em><em>The <code>Coordinates</code> interface <em>neither implements, nor inherits any method.</em></em></em></p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">Specification</th>
+ <th scope="col">Status</th>
+ <th scope="col">Comment</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName('Geolocation', '#coordinates', 'Coordinates')}}</td>
+ <td>{{Spec2('Geolocation')}}</td>
+ <td>Initial specification.</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>
+ Removed in 15.0<br>
+ Reintroduced in 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="请参见">请参见</h2>
+
+<ul>
+ <li><a href="/en-US/docs/WebAPI/Using_geolocation" title="/en-US/docs/WebAPI/Using_geolocation">Using geolocation</a></li>
+ <li>The {{domxref("Geolocation")}} interface that uses it.</li>
+</ul>