I red all previous posts: * i added : &callback=JSON_CALLBACK * i also tried simple $http.get but it leads to: 'Access-Control-Allow-Origin' * i also tried to define jsonpCallbackParam to'json_callback' from just callback and added format: 'jsonp' *also tried to read documentation about $sce.trustAsResourceUrl(url) (well i didn't understand much :-( On F12 -> source, i see that the required data is returned but on the console log i get Uncaught SyntaxError: Unexpected token .
please advise
var autoJsonpUrl = 'https://maps.googleapis.com/maps/api/distancematrix/json?region=il&origins=tel-aviv&destinations=jerusalem&key=AIzaSyD3xhn92KwStkZAg-rZueAFI1LooRLpND0' + '&callback=JSON_CALLBACK';
var options =
{
jsonpCallbackParam: 'json_callback',
cache: false
};
$http.jsonp(autoJsonpUrl, options).then(function (response) {
console.log(response);
});