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

后端 未结 6 1726
梦毁少年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:34

    As of 2016, you can use the new Street View Image Metadata API.

    Now you just need the status field to know if a panorama is found.


    Example requests:

    https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=78.648401,14.194336&fov=90&heading=235&pitch=10&key=YOUR_API_KEY

    {
       "status" : "ZERO_RESULTS"
    }
    


    https://maps.googleapis.com/maps/api/streetview/metadata?size=600x300&location=eiffel%20tower,%20paris,%20france&heading=-45&pitch=42&fov=110&key=YOUR_API_KEY

    {
       ...
       "status" : "OK"
    }
    

提交回复
热议问题