Answers for "Find location by latitude and longitude Google Maps JavaScript"

3

open google map with latitude and longitude javascript

// The best way is to use q parameter so that it displays the map with the point marked. eg.:

https://maps.google.com/?q=<lat>,<lng>
Posted by: Guest on January-20-2021
1

reverse geocoding javascript map

function getReverseGeocodingData(lat, lng) {
    var latlng = new google.maps.LatLng(lat, lng);
    // This is making the Geocode request
    var geocoder = new google.maps.Geocoder();
    geocoder.geocode({ 'latLng': latlng },  (results, status) =>{
        if (status !== google.maps.GeocoderStatus.OK) {
            alert(status);
        }
        // This is checking to see if the Geoeode Status is OK before proceeding
        if (status == google.maps.GeocoderStatus.OK) {
            console.log(results);
            var address = (results[0].formatted_address);
        }
    });
}
Posted by: Guest on June-08-2020

Code answers related to "Find location by latitude and longitude Google Maps JavaScript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language