aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/geolocation/clearwatch/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/geolocation/clearwatch/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/api/geolocation/clearwatch/index.html')
-rw-r--r--files/ja/web/api/geolocation/clearwatch/index.html97
1 files changed, 97 insertions, 0 deletions
diff --git a/files/ja/web/api/geolocation/clearwatch/index.html b/files/ja/web/api/geolocation/clearwatch/index.html
new file mode 100644
index 0000000000..6c4790a719
--- /dev/null
+++ b/files/ja/web/api/geolocation/clearwatch/index.html
@@ -0,0 +1,97 @@
+---
+title: Geolocation.clearWatch()
+slug: Web/API/Geolocation/clearWatch
+tags:
+ - API
+ - Geolocation
+ - Geolocation API
+ - Method
+ - Reference
+ - Secure context
+ - clearWatch
+ - メソッド
+ - リファレンス
+ - 位置情報
+ - 位置情報 API
+ - 安全なコンテキスト
+translation_of: Web/API/Geolocation/clearWatch
+---
+<p>{{securecontext_header}}{{ APIref("Geolocation API") }}</p>
+
+<p><strong><code>Geolocation.clearWatch()</code></strong>メソッドは、以前 {{domxref("Geolocation.watchPosition()")}} によって登録された位置情報/エラーの監視ハンドラーを解除するために使用します。</p>
+
+<h2 id="Syntax" name="Syntax">構文</h2>
+
+<pre class="syntaxbox notranslate">navigator.geolocation.clearWatch(<var>id</var>);</pre>
+
+<h3 id="Parameters" name="Parameters">引数</h3>
+
+<dl>
+ <dt><code><var>id</var></code></dt>
+ <dd>解除したいハンドラーの登録時に {{domxref("Geolocation.watchPosition()")}} メソッドから返された ID 番号です。</dd>
+</dl>
+
+<h2 id="Example" name="Example">例</h2>
+
+<pre class="brush: js notranslate">var id, target, option;
+
+function success(pos) {
+ var crd = pos.coords;
+
+ if (target.latitude === crd.latitude &amp;&amp; target.longitude === crd.longitude) {
+ console.log('Congratulation, you reach the target');
+ navigator.geolocation.clearWatch(id);
+ }
+};
+
+function error(err) {
+ console.warn('ERROR(' + err.code + '): ' + err.message);
+};
+
+target = {
+ latitude : 0,
+ longitude: 0,
+}
+
+options = {
+ enableHighAccuracy: false,
+ timeout: 5000,
+ maximumAge: 0
+};
+
+id = navigator.geolocation.watchPosition(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>
+
+<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>
+
+<p>{{Compat("api.Geolocation.clearWatch")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li><a href="/ja/docs/WebAPI/Using_geolocation" title="/ja/docs/WebAPI/Using_geolocation">位置情報の使用</a></li>
+ <li>{{domxref("Geolocation")}}</li>
+ <li>{{domxref("Geolocation.watchPosition()")}}</li>
+ <li>{{domxref("Geolocation.getCurrentPosition()")}}</li>
+</ul>