angularjs - How to call google's location api from locally hosted angular project -
i developing angular application , in controller @ point in time need call google api json response. restricted call api because making cross origin requests. localhost google api. using chrome , tried firefox. tried bit on internet , there can not find exact answer return json resut. below code. can 1 here?? running on python server port 85 (using ubuntu)
$http({ method: 'post', url: api }).then(function successcallback(response) { console.log(response.data);//cant data :( }, function errorcallback(response) { // called asynchronously if error occurs // or server returns response error status. });
error browser giving
xmlhttprequest cannot load https://maps.googleapis.com/maps/api/distancematrix/json?origins=88,86&destinations=3,2&mode=bus. no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:85' therefore not allowed access.
Comments
Post a Comment