gpt4 book ai didi

ios - GMSPanoramaView 方向与网络上的 Google map 不一致

转载 作者:行者123 更新时间:2023-11-29 06:02:13 24 4
gpt4 key购买 nike

我在我的应用程序中使用谷歌地图 SDK 中的街景 API。要求是显示街景并禁用手势控制。我已将此代码添加到我的应用程序

    GMSPanoramaView *panoView = [[GMSPanoramaView alloc] initWithFrame:CGRectMake(0, 0, _placesView.frame.size.width, _placesView.frame.size.height)];
[_placesView addSubview:panoView];
panoView.delegate = self;
[panoView setAllGesturesEnabled:NO];
[panoView moveNearCoordinate:addresslocationCoordinates];

但是呈现街景时我得到的方向与网络上的方向不同。

enter image description here enter image description here

两张图片中的位置相同,但它们的方向不同。

如果我想将街景 View 与 WebView 对齐,那么应该做什么?

最佳答案

您需要在 iPhone 应用程序中设置 StreetView 视角 (POV),如下所示:

panoView.camera = GMSPanoramaCamera(heading: 180, pitch: -10, zoom: 1)

因此,根据上述值,您的街道头像将显示在您的设备上。

Orientation

The Street View location defines the placement of the camera focus for an image, but it does not define the orientation of the camera for that image. For that purpose, the GMSOrientation object defines two properties:

heading: defines the rotation angle around the camera locus in degrees relative from true north. Headings are measured clockwise: true north is 0, east is 90, south is 180, west is 270.

pitch: (default 0) defines the angle variance "up" or "down" from the camera's initial default pitch, which is often (but not always) flat horizontal. (For example, an image taken on a hill will likely exhibit a default pitch that is not horizontal.) Pitch angles are measured with positive values looking up (to +90 degrees straight up and orthogonal to the default pitch) and negative values looking down (to -90 degrees straight down and orthogonal to the default pitch).

希望这有助于设置您的街景头部位置!

关于ios - GMSPanoramaView 方向与网络上的 Google map 不一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54533394/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com