I'm getting
XMLHttpRequest cannot load https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=bl79yt&destinations=cw73bz&key=mykey. No 'Access-Control-Allow-Origin' header is present on the requested resource.
In my angular app. I have my http request to the google distance matrix like this :
var url = 'https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=' + pcodefrom + '&destinations=' + pcodeto + '&key=mykeyhere';
console.log(url);
$http({method: 'GET', url: url,headers: {
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "SAMEORIGIN",
"X-Rack-CORS": "preflight-hit; no-origin"
}}).success(function(data) {
};
}).error(function(data){
});
Ive allowed the website url in the google api console but it's still not working.