From 1407c8fdef01ecd0ffb8a8bd46e7113f119b9fde Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:24 +0200 Subject: convert content to md --- files/fr/web/api/geolocation/clearwatch/index.md | 74 ++++++++++-------------- 1 file changed, 29 insertions(+), 45 deletions(-) (limited to 'files/fr/web/api/geolocation/clearwatch') diff --git a/files/fr/web/api/geolocation/clearwatch/index.md b/files/fr/web/api/geolocation/clearwatch/index.md index c4952eb7cf..e3cf88e859 100644 --- a/files/fr/web/api/geolocation/clearwatch/index.md +++ b/files/fr/web/api/geolocation/clearwatch/index.md @@ -10,29 +10,28 @@ tags: - Reference translation_of: Web/API/Geolocation/clearWatch --- -

{{ APIref("Geolocation API") }}

+{{ APIref("Geolocation API") }} -

La méthode Geolocation.clearWatch() est utilisée pour libérer les ressources de localisation/erreur créées antérieurement en utilisant {{domxref("Geolocation.watchPosition()")}}.

+La méthode **`Geolocation.clearWatch()`** est utilisée pour libérer les ressources de localisation/erreur créées antérieurement en utilisant {{domxref("Geolocation.watchPosition()")}}. -

Syntaxe

+## Syntaxe -
navigator.geolocation.clearWatch(id);
+ navigator.geolocation.clearWatch(id); -

Paramètres

+### Paramètres -
-
id
-
Le nombre ID est donné par la méthode qui permet la localisation : {{domxref("Geolocation.watchPosition()")}} ; ressource que vous désirez supprimer.
-
+- _id_ + - : Le nombre ID est donné par la méthode qui permet la localisation : {{domxref("Geolocation.watchPosition()")}} ; ressource que vous désirez supprimer. -

Exemple

+## Exemple -
var id, target, option;
+```js
+var id, target, option;
 
 function success(pos) {
   var crd = pos.coords;
 
-  if (target.latitude === crd.latitude && target.longitude === crd.longitude) {
+  if (target.latitude === crd.latitude && target.longitude === crd.longitude) {
     console.log('Congratulation, you reach the target');
     navigator.geolocation.clearWatch(id);
   }
@@ -54,36 +53,21 @@ options = {
 };
 
 id = navigator.geolocation.watchPosition(success, error, options);
-
- -

Spécifications

- - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('Geolocation')}}{{Spec2('Geolocation')}}Spécification initiale.
- -

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - +``` + +## Spécifications + +| Spécification | Statut | Commentaire | +| ------------------------------------ | -------------------------------- | ----------------------- | +| {{SpecName('Geolocation')}} | {{Spec2('Geolocation')}} | Spécification initiale. | + +## Compatibilité des navigateurs + +{{Compat("api.Geolocation.clearWatch")}} + +## Voir aussi + +- [Utiliser geolocation](/fr/docs/Web/API/Using_geolocation) +- {{domxref("Geolocation")}} +- {{domxref("Geolocation.watchPosition()")}} +- {{domxref("Geolocation.getCurrentPosition()")}} -- cgit v1.2.3-54-g00ecf