Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angularjs 如何访问GoogleMapAPI获取地址取决于pincode?_Angularjs_Google Maps - Fatal编程技术网

Angularjs 如何访问GoogleMapAPI获取地址取决于pincode?

Angularjs 如何访问GoogleMapAPI获取地址取决于pincode?,angularjs,google-maps,Angularjs,Google Maps,我使用了下面的代码来获取地址依赖于pincode,但给出了错误 $http.get('//maps.googleapis.com/maps/api/geocode/json?address=500082&sensor=true') .then(function (results) { return results; }); 我设定 $httpProvider.defaults.he

我使用了下面的代码来获取地址依赖于pincode,但给出了错误

$http.get('//maps.googleapis.com/maps/api/geocode/json?address=500082&sensor=true')
                .then(function (results) {
                    return results;
                });
我设定

 $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
    $httpProvider.defaults.withCredentials = true;
在配置块中

错误:-XMLHttpRequest无法加载。对飞行前请求的响应未通过访问控制检查:当凭据标志为true时,“访问控制允许来源”标头中不能使用通配符“*”。因此,不允许访问源“”。XMLHttpRequest的凭据模式由withCredentials属性控制