获取 Google StreetView API 的 POV [英] Getting the POV for Google StreetView API

查看:34
本文介绍了获取 Google StreetView API 的 POV的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用 Google 街景全景嵌入 并且我想获取特定地址的 POV(更具体地说是标题).

I am currently using the Google Street View Panorama embed and I want to get the POV (more specifically heading) for a particular address.

Google 通过 maps.google.com 执行此操作,在那里,给定一个地址,它会将您放入街景,它将面向正确的方向.但是,我似乎无法找出/找到有关通过 API 查找 POV 标题的方法的文档.

Google does this via maps.google.com, where, given an address, it'll drop you into street view and it will face the right way. However, I can't seem to figure out / find documentation for a way to find the POV heading via the API.

我可以使用 LatLng 使街景嵌入正常工作,但相机通常朝向错误的方向.有什么想法吗?

I can get the Street View embed to work fine with a LatLng, but the camera is usually facing the wrong direction. Any ideas?

编辑:清晰

我想设置 POV,但我不知道该设置为什么值...

I want to set the POV, but I don't know what value to set it to...

推荐答案

所需地址的 latLng 和全景位置(拍摄图像的街景车的位置)的 latLng 不一样.据我所知,API 没有在地址 latlng 的正确方向上设置标题,您必须自己设置.

The latLng of the required address and the latLng of the panorama location (the position of the streetview car from where images are shot) are not the same. As far as I know, the API does not set the heading in the right direction of the address latlng, you will have to set it yourself.

我就是这样做的,我使用 StreetViewService 找到最近的可用全景照片,然后使用 computeHeading 方法计算 Pov 标题这里

This is how I did it, I used the StreetViewService to find the nearest panorama shot available and then calculated the Pov heading using the computeHeading method here

这篇关于获取 Google StreetView API 的 POV的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆