vendredi 4 janvier 2019

Google not revert currect lattitude and longitude of current position

I want to build locate me functionality in laravel. I am using this code but it is sending slightly different latitude and longitude.

function getLocation() 
{
  var x = document.getElementById("lat_long");
   if (navigator.geolocation) {
  navigator.geolocation.getCurrentPosition(showPosition);
  } else {
  x.innerHTML = "Geolocation is not supported by this browser.";
  }
}

function showPosition(position) 
{
   var x = document.getElementById("lat_long");
   x.innerHTML = "Latitude: " + position.coords.latitude + 
   "<br>Longitude: " + position.coords.longitude; 
}

Is there any alternate. so that i can improve my result.



from Newest questions tagged laravel-5 - Stack Overflow http://bit.ly/2LT5iL8
via IFTTT

Aucun commentaire:

Enregistrer un commentaire