From c05efa8d7ae464235cf83d7c0956e42dc6974103 Mon Sep 17 00:00:00 2001 From: julieng Date: Sat, 2 Oct 2021 17:20:14 +0200 Subject: move *.html to *.md --- files/fr/web/api/geolocation/clearwatch/index.html | 89 ------------------ files/fr/web/api/geolocation/clearwatch/index.md | 89 ++++++++++++++++++ .../api/geolocation/getcurrentposition/index.html | 88 ------------------ .../api/geolocation/getcurrentposition/index.md | 88 ++++++++++++++++++ files/fr/web/api/geolocation/index.html | 66 -------------- files/fr/web/api/geolocation/index.md | 66 ++++++++++++++ .../web/api/geolocation/watchposition/index.html | 100 --------------------- .../fr/web/api/geolocation/watchposition/index.md | 100 +++++++++++++++++++++ 8 files changed, 343 insertions(+), 343 deletions(-) delete mode 100644 files/fr/web/api/geolocation/clearwatch/index.html create mode 100644 files/fr/web/api/geolocation/clearwatch/index.md delete mode 100644 files/fr/web/api/geolocation/getcurrentposition/index.html create mode 100644 files/fr/web/api/geolocation/getcurrentposition/index.md delete mode 100644 files/fr/web/api/geolocation/index.html create mode 100644 files/fr/web/api/geolocation/index.md delete mode 100644 files/fr/web/api/geolocation/watchposition/index.html create mode 100644 files/fr/web/api/geolocation/watchposition/index.md (limited to 'files/fr/web/api/geolocation') diff --git a/files/fr/web/api/geolocation/clearwatch/index.html b/files/fr/web/api/geolocation/clearwatch/index.html deleted file mode 100644 index c4952eb7cf..0000000000 --- a/files/fr/web/api/geolocation/clearwatch/index.html +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: Geolocation.clearWatch() -slug: Web/API/Geolocation/clearWatch -tags: - - API - - Besoin d'exemple - - Géolocalisation - - Géolocalisation API - - Méthode - - Reference -translation_of: Web/API/Geolocation/clearWatch ---- -

{{ 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()")}}.

- -

Syntaxe

- -
navigator.geolocation.clearWatch(id);
- -

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.
-
- -

Exemple

- -
var id, target, option;
-
-function success(pos) {
-  var crd = pos.coords;
-
-  if (target.latitude === crd.latitude && 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);
-
- -

Spécifications

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

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/fr/web/api/geolocation/clearwatch/index.md b/files/fr/web/api/geolocation/clearwatch/index.md new file mode 100644 index 0000000000..c4952eb7cf --- /dev/null +++ b/files/fr/web/api/geolocation/clearwatch/index.md @@ -0,0 +1,89 @@ +--- +title: Geolocation.clearWatch() +slug: Web/API/Geolocation/clearWatch +tags: + - API + - Besoin d'exemple + - Géolocalisation + - Géolocalisation API + - Méthode + - Reference +translation_of: Web/API/Geolocation/clearWatch +--- +

{{ 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()")}}.

+ +

Syntaxe

+ +
navigator.geolocation.clearWatch(id);
+ +

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.
+
+ +

Exemple

+ +
var id, target, option;
+
+function success(pos) {
+  var crd = pos.coords;
+
+  if (target.latitude === crd.latitude && 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);
+
+ +

Spécifications

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

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/geolocation/getcurrentposition/index.html b/files/fr/web/api/geolocation/getcurrentposition/index.html deleted file mode 100644 index 8168640a6c..0000000000 --- a/files/fr/web/api/geolocation/getcurrentposition/index.html +++ /dev/null @@ -1,88 +0,0 @@ ---- -title: Geolocation.getCurrentPosition() -slug: Web/API/Geolocation/getCurrentPosition -tags: - - API - - Geolocation - - Méthode - - Reference -translation_of: Web/API/Geolocation/getCurrentPosition ---- -
{{securecontext_header}}{{APIRef("Geolocation API")}}
- -

La méthode Geolocation.getCurrentPosition() fournit la position actuelle de l'appareil.

- -

Syntaxe

- -
navigator.geolocation.getCurrentPosition(success[, error[, [options]])
- -

Paramètres

- -
-
success
-
Une fonction de rappel qui prend un objet {{domxref("Position")}} comme argument.
-
error {{optional_inline}}
-
Une fonction de rappel qui prend un objet {{domxref("PositionError")}} comme argument.
-
options {{optional_inline}}
-
Un objet {{domxref("PositionOptions")}} optionnel. Les options décrites par cet objet sont : -
    -
  • maximumAge : un entier qui exprime une durée en millisecondes ou l'infini pour indiquer la durée maximale pendant laquelle mettre en cache la position.
  • -
  • timeout : un entier qui exprime la durée, en millisecondes, avant que la fonction de rappel error soit appelé. Si cette propriété vaut 0, la fonction d'erreur ne sera jamais appelée.
  • -
  • enableHighAccuracy : un booléen qui indique si une précision élevée est requise.
  • -
-
-
- -

Exemples

- -
var options = {
-  enableHighAccuracy: true,
-  timeout: 5000,
-  maximumAge: 0
-};
-
-function success(pos) {
-  var crd = pos.coords;
-
-  console.log('Votre position actuelle est :');
-  console.log(`Latitude : ${crd.latitude}`);
-  console.log(`Longitude : ${crd.longitude}`);
-  console.log(`La précision est de ${crd.accuracy} mètres.`);
-}
-
-function error(err) {
-  console.warn(`ERREUR (${err.code}): ${err.message}`);
-}
-
-navigator.geolocation.getCurrentPosition(success, error, options);
-
- -

Spécifications

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

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/fr/web/api/geolocation/getcurrentposition/index.md b/files/fr/web/api/geolocation/getcurrentposition/index.md new file mode 100644 index 0000000000..8168640a6c --- /dev/null +++ b/files/fr/web/api/geolocation/getcurrentposition/index.md @@ -0,0 +1,88 @@ +--- +title: Geolocation.getCurrentPosition() +slug: Web/API/Geolocation/getCurrentPosition +tags: + - API + - Geolocation + - Méthode + - Reference +translation_of: Web/API/Geolocation/getCurrentPosition +--- +
{{securecontext_header}}{{APIRef("Geolocation API")}}
+ +

La méthode Geolocation.getCurrentPosition() fournit la position actuelle de l'appareil.

+ +

Syntaxe

+ +
navigator.geolocation.getCurrentPosition(success[, error[, [options]])
+ +

Paramètres

+ +
+
success
+
Une fonction de rappel qui prend un objet {{domxref("Position")}} comme argument.
+
error {{optional_inline}}
+
Une fonction de rappel qui prend un objet {{domxref("PositionError")}} comme argument.
+
options {{optional_inline}}
+
Un objet {{domxref("PositionOptions")}} optionnel. Les options décrites par cet objet sont : +
    +
  • maximumAge : un entier qui exprime une durée en millisecondes ou l'infini pour indiquer la durée maximale pendant laquelle mettre en cache la position.
  • +
  • timeout : un entier qui exprime la durée, en millisecondes, avant que la fonction de rappel error soit appelé. Si cette propriété vaut 0, la fonction d'erreur ne sera jamais appelée.
  • +
  • enableHighAccuracy : un booléen qui indique si une précision élevée est requise.
  • +
+
+
+ +

Exemples

+ +
var options = {
+  enableHighAccuracy: true,
+  timeout: 5000,
+  maximumAge: 0
+};
+
+function success(pos) {
+  var crd = pos.coords;
+
+  console.log('Votre position actuelle est :');
+  console.log(`Latitude : ${crd.latitude}`);
+  console.log(`Longitude : ${crd.longitude}`);
+  console.log(`La précision est de ${crd.accuracy} mètres.`);
+}
+
+function error(err) {
+  console.warn(`ERREUR (${err.code}): ${err.message}`);
+}
+
+navigator.geolocation.getCurrentPosition(success, error, options);
+
+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationÉtatCommentaires
{{SpecName('Geolocation')}}{{Spec2('Geolocation')}}Spécification initiale.
+ +

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/geolocation/index.html b/files/fr/web/api/geolocation/index.html deleted file mode 100644 index e492a2a532..0000000000 --- a/files/fr/web/api/geolocation/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: Geolocation -slug: Web/API/Geolocation -tags: - - API - - Avancé - - Géolocalisation API - - Interface - - Reference -translation_of: Web/API/Geolocation ---- -
{{APIRef("Geolocation API")}}
- -

En intégrant l'interface Geolocation, on peut obtenir la position d'un ordinateur, d'un téléphone ou d'une tablette, ce qui permet aux contenus Web d'accéder à leur localisation. Un site internet ou une application mobile peut alors offrir divers services liés à la localisation de l'utilisateur.

- -

On obtient un objet par le biais de cette interface avec la propriété {{domxref("NavigatorGeolocation.geolocation")}} proposée par l'objet {{domxref("Navigator")}} .

- -
-

Note: Pour des raisons de sécurité, quand une page web tente d'accéder aux données de localisation, l'utilisateur est prévenu, et son accord lui est demandé. Sachez que chaque navigateur a ses propres méthodes et politiques pour gérer les autorisations.

-
- -

Propriétés

- -

L'interface de géolocalisation n'utilise ou n'hérite d'aucune propriété.

- -

Méthodes

- -

L'interface de géolocalisation n'hérite d'aucune méthode.

- -
-
{{domxref("Geolocation.getCurrentPosition()")}}
-
Determine la position actuelle de l'appareil et donne en retour l'objet {{domxref("Position")}} avec sa valeur.
-
{{domxref("Geolocation.watchPosition()")}}
-
Retourne une valeur long représentant la nouvelle fonction callback, créée pour être utilisée à chaque fois que la position de l'appareil change.
-
{{domxref("Geolocation.clearWatch()")}}
-
Supprime le lien créé par la précédente utilisation de watchPosition().
-
- -

Spécifications

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

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/fr/web/api/geolocation/index.md b/files/fr/web/api/geolocation/index.md new file mode 100644 index 0000000000..e492a2a532 --- /dev/null +++ b/files/fr/web/api/geolocation/index.md @@ -0,0 +1,66 @@ +--- +title: Geolocation +slug: Web/API/Geolocation +tags: + - API + - Avancé + - Géolocalisation API + - Interface + - Reference +translation_of: Web/API/Geolocation +--- +
{{APIRef("Geolocation API")}}
+ +

En intégrant l'interface Geolocation, on peut obtenir la position d'un ordinateur, d'un téléphone ou d'une tablette, ce qui permet aux contenus Web d'accéder à leur localisation. Un site internet ou une application mobile peut alors offrir divers services liés à la localisation de l'utilisateur.

+ +

On obtient un objet par le biais de cette interface avec la propriété {{domxref("NavigatorGeolocation.geolocation")}} proposée par l'objet {{domxref("Navigator")}} .

+ +
+

Note: Pour des raisons de sécurité, quand une page web tente d'accéder aux données de localisation, l'utilisateur est prévenu, et son accord lui est demandé. Sachez que chaque navigateur a ses propres méthodes et politiques pour gérer les autorisations.

+
+ +

Propriétés

+ +

L'interface de géolocalisation n'utilise ou n'hérite d'aucune propriété.

+ +

Méthodes

+ +

L'interface de géolocalisation n'hérite d'aucune méthode.

+ +
+
{{domxref("Geolocation.getCurrentPosition()")}}
+
Determine la position actuelle de l'appareil et donne en retour l'objet {{domxref("Position")}} avec sa valeur.
+
{{domxref("Geolocation.watchPosition()")}}
+
Retourne une valeur long représentant la nouvelle fonction callback, créée pour être utilisée à chaque fois que la position de l'appareil change.
+
{{domxref("Geolocation.clearWatch()")}}
+
Supprime le lien créé par la précédente utilisation de watchPosition().
+
+ +

Spécifications

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

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

+ + diff --git a/files/fr/web/api/geolocation/watchposition/index.html b/files/fr/web/api/geolocation/watchposition/index.html deleted file mode 100644 index c2424f4774..0000000000 --- a/files/fr/web/api/geolocation/watchposition/index.html +++ /dev/null @@ -1,100 +0,0 @@ ---- -title: Geolocation.watchPosition() -slug: Web/API/Geolocation/watchPosition -tags: - - API - - Exemple - - Géolocalisation - - Géolocalisation API - - Méthode - - Reference -translation_of: Web/API/Geolocation/watchPosition ---- -

{{ APIref("Geolocation API") }}

- -

La méthode Geolocation.watchPosition() permet de manipuler une fonction appelée automatiquement à chaque fois que la position de l'appareil change. Vous pouvez de même, en option, manipuler une autre fonction appelée automatiquement pour gérer les erreurs.

- -

Cette méthode retourne une valeur ID de veille qui permet de libérer les fonctions déclarées automatiquement, évoquées précédemment, à l'aide de la méthode {{domxref("Geolocation.clearWatch()")}}.

- -

Syntaxe

- -
id = navigator.geolocation.watchPosition(success[, error[, options]])
- -

Paramètres

- -
-
success
-
Nom d'une fonction appelée qui a pour paramètre l'objet {{domxref("Position")}}.
-
error {{optional_inline}}
-
Nom d'une fonction optionnelle qui a pour paramètre l'objet {{domxref("PositionError")}}.
-
options {{optional_inline}}
-
Un objet optionnel {{domxref("PositionOptions")}}.
-
- -

Exemple

- -
var id, target, options;
-
-function success(pos) {
-  var crd = pos.coords;
-
-  if (target.latitude === crd.latitude && target.longitude === crd.longitude) {
-    console.log('Bravo, vous avez atteint la cible');
-    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);
-
- -
-

Note : Si votre application fonctionne sous Firefox OS, veillez à la geolocation wake lock pour que votre application continue à recevoir les changements de positions si votre application tourne en tâche de fond, ou si votre écran est éteint.

-
- -

Spécifications

- - - - - - - - - - - - - - - - -
SpécificationStatutCommentaire
{{SpecName('Geolocation', '#watch-position', 'Geolocation.watchPosition()')}}{{Spec2('Geolocation')}}Specification initiale.
- -

Compatibilité des navigateurs

- -

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

- -

Voir aussi

- - diff --git a/files/fr/web/api/geolocation/watchposition/index.md b/files/fr/web/api/geolocation/watchposition/index.md new file mode 100644 index 0000000000..c2424f4774 --- /dev/null +++ b/files/fr/web/api/geolocation/watchposition/index.md @@ -0,0 +1,100 @@ +--- +title: Geolocation.watchPosition() +slug: Web/API/Geolocation/watchPosition +tags: + - API + - Exemple + - Géolocalisation + - Géolocalisation API + - Méthode + - Reference +translation_of: Web/API/Geolocation/watchPosition +--- +

{{ APIref("Geolocation API") }}

+ +

La méthode Geolocation.watchPosition() permet de manipuler une fonction appelée automatiquement à chaque fois que la position de l'appareil change. Vous pouvez de même, en option, manipuler une autre fonction appelée automatiquement pour gérer les erreurs.

+ +

Cette méthode retourne une valeur ID de veille qui permet de libérer les fonctions déclarées automatiquement, évoquées précédemment, à l'aide de la méthode {{domxref("Geolocation.clearWatch()")}}.

+ +

Syntaxe

+ +
id = navigator.geolocation.watchPosition(success[, error[, options]])
+ +

Paramètres

+ +
+
success
+
Nom d'une fonction appelée qui a pour paramètre l'objet {{domxref("Position")}}.
+
error {{optional_inline}}
+
Nom d'une fonction optionnelle qui a pour paramètre l'objet {{domxref("PositionError")}}.
+
options {{optional_inline}}
+
Un objet optionnel {{domxref("PositionOptions")}}.
+
+ +

Exemple

+ +
var id, target, options;
+
+function success(pos) {
+  var crd = pos.coords;
+
+  if (target.latitude === crd.latitude && target.longitude === crd.longitude) {
+    console.log('Bravo, vous avez atteint la cible');
+    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);
+
+ +
+

Note : Si votre application fonctionne sous Firefox OS, veillez à la geolocation wake lock pour que votre application continue à recevoir les changements de positions si votre application tourne en tâche de fond, ou si votre écran est éteint.

+
+ +

Spécifications

+ + + + + + + + + + + + + + + + +
SpécificationStatutCommentaire
{{SpecName('Geolocation', '#watch-position', 'Geolocation.watchPosition()')}}{{Spec2('Geolocation')}}Specification initiale.
+ +

Compatibilité des navigateurs

+ +

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

+ +

Voir aussi

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