GeolocationPositionError

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。

GeolocationPositionError インターフェイスは位置情報の取得時に発生したエラーの理由を表します。

インスタンスプロパティ

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

GeolocationPositionError.code 読取専用 安全なコンテキスト用

unsigned short でエラーコードを表します。以下の値になる可能性があります。

関連付けられた定数 説明
1 PERMISSION_DENIED ページに必要な権限がないため、位置情報の取得に失敗しました。例えば、権限ポリシーによってブロックされたなどです。
2 POSITION_UNAVAILABLE 1 つ以上の位置の内部ソースが内部エラーを返したために、位置情報の取得に失敗しました。
3 TIMEOUT 位置情報を取得するための制限時間が情報を取得する前に終了しました。
GeolocationPositionError.message 読取専用 安全なコンテキスト用

エラーの詳細を説明する、人間が読める文字列返します。仕様書の注では、主にデバッグ用途を想定しており、ユーザーインターフェイスに直接表示するものではないとしています。

インスタンスメソッド

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

仕様書

Specification
Geolocation
# position_error_interface

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
GeolocationPositionError
code
message
Secure context required

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Uses a non-standard name.
Has more compatibility info.

関連情報