从 Google 街景获取 lat/lng/zoom/yaw/pitch
我有一个基于提供的纬度/经度坐标、缩放、偏航和俯仰的谷歌地图和街景。 每当任何详细信息从默认值更改或单击按钮时,我都需要调用 JavaScript 来更新每个值的隐藏字段。
因此,每当地图/街景视图被放大、平移、倾斜等时,它都会输出新的细节。
每当街景视图更改时,如何调用函数 getPOV()、yawchanged(yaw:Number)、pitchchanged(pitch:Number) 和 Zoomchanged(zoom:Number)(类似于地图的 moveend)
I have a Google map and street view based on provided lat/lng coordinates, zoom, yaw and pitch. I need to invoke a javascript to update a hidden field for each of these values whenever any of the details change from their default or when a button is clicked.
So whenever the map/street view is zoomed in, panned, tilted etc it outputs the new details.
How do I call the functions getPOV(), yawchanged(yaw:Number), pitchchanged(pitch:Number), and zoomchanged(zoom:Number) whenever the Street View is changed (similar to moveend for Maps)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不确定压缩它的最佳方法,但这可以获取更改的详细信息:
Not sure of the best way to compress this but this works to get the changed details:
我通常发现“moveend”是用作钩子的最佳事件,用于在用户更改地图时获取地图的状态。 当我今天下午有更多时间时,我需要查找如何从地图中获取纬度/经度、缩放、偏航和俯仰角
I generally have found that "moveend" is the best event to use as a hook to get the state of the map when a user changes it. I will need to look up how to get the lat/lng, zoom, yaw, and pitch from the map isntanct when I have more time this afternoon
对于谷歌地图 API v3...假设您已经加载了名为“panorama”的街景地图
For google maps api v3... Assuming you have a streetView map already loaded named "panorama"