diff options
author | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-02-03 01:04:23 +0900 |
---|---|---|
committer | Masahiro FUJIMOTO <mfujimot@gmail.com> | 2022-02-10 22:12:14 +0900 |
commit | 972595697b25aa8cbf631f7653e178891efa40a6 (patch) | |
tree | 7ffa069b7b9cabfc884fc929b45b14301654c5b3 /files/ja/web/api/geolocation/getcurrentposition/index.html | |
parent | 0c1877ce3f1548fd077ba7dd4e846d75bb20e396 (diff) | |
download | translated-content-972595697b25aa8cbf631f7653e178891efa40a6.tar.gz translated-content-972595697b25aa8cbf631f7653e178891efa40a6.tar.bz2 translated-content-972595697b25aa8cbf631f7653e178891efa40a6.zip |
Geolocation インターフェイスの記事を移行
Diffstat (limited to 'files/ja/web/api/geolocation/getcurrentposition/index.html')
-rw-r--r-- | files/ja/web/api/geolocation/getcurrentposition/index.html | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/files/ja/web/api/geolocation/getcurrentposition/index.html b/files/ja/web/api/geolocation/getcurrentposition/index.html deleted file mode 100644 index dd24b126d3..0000000000 --- a/files/ja/web/api/geolocation/getcurrentposition/index.html +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: Geolocation.getCurrentPosition() -slug: Web/API/Geolocation/getCurrentPosition -tags: - - API - - Geolocation - - Geolocation API - - Method - - Reference - - Secure context - - getCurrentPosition - - メソッド -translation_of: Web/API/Geolocation/getCurrentPosition ---- -<p>{{securecontext_header}}{{ APIRef("Geolocation API") }}</p> - -<p><span class="seoSummary"><strong><code>Geolocation.getCurrentPosition()</code></strong> メソッドは、デバイスの現在位置を取得するために使われます。</span></p> - -<h2 id="Syntax" name="Syntax">構文</h2> - -<pre class="syntaxbox notranslate">navigator.geolocation.getCurrentPosition(<var>success</var>[, <var>error</var>[, [<var>options</var>]])</pre> - -<h3 id="Parameters" name="Parameters">引数</h3> - -<dl> - <dt><code><var>success</var></code></dt> - <dd>コールバック関数で、 {{domxref("GeolocationPosition")}} オブジェクトを唯一の入力引数として受け取るものです。</dd> - <dt><code><var>error</var></code> {{optional_inline}}</dt> - <dd>任意のコールバック関数で、 {{domxref("GeolocationPositionError")}} オブジェクトを唯一の入力引数として受け取るものです。</dd> - <dt><code><var>options</var></code> {{optional_inline}}</dt> - <dd>任意の {{domxref("PositionOptions")}} オブジェクトです。<br> - オプションには以下のものがあります。 - <ul> - <li><code>maximumAge</code>: 整数 (ミリ秒) | infinity - キャッシュされた位置の最大寿命です。</li> - <li><code>timeout</code>: 整数 (ミリ秒) - エラーコールバックが呼び出されるまでの時間で、 0 の場合は呼び出されません。</li> - <li><code>enableHighAccuracy</code>: false | true</li> - </ul> - </dd> -</dl> - -<h2 id="Examples" name="Examples">例</h2> - -<pre class="brush: js notranslate">var options = { - enableHighAccuracy: true, - timeout: 5000, - maximumAge: 0 -}; - -function success(pos) { - var crd = pos.coords; - - console.log('Your current position is:'); - console.log(`Latitude : ${crd.latitude}`); - console.log(`Longitude: ${crd.longitude}`); - console.log(`More or less ${crd.accuracy} meters.`); -} - -function error(err) { - console.warn(`ERROR(${err.code}): ${err.message}`); -} - -navigator.geolocation.getCurrentPosition(success, error, options); -</pre> - -<h2 id="Specifications" name="Specifications">仕様書</h2> - -<table class="standard-table"> - <thead> - <tr> - <th scope="col">仕様書</th> - <th scope="col">状態</th> - <th scope="col">備考</th> - </tr> - </thead> - <tbody> - <tr> - <td>{{SpecName('Geolocation')}}</td> - <td>{{Spec2('Geolocation')}}</td> - <td>初回定義</td> - </tr> - </tbody> -</table> - -<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> - -<p>{{Compat("api.Geolocation.getCurrentPosition")}}</p> - -<h2 id="See_also" name="See_also">関連情報</h2> - -<ul> - <li><a href="/ja/docs/Web/API/Geolocation_API/Using_the_Geolocation_API">Geolocation の使用</a></li> - <li>{{domxref("Navigator.geolocation")}}</li> -</ul> |