I'm using GoogleMaps/StreetView option for my web page . But when StreetView it's not available for some locations it just goes grey .
I want to show an alert with JavaScript when the StreetView for that location it's not available .
function initialize(imei) {
$.ajax(
{
dataType: "json",
url: "index.php/application/getcordinatesgoogle/" + imei,
}).done(function( response ) {
var cafe = new google.maps.LatLng(response.y,response.x);
var panoramaOptions = {
position: cafe,
pov: {
heading: 270,
pitch: 0
},
visible: true
};
var panorama = new google.maps.StreetViewPanorama(document.getElementById('pano'), panoramaOptions);
});
When no data is available it doesnt show any alert .
You can use the
getPanoramaByLocation
method of the StreetViewService class.