detecting “we have no imagery” of google maps street view static images

后端 未结 6 1706
梦毁少年i
梦毁少年i 2021-02-13 17:43

I\'m generating street view static images like so:

https://maps.googleapis.com/maps/api/streetview?size=1080x400&location=%s&fov=90&heading=235&pitch=0&a

6条回答
  •  感动是毒
    2021-02-13 18:39

    You can use the getPanoramaByLocation function (see http://code.google.com/apis/maps/documentation/javascript/services.html#StreetViewService).

    try something like this:

    function handleMapClick()
    {
     var ll= new google.maps.LatLng(latitude,longitude);
     sv.getPanoramaByLocation(ll, 50, processSVData);
    }
    
    function processSVData(data, status) {
     if (status==google.maps.StreetViewStatus.ZERO_RESULTS)
     {
       
     }
    }
    

提交回复
热议问题