mardi 31 juillet 2018

REQUEST_DENIED for google geocoding API

 geocoder.geocode({ 'address': address }, function (results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
        var latitude = results[0].geometry.location.lat();
        var longitude = results[0].geometry.location.lng();
        document.getElementById('latitude').setAttribute('value', latitude);
        document.getElementById('longitude').setAttribute('value',  longitude);
        var lat = parseFloat(latitude);
        var lng = parseFloat(longitude);
        var latlng = new google.maps.LatLng(lat, lng);
        var geocoder = new google.maps.Geocoder();
        geocoder.geocode({ 'latLng': latlng }, function (results, status) {
            if (status == google.maps.GeocoderStatus.OK) {
                if (results[1]) {
                    document.getElementById('physicaladdress').setAttribute('value', results[1].formatted_address);
                }
            }
        });
    } else {
       console.log(""+status);
    }
});

This is my javascript file where i am trying to get latitude and longitude from zip code ,it is working fine in localhost but not when it is hosted live(say aws)

{} ,this i am giving into the app.blade.php , any help would be much appreciated sorry if i am missing anything while asking question.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire