下一个 &给定 IP 或纬度/经度的最近 Google 街景
我使用 ipinfodb.com 一段时间来从用户 IP 获取纬度和经度来查看 google 街景。但最近 ipinfodb 改变了他们的数据库,大部分纬度/经度值都改变了,因此我看不到街景。
我正在使用“Google Maps Javascript API V3 Services”,但不确定如何前往下一个和最近的可能的 GoogleStreetview。可以请您推荐一下吗?
问候
I'm using ipinfodb.com for a while to get the Latitude and Longitude from the user IP to view the google streetview. But recently ipinfodb has changed their database, and most the latitude/longitude values are changed, because of which I dont get the streetview.
I'm using "Google Maps Javascript API V3 Services" but not sure on how to the next and nearest possible GoogleStreetview. Could you please suggest.
Regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该 API 在 StreetViewService 类中有一个 getPanoramaByLocation 方法,
如下所示如何获取给定 latLng 位置周围给定半径内的街景的示例,请注意,如果半径小于 50 米,将返回最近的全景图
The API has a getPanoramaByLocation method in StreetViewService Class
Below is an example of how to get a streetview within a given radius around the given latLng position, note that if the radius is less than 50 meters the nearest panorama will be returned
radius 不保证最近的街道视图点。例如:如果视点距离 10m,但您将半径定义为 1000,则不会选择最近的点。因此,如果你有几个点(有些非常接近,有些非常远),那么我仍然会使用迭代:
radius doesn't guarantee the closest street view point. For example: if the view point is 10m away but you define your radius as 1000 then the closest isn't selected. So if you have several points (some really close, some really far) then I would still use iteration: