title: How do I get location name or city using latitude & longitudes?
body: <p>I'm using the below code, but how to get the city name or the location name from the longitude &amp; latitude?</p>
  
  <pre><code>var x=document.getElementById("location");
  function getLocation()
  {
      if (navigator.geolocation) {
          navigator.geolocation.getCurrentPosition(showPosition,showError);
      }
      else {
          x.innerHTML="Geolocation is not supported by this browser.";
      }
  }
  
  function showPosition(position)
  {
      x.innerHTML="Latitude: " + position.coords.latitude + 
          "&lt;br&gt;Longitude: " + position.coords.longitude;  
  }
  </code></pre>