I am trying to get JSON (gas stations in some radius) from google-map-api with the following code:
var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=50.4016469,30.6269542&radius=500&keyword=%D0%B7%D0%B0%D0%BF%D1%80%D0%B0%D0%B2%D0%BA%D0%B0&key=AIzaSyDdzZrGvAKqSRj7NHxsW6FqGpx8Bi_nCFw', false);
xhr.onload = function() {
alert(this.responseText);
}
xhr.onerror = function() {
alert('Error ' + this.status);
}
xhr.send();
And have an eroor with CORS «Access-Control-Allow-Origin». Is there any way to get data from google map api?