I am trying to use Google Maps API to pull the list of places that show up in my search in a JSON list format. I have a map in an iframe that shows the stores I am looking up but I keep getting an error of "Unexpected syntax : found"
Here is the JSON request I am running and the http link I am trying to get shows the JSON data of I copy past it directly in the url bar but it does not send the JSON data to my script.
$http.jsonp("https://maps.googleapis.com/maps/api/place/textsearch/json?query=groceries&location=42.294,-83.721&rankedBy=distance&key=THIS_IS_MY_KEY").then(function mySuccess(response) {
console.log(response.data);
}, function myError(response) {
console.log(response.data);
});
I have checked and rechecked the link and it works when I copy paste and follows the API to the T. My script can populate a map with the search results, I just cant get the JSON. I can put in a different url and it will work fine. I think the problem is using the google api generated url that does the search for me. It must have layers of security that prohibit me from being able to pull the content as a JSON object. I just don't know what it is nor how to get around it.