JSFiddle - React, Tailwind, and code Playground

by Aaron von Schassen

JavaScript

// https://ibb.co/LpSfsp4

function showPosition(position) {
  console.log("Latitude: " + position.coords.latitude, "Longitude: " + position.coords.longitude)
}

const getLocation = () => {
  if (navigator.geolocation) {
  	console.log("awd")
    navigator.geolocation.getCurrentPosition(showPosition);
  } else {
    console.log("Geolocation is not supported by this browser.");
  }
}

getLocation();