Convert coordinates to a place name with HTML5


For this, use Google Maps API to perform reverse geocoding.

Geocoding refers to translating a human-readable address into a location on a map.

The process of doing the converse, translating a location on the map into a human-readable address, is known as reverse geocoding.

Example

Let us see an example to set latitude and longitude −

function initMap() {
   var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 8,
      center: {lat: 20.502, lng: -22.765}
   });
}

The reverse geocoder will match countries, provinces, cities and neighborhoods, street addresses, and postal codes.

Updated on: 25-Jun-2020

173 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements