Google 手机街景 URL - 结果与桌面不同

Google Street View URL for Mobile - different results than Desktop

相同的 URL 通过移动设备和桌面设备给出不同的结果。 街景的某种 URL 格式在不同的设备上显示不同的结果。

这是 URL 格式的起始参考:Google street view URL

当我加载这个 URL 时: http://maps.google.com/maps?q=&layer=c&cbll=40.741895,-73.989308

在 chrome 中通过桌面:我看到海滩的街景

in chrome via Android 移动设备:我得到了纽约街道的街景(正确答案)

似乎 google 通过桌面显示了用户制作的视图(照片),通过移动设备显示了 google 制作的照片。

但在另一个 url 中: http://maps.google.com/maps?q=&layer=c&cbll=32.0522032,34.7633459

在 chrome 中通过桌面:我得到正确的街景,由 google

制作

在chrome中通过Android移动设备:"No results found for your search"

我想这个错误不会影响 Google 因为他们在他们的服务中使用不同的街景入口点...

我的目标是在 Android 应用程序的网络视图中呈现 Google 街景视图,我正在尝试为此获取正确的 URL 格式。 有谁知道正确的格式是什么?

Google官方支持和推荐的方式是使用Google Maps URLs。 Google 地图 URLs 允许创建通用的跨平台 URLs,可以在桌面和移动设备上使用并支持街景模式

The pano action lets you launch a viewer to display Street View images as interactive panoramas. Each Street View panorama provides a full 360-degree view from a single location. Images contain 360 degrees of horizontal view (a full wrap-around) and 180 degrees of vertical view (from straight up to straight down). The pano action launches a viewer that renders the resulting panorama as a sphere with a camera at its center. You can manipulate the camera to control the zoom and the orientation of the camera.

您的示例可能会使用 Google 地图 URLs

重写

https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=40.741895,-73.989308

然而,不幸的是,它让我在桌面上看到了海滩街景。我认为这是 Google 方面的数据问题,您可以使用地图右下角的 Report a problem link 向 Google 报告问题。

与此同时,我可以建议以下解决方法。您可以使用 Street View API metadata 服务获取您感兴趣的点的全景 ID

例如https://maps.googleapis.com/maps/api/streetview/metadata?location=40.741895%2C-73.989308&source=outdoor&key=YOUR_API_KEY

请注意,此服务是免费的,不会占用您的配额

Street View Static API metadata requests are free to use. No quota is consumed when you request metadata.

它还支持一个 source 参数,允许过滤掉非 Google 全景图。在上述示例中,我得到以下元数据响应

{
  "copyright":"© Google, Inc.",
  "date":"2017-11",
  "location":{
    "lat":40.7419078,
    "lng":-73.9893223
  },
  "pano_id":"qH-ml27SSSYEXUCTT2NrhQ",
  "status":"OK"
}  

所以,现在我可以使用 pano ID 创建 Google 地图 URL,这将打开预期的街景全景图

https://www.google.com/maps/@?api=1&map_action=pano&pano=qH-ml27SSSYEXUCTT2NrhQ

希望对您有所帮助!