From 972595697b25aa8cbf631f7653e178891efa40a6 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Thu, 3 Feb 2022 01:04:23 +0900 Subject: Geolocation インターフェイスの記事を移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/api/geolocation/index.md | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 files/ja/web/api/geolocation/index.md (limited to 'files/ja/web/api/geolocation/index.md') diff --git a/files/ja/web/api/geolocation/index.md b/files/ja/web/api/geolocation/index.md new file mode 100644 index 0000000000..6bf37fa463 --- /dev/null +++ b/files/ja/web/api/geolocation/index.md @@ -0,0 +1,73 @@ +--- +title: Geolocation +slug: Web/API/Geolocation +tags: + - API + - Advanced + - Geolocation + - Geolocation API + - Interface + - Reference + - Secure context + - インターフェイス + - リファレンス + - 位置情報 + - 位置情報 API + - 安全なコンテキスト +translation_of: Web/API/Geolocation +--- +
{{securecontext_header}}{{APIRef("Geolocation API")}}
+ +

Geolocation インターフェイスはデバイスの位置を取得する機能を提供します。これにより、ウェブサイトやアプリがユーザーの現在の位置に応じた結果を提供できるようになります。

+ +

このインターフェイスを持つオブジェクトは、 {{domxref("Navigator")}} オブジェクトの {{domxref("navigator.geolocation")}} プロパティを使って得ることができます。

+ +
+

注: セキュリティ上の理由により、ウェブページが位置情報にアクセスしようとする時、ユーザーにアクセス許可が求められます。その方法やポリシーはブラウザーによって異なることに注意してください。

+
+ +

プロパティ

+ +

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

+ +

メソッド

+ +

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

+ +
+
{{domxref("Geolocation.getCurrentPosition()")}} {{securecontext_inline}}
+
デバイスの現在位置を特定し、結果データを {{domxref("GeolocationPosition")}} オブジェクトで返します。
+
{{domxref("Geolocation.watchPosition()")}} {{securecontext_inline}}
+
デバイスの位置が変化する度に呼び出されるコールバック関数を登録し、それを識別する long 型の値を返します。
+
{{domxref("Geolocation.clearWatch()")}} {{securecontext_inline}}
+
watchPosition() によって以前に登録されたハンドラーを解除します。
+
+ +

仕様書

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

ブラウザーの互換性

+ +

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

+ +

関連情報

+ + -- cgit v1.2.3-54-g00ecf