I'm using Google API for getting Street View.
My Code :
$.ajax({
url: 'https://maps.googleapis.com/maps/api/streetview?size=600x300&location=46.414382,10.013988&heading=151.78&pitch=-0.76&key=MY_KEY',
contentType: "image/jpeg",
type: 'GET',
cache: false,
success: function(data) {
console.log('got data', data);
},
error: function(error) {
console.log('Error', error);
}
});
Where MY_KEY
is my Google API key and location
will be dynamic as per latitude and longitude for particular place.
But it always goes in error
.
And if it successfully runs I want it to bind in html img
tag.