javascript - Angular can not call google API service -


i trying use google place service

$http({     method : 'get',     url : 'https://maps.googleapis.com/maps/api/place/textsearch/json?query=hotels in us&key=xxxxxxxxx&callback=json_callback' }) .success(function(data) {     console.log('data' + data); }) .error(function(data) { }); 

api call ok 200. on console gives error xmlhttprequest cannot load https://maps.googleapis.com/maps/api/place/textsearch/json?query=hotels%20in%20us&key=xxxxu&callback=json_callback. no 'access-control-allow-origin' header present on requested resource. origin 'https://192.168.1.85:8443' therefore not allowed access.

i change method:jsonp returns data syntax error : required. server tomcat 7. using cors filtercom.thetransactioncompany.cors.corsfilter .

try changing $http() $http.jsonp(url).succes....


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -