From febc362abf2ea4dc4bd87ca2a52b09d23236ab83 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Thu, 3 Feb 2022 09:51:47 +0900 Subject: GeolocationCoordinates 以下を移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/geolocationcoordinates/accuracy/index.md | 43 +++++++ .../api/geolocationcoordinates/altitude/index.md | 44 +++++++ .../altitudeaccuracy/index.md | 42 +++++++ .../api/geolocationcoordinates/heading/index.md | 46 ++++++++ files/ja/web/api/geolocationcoordinates/index.html | 69 ----------- files/ja/web/api/geolocationcoordinates/index.md | 69 +++++++++++ .../api/geolocationcoordinates/latitude/index.md | 38 ++++++ .../api/geolocationcoordinates/longitude/index.md | 127 +++++++++++++++++++++ .../web/api/geolocationcoordinates/speed/index.md | 40 +++++++ 9 files changed, 449 insertions(+), 69 deletions(-) create mode 100644 files/ja/web/api/geolocationcoordinates/accuracy/index.md create mode 100644 files/ja/web/api/geolocationcoordinates/altitude/index.md create mode 100644 files/ja/web/api/geolocationcoordinates/altitudeaccuracy/index.md create mode 100644 files/ja/web/api/geolocationcoordinates/heading/index.md delete mode 100644 files/ja/web/api/geolocationcoordinates/index.html create mode 100644 files/ja/web/api/geolocationcoordinates/index.md create mode 100644 files/ja/web/api/geolocationcoordinates/latitude/index.md create mode 100644 files/ja/web/api/geolocationcoordinates/longitude/index.md create mode 100644 files/ja/web/api/geolocationcoordinates/speed/index.md diff --git a/files/ja/web/api/geolocationcoordinates/accuracy/index.md b/files/ja/web/api/geolocationcoordinates/accuracy/index.md new file mode 100644 index 0000000000..f7f0677224 --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/accuracy/index.md @@ -0,0 +1,43 @@ +--- +title: GeolocationCoordinates.accuracy +slug: Web/API/GeolocationCoordinates/accuracy +tags: + - API + - Geolocation API + - GeolocationCoordinates + - Property + - Secure context + - accuracy +browser-compat: api.GeolocationCoordinates.accuracy +--- +{{securecontext_header}}{{APIRef("Geolocation API")}} + +The **`GeolocationCoordinates.accuracy`** read-only property is +a strictly positive `double` representing the accuracy, with a 95% confidence +level, of the {{domxref("GeolocationCoordinates.latitude")}} and +{{domxref("GeolocationCoordinates.longitude")}} properties expressed in meters. + +## Syntax + +```js +let acc = geolocationCoordinatesInstance.accuracy +``` + +### Value + +A positive `double` representing the accuracy, with a 95% confidence level, +of the {{domxref("GeolocationCoordinates.latitude")}} and +{{domxref("GeolocationCoordinates.longitude")}} properties expressed in meters. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Using the Geolocation API](/en-US/docs/Web/API/Geolocation_API/Using_the_Geolocation_API) +- {{domxref("GeolocationCoordinates")}} diff --git a/files/ja/web/api/geolocationcoordinates/altitude/index.md b/files/ja/web/api/geolocationcoordinates/altitude/index.md new file mode 100644 index 0000000000..4c99523a52 --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/altitude/index.md @@ -0,0 +1,44 @@ +--- +title: GeolocationCoordinates.altitude +slug: Web/API/GeolocationCoordinates/altitude +tags: + - API + - Geolocation API + - GeolocationCoordinates + - Property + - Secure context + - altitude +browser-compat: api.GeolocationCoordinates.altitude +--- +{{securecontext_header}}{{APIRef("Geolocation API")}} + +The **`GeolocationCoordinates.altitude`** read-only property is +a `double` representing the altitude of the position in meters above the [WGS84](http://earth-info.nga.mil/GandG/publications/tr8350.2/wgs84fin.pdf) +ellipsoid (which defines the nominal sea level surface). This value is `null` +if the implementation cannot provide this data. + +## Syntax + +```js +let alt = geolocationCoordinatesInstance.altitude +``` + +### Value + +A `double` representing the altitude of the position in meters above the [WGS84](http://earth-info.nga.mil/GandG/publications/tr8350.2/wgs84fin.pdf) +ellipsoid. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Using the Geolocation API](/en-US/docs/Web/API/Geolocation_API/Using_the_Geolocation_API) +- The {{domxref("GeolocationCoordinates")}} interface it belongs to. +- [National + Imagery and Mapping Agency Technical Report 8350.2, Third Edition (WGS84)](http://earth-info.nga.mil/GandG/publications/tr8350.2/wgs84fin.pdf) diff --git a/files/ja/web/api/geolocationcoordinates/altitudeaccuracy/index.md b/files/ja/web/api/geolocationcoordinates/altitudeaccuracy/index.md new file mode 100644 index 0000000000..e21b8019a2 --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/altitudeaccuracy/index.md @@ -0,0 +1,42 @@ +--- +title: GeolocationCoordinates.altitudeAccuracy +slug: Web/API/GeolocationCoordinates/altitudeAccuracy +tags: + - API + - Geolocation API + - GeolocationCoordinates + - Property + - Secure context + - altitudeAccuracy +browser-compat: api.GeolocationCoordinates.altitudeAccuracy +--- +{{securecontext_header}}{{APIRef("Geolocation API")}} + +The **`GeolocationCoordinates.altitudeAccuracy`** read-only +property is a strictly positive `double` representing the accuracy, with a +95% confidence level, of the `altitude` expressed in meters. This value is +`null` if the implementation doesn't support measuring altitude. + +## Syntax + +```js +let altAcc = geolocationCoordinatesInstance.altitudeAccuracy +``` + +### Value + +A positive `double` representing the accuracy, with a 95% confidence level, +of the `altitude` expressed in meters. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Using the Geolocation API](/en-US/docs/Web/API/Geolocation_API/Using_the_Geolocation_API) +- {{domxref("GeolocationCoordinates")}} diff --git a/files/ja/web/api/geolocationcoordinates/heading/index.md b/files/ja/web/api/geolocationcoordinates/heading/index.md new file mode 100644 index 0000000000..252073fbe3 --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/heading/index.md @@ -0,0 +1,46 @@ +--- +title: GeolocationCoordinates.heading +slug: Web/API/GeolocationCoordinates/heading +tags: + - API + - Geolocation API + - GeolocationCoordinates + - Property + - Secure context + - heading +browser-compat: api.GeolocationCoordinates.heading +--- +{{securecontext_header}}{{APIRef("Geolocation API")}} + +The **`GeolocationCoordinates.heading`** read-only property is +a `double` 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. +`Zero` degrees represents true north, and the direction is determined +clockwise (which means that east is `90` degrees and west is `270` +degrees). If {{domxref("GeolocationCoordinates.speed")}} is `0`, +`heading` is +[`NaN`](/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN). If +the device is not able to provide heading information, this value is `null`. + +## Syntax + +```js +let heading = geolocationCoordinatesInstance.heading +``` + +### Value + +A `double` representing the direction in which the device is traveling. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Using the Geolocation API](/en-US/docs/Web/API/Geolocation_API/Using_the_Geolocation_API) +- {{domxref("GeolocationCoordinates")}} diff --git a/files/ja/web/api/geolocationcoordinates/index.html b/files/ja/web/api/geolocationcoordinates/index.html deleted file mode 100644 index d2ce25b85e..0000000000 --- a/files/ja/web/api/geolocationcoordinates/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: GeolocationCoordinates -slug: Web/API/GeolocationCoordinates -tags: - - API - - Geolocation API - - GeolocationCoordinates - - Interface - - Secure context -translation_of: Web/API/GeolocationCoordinates ---- -
{{securecontext_header}}{{APIRef("Geolocation API")}}
- -
GeolocationCoordinates インターフェイスは、地球上における端末の位置と高度、およびそれぞれの測位精度を表します。
- -

プロパティ

- -

GeolocationCoordinates インターフェイスが継承するプロパティはありません。

- -
-
{{domxref("GeolocationCoordinates.latitude")}} {{readonlyInline}} {{securecontext_inline}}
-
この位置の緯度を十進数の角度で表す double 型の値を返します。
-
{{domxref("GeolocationCoordinates.longitude")}} {{readonlyInline}} {{securecontext_inline}}
-
この位置の経度を十進数の角度で表す double 型の値を返します。
-
{{domxref("GeolocationCoordinates.altitude")}} {{readonlyInline}} {{securecontext_inline}}
-
この位置の海面からの相対的な高度をメートル単位で表す double 型の値を返します。実装がこのデータを提供できない場合、この値は null になることがあります。
-
{{domxref("GeolocationCoordinates.accuracy")}} {{readonlyInline}} {{securecontext_inline}}
-
latitude および longitude プロパティの精度をメートル単位で表す、double 型の値を返します。
-
{{domxref("GeolocationCoordinates.altitudeAccuracy")}} {{readonlyInline}} {{securecontext_inline}}
-
altitude プロパティの精度をメートル単位で表す、double 型の値を返します。このプロパティは null になることがあります。
-
{{domxref("GeolocationCoordinates.heading")}} {{readonlyInline}} {{securecontext_inline}}
-
端末が向かっている方向を表す double 型の値を返します。この値は、端末の向きが真北からどれだけ離れているかを、角度で表します。 0 は真北を表し、方向は時計回りに定められます (すなわち、東は 90 度、西は 270 度です)。 speed が 0 の場合、 heading は NaN になります。もし heading の情報を取得できない場合は、この値は null になります。
-
{{domxref("GeolocationCoordinates.speed")}} {{readonlyInline}} {{securecontext_inline}}
-
端末の移動速度をメートル毎秒で表す double 型の値を返します。このプロパティは null になることがあります。
-
- -

メソッド

- -

GeolocationCoordinates インターフェイスが実装・継承するメソッドはありません。

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Geolocation', '#coordinates_interface', 'GeolocationCoordinates')}}{{Spec2('Geolocation')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("api.GeolocationCoordinates")}}

- -

関連情報

- - diff --git a/files/ja/web/api/geolocationcoordinates/index.md b/files/ja/web/api/geolocationcoordinates/index.md new file mode 100644 index 0000000000..d2ce25b85e --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/index.md @@ -0,0 +1,69 @@ +--- +title: GeolocationCoordinates +slug: Web/API/GeolocationCoordinates +tags: + - API + - Geolocation API + - GeolocationCoordinates + - Interface + - Secure context +translation_of: Web/API/GeolocationCoordinates +--- +
{{securecontext_header}}{{APIRef("Geolocation API")}}
+ +
GeolocationCoordinates インターフェイスは、地球上における端末の位置と高度、およびそれぞれの測位精度を表します。
+ +

プロパティ

+ +

GeolocationCoordinates インターフェイスが継承するプロパティはありません。

+ +
+
{{domxref("GeolocationCoordinates.latitude")}} {{readonlyInline}} {{securecontext_inline}}
+
この位置の緯度を十進数の角度で表す double 型の値を返します。
+
{{domxref("GeolocationCoordinates.longitude")}} {{readonlyInline}} {{securecontext_inline}}
+
この位置の経度を十進数の角度で表す double 型の値を返します。
+
{{domxref("GeolocationCoordinates.altitude")}} {{readonlyInline}} {{securecontext_inline}}
+
この位置の海面からの相対的な高度をメートル単位で表す double 型の値を返します。実装がこのデータを提供できない場合、この値は null になることがあります。
+
{{domxref("GeolocationCoordinates.accuracy")}} {{readonlyInline}} {{securecontext_inline}}
+
latitude および longitude プロパティの精度をメートル単位で表す、double 型の値を返します。
+
{{domxref("GeolocationCoordinates.altitudeAccuracy")}} {{readonlyInline}} {{securecontext_inline}}
+
altitude プロパティの精度をメートル単位で表す、double 型の値を返します。このプロパティは null になることがあります。
+
{{domxref("GeolocationCoordinates.heading")}} {{readonlyInline}} {{securecontext_inline}}
+
端末が向かっている方向を表す double 型の値を返します。この値は、端末の向きが真北からどれだけ離れているかを、角度で表します。 0 は真北を表し、方向は時計回りに定められます (すなわち、東は 90 度、西は 270 度です)。 speed が 0 の場合、 heading は NaN になります。もし heading の情報を取得できない場合は、この値は null になります。
+
{{domxref("GeolocationCoordinates.speed")}} {{readonlyInline}} {{securecontext_inline}}
+
端末の移動速度をメートル毎秒で表す double 型の値を返します。このプロパティは null になることがあります。
+
+ +

メソッド

+ +

GeolocationCoordinates インターフェイスが実装・継承するメソッドはありません。

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Geolocation', '#coordinates_interface', 'GeolocationCoordinates')}}{{Spec2('Geolocation')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("api.GeolocationCoordinates")}}

+ +

関連情報

+ + diff --git a/files/ja/web/api/geolocationcoordinates/latitude/index.md b/files/ja/web/api/geolocationcoordinates/latitude/index.md new file mode 100644 index 0000000000..e405b48a38 --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/latitude/index.md @@ -0,0 +1,38 @@ +--- +title: GeolocationCoordinates.latitude +slug: Web/API/GeolocationCoordinates/latitude +tags: + - API + - Geolocation API + - GeolocationCoordinates + - Property + - Secure context + - latitude +browser-compat: api.GeolocationCoordinates.latitude +--- +{{securecontext_header}}{{APIRef("Geolocation API")}} + +The **`GeolocationCoordinates.latitude`** read-only property is a `double` representing the latitude of the position in decimal degrees. + +## Syntax + +```js +let lat = geolocationCoordinatesInstance.latitude +``` + +### Value + +A `double` representing the latitude of the position in decimal degrees. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Using the Geolocation API](/en-US/docs/Web/API/Geolocation_API/Using_the_Geolocation_API) +- {{domxref("GeolocationCoordinates")}} diff --git a/files/ja/web/api/geolocationcoordinates/longitude/index.md b/files/ja/web/api/geolocationcoordinates/longitude/index.md new file mode 100644 index 0000000000..5b48abb45c --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/longitude/index.md @@ -0,0 +1,127 @@ +--- +title: GeolocationCoordinates.longitude +slug: Web/API/GeolocationCoordinates/longitude +tags: + - API + - GPS + - Geolocation + - Geolocation API + - GeolocationCoordinates + - Global Positioning System + - Property + - Read-only + - Reference + - Secure context + - longitude +browser-compat: api.GeolocationCoordinates.longitude +--- +{{securecontext_header}}{{APIRef("Geolocation API")}} + +The {{domxref("GeolocationCoordinates")}} interface's read-only +**`longitude`** property is a double-precision floating point +value which represents the longitude of a geographical position, specified in decimal +degrees. Together with a {{domxref("DOMTimeStamp")}} indicating a time of measurement, +the `GeolocationCoordinates` object is part of the +{{domxref("GeolocationPosition")}} interface, which is the object type returned by +Geolocation API functions that obtain and return a geographical position. + +## Syntax + +```js +let longitude = geolocationCoordinatesInstance.longitude +``` + +### Value + +The value in `longitude` is the geographical longitude of the location on +Earth described by the `Coordinates` object, in decimal degrees. The value is +defined by the World Geodetic System 1984 specification (WGS 84). + +> **Note:** The zero meridian (also known as the prime meridian or the +> reference meridian) is not precisely the same as the Greenwich meridian that most +> people think of. It is, instead, the {{interwiki("wikipedia", "IERS Reference + Meridian")}}, which is located 5.3 {{interwiki("wikipedia", "arcseconds")}} (102 +> meters / 335 feet) east of the {{interwiki("wikipedia", "Greenwich meridian")}}. This +> is the same standard used by the {{interwiki("wikipedia", "Global Positioning + System")}} (GPS). + +## Examples + +In this simple example, we fetch the user's location and display the resulting +coordinates once they're returned. + +### JavaScript + +The JavaScript code below creates an event listener so that when the user clicks on a +button, the location information is retrieved and displayed. + +```js +let button = document.getElementById("get-location"); +let latText = document.getElementById("latitude"); +let longText = document.getElementById("longitude"); + +button.addEventListener("click", function() { + navigator.geolocation.getCurrentPosition(function(position) { + let lat = position.coords.latitude; + let long = position.coords.longitude; + + latText.innerText = lat.toFixed(2); + longText.innerText = long.toFixed(2); + }); +}); +``` + +After setting up variables to more conveniently reference the button element and the +two elements into which the latitude and longitude will be drawn, the event listener is +established by calling {{domxref("EventTarget.addEventListener", "addEventListener()")}} +on the {{HTMLElement("button")}} element. When the user clicks the button, we'll fetch +and display the location information. + +Upon receiving a {{event("click")}} event, we call +{{domxref("Geolocation.getCurrentPosition", "getCurrentPosition()")}} to request the +device's current position. This is an asynchronous request, so we provide a callback +which receives as in put a {{domxref("GeolocationPosition")}} object describing the +determined position. + +From the `GeolocationPosition` object, we obtain the user's latitude and +longitude using {{domxref("GeolocationCoordinates/latitude", "position.coords.latitude")}} and +`position.coords.longitude` so we can update the displayed coordinates. The +two {{HTMLElement("span")}} elements are updated to display the corresponding values +after being converted to a value with two decimal places. + +### HTML + +The HTML used to present the results looks like this: + +```html +

+ Your location is 0.00° + latitude by 0.00° longitude. +

+ +``` + +### Result + +Take this example for a test drive here: + +{{EmbedLiveSample("Examples", 600, 120)}} + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Using the Geolocation API](/en-US/docs/Web/API/Geolocation_API/Using_the_Geolocation_API) +- The {{domxref("GeolocationCoordinates")}} interface it belongs to. +- The {{domxref("GeolocationPosition")}} interface, which is the top-level interface + used to return geolocation data from the Geolocation API functions + {{domxref("Geolocation.getCurrentPosition()")}} and + {{domxref("Geolocation.watchPosition", "watchPosition()")}}. diff --git a/files/ja/web/api/geolocationcoordinates/speed/index.md b/files/ja/web/api/geolocationcoordinates/speed/index.md new file mode 100644 index 0000000000..649ca264f1 --- /dev/null +++ b/files/ja/web/api/geolocationcoordinates/speed/index.md @@ -0,0 +1,40 @@ +--- +title: GeolocationCoordinates.speed +slug: Web/API/GeolocationCoordinates/speed +tags: + - API + - Geolocation API + - GeolocationCoordinates + - Property + - Secure context + - speed +browser-compat: api.GeolocationCoordinates.speed +--- +{{securecontext_header}}{{APIRef("Geolocation API")}} + +The **`GeolocationCoordinates.speed`** read-only property is a +`double` representing the velocity of the device in meters per second. This +value is `null` if the implementation is not able to measure it. + +## Syntax + +```js +let speed = geolocationCoordinatesInstance.speed +``` + +### Value + +A `double` representing the velocity of the device in meters per second. + +## Specifications + +{{Specifications}} + +## Browser compatibility + +{{Compat}} + +## See also + +- [Using the Geolocation API](/en-US/docs/Web/API/Geolocation_API/Using_the_Geolocation_API) +- {{domxref("GeolocationCoordinates")}} -- cgit v1.2.3-54-g00ecf