JSFiddle - React, Tailwind, and code Playground

by Mentaldiarrhoe

JavaScript

get_posi()

function get_posi() {

  function success(position) {
    alert(position.coords.latitude, position.coords.longitude);
  }

  function error() {
    alert('Sorry, no position available.');
  }

  const options = {
    enableHighAccuracy: true,
    maximumAge: 30000,
    timeout: 27000
  };
alert("end")
  const watchID = navigator.geolocation.watchPosition(success, error, options);
}