使用纬度/经度链接到 Google 街景

发布于 2024-08-30 19:49:21 字数 126 浏览 2 评论 0原文

我正在尝试制作一个使用纬度/经度坐标链接到 Google 街景的应用程序,并显示最近道路的街景。这是来自一个相当小且覆盖良好的区域,因此在海洋中央不会有任何坐标。

是否有已发布的 API 显示直接链接到街景所需的获取参数?

I'm trying to make an app that links to Google streetview using latitude/longitude coordinates, and shows a streetview of the nearest road. This is coming from a fairly small and well covered area, so there isn't going to be any coordinates in the middle of the ocean.

Is there a published API showing the get parameters you need to link directly to streetview?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

聊慰 2024-09-06 19:49:21

您可能有兴趣查看以下参考资料,其中描述了可以传递到maps.google.com的所有已知参数,包括街景参数:

虽然这不是官方 API,但我认为公平地说这些应该是相当可靠,因为它们与 Google 地图中的永久链接使用的参数相同。

有了这个,您应该能够构建如下所示的内容:

http: //maps.google.com/?cbll=40.714103,-74.006206&cbp=12,20.09,,0,5&layer=c

You may be interested in checking out the following reference, which describes all the known parameters that can be passed to maps.google.com, including Street View parameters:

While this is not an official API, I think it is fair to say that these should be quite reliable, since they are the same parameters used for the permanent links in Google Maps.

With this, you should be able to construct something like the following:

http://maps.google.com/?cbll=40.714103,-74.006206&cbp=12,20.09,,0,5&layer=c

要走就滚别墨迹 2024-09-06 19:49:21

如果您想从街景服务中提取原始 jpeg,这可以相当容易地完成。此处讨论了该技术:

http://jamiethompson .co.uk/web/2010/05/15/google-streetview-static-api/

全景图的 XML 元数据可以从以下请求中获取,

http://cbk0.google.com/cbk?output=xml&ll=[LAT,LNG]

该请求会得到如下内容:

<panorama>
<data_properties image_width="13312" image_height="6656" tile_width="512" tile_height="512" pano_id="sLaiF6Jex7mJmNol7tdOoA" num_zoom_levels="3" lat="51.495090" lng="-0.146971" original_lat="51.495098" original_lng="-0.147000">
    <copyright>© 2010 Google</copyright>
    <text>Eccleston Pl</text>
    <region>London, England</region>
    <country>United Kingdom</country>
    <data_flag>1</data_flag>
</data_properties>
<projection_properties projection_type="spherical" pano_yaw_deg="201.78" tilt_yaw_deg="92.06" tilt_pitch_deg="1.75"/>
<annotation_properties>
    <link yaw_deg="204.7" pano_id="CeutxcyB2V74lfN_fJwRww" road_argb="0x80ffffff">
        <link_text>Eccleston Pl</link_text>
    </link>
    <link yaw_deg="24.7" pano_id="t_mnKSugTLrQTEnJplXQ3A" road_argb="0x80ffffff">
        <link_text>Eccleston Pl</link_text>
    </link>
</annotation_properties>

然后,pano_ids 可用于从街景 API

缩略图

http://cbk0.google.com/cbk?output=thumbnail&w=416&h=208&panoid=sLaiF6Jex7mJmNol7tdOoA

平铺

http: //cbk0.google.com/cbk?output=tile&panoid=sLaiF6Jex7mJmNol7tdOoA&zoom=4&x=0&y=3

If you want to extract the raw jpegs from the Streetview service this can be done fairly easily. The technique is discussed here:

http://jamiethompson.co.uk/web/2010/05/15/google-streetview-static-api/

XML metadata for a panorama can be gained from the following request

http://cbk0.google.com/cbk?output=xml&ll=[LAT,LNG]

which gets you something like this:

<panorama>
<data_properties image_width="13312" image_height="6656" tile_width="512" tile_height="512" pano_id="sLaiF6Jex7mJmNol7tdOoA" num_zoom_levels="3" lat="51.495090" lng="-0.146971" original_lat="51.495098" original_lng="-0.147000">
    <copyright>© 2010 Google</copyright>
    <text>Eccleston Pl</text>
    <region>London, England</region>
    <country>United Kingdom</country>
    <data_flag>1</data_flag>
</data_properties>
<projection_properties projection_type="spherical" pano_yaw_deg="201.78" tilt_yaw_deg="92.06" tilt_pitch_deg="1.75"/>
<annotation_properties>
    <link yaw_deg="204.7" pano_id="CeutxcyB2V74lfN_fJwRww" road_argb="0x80ffffff">
        <link_text>Eccleston Pl</link_text>
    </link>
    <link yaw_deg="24.7" pano_id="t_mnKSugTLrQTEnJplXQ3A" road_argb="0x80ffffff">
        <link_text>Eccleston Pl</link_text>
    </link>
</annotation_properties>

The pano_ids can then be used to get thumbnails or high resolution tiles from the streetview API

Thumbnail

http://cbk0.google.com/cbk?output=thumbnail&w=416&h=208&panoid=sLaiF6Jex7mJmNol7tdOoA

Tile

http://cbk0.google.com/cbk?output=tile&panoid=sLaiF6Jex7mJmNol7tdOoA&zoom=4&x=0&y=3

苦笑流年记忆 2024-09-06 19:49:21

您是指这个之类的东西吗?

Do you mean something like this?

瑕疵 2024-09-06 19:49:21

以下是坐标 40.437, -79.962(纬度、经度)处的街景图片的链接:

http://maps.google.com/maps?f=q&hl=en&geocode=&sll=40.437965,-79.96253&sspn= 0.007104,0.020084&layer=c&ie=UTF8&ll=40.437361,-79.960599&spn=0.007104,0.027122&z=16&cbll=40.433975,-79.962101&cbp=2,1 42.0851621378081,,0,3.3364732946064946

我不知道为什么坐标会重复几次,我怀疑这可能与观看方向等有关。我还没有检查这是否适用于其他坐标。希望这有帮助。

The following is a link to a streetview picture at coordinates 40.437, -79.962 (lat,lon):

http://maps.google.com/maps?f=q&hl=en&geocode=&sll=40.437965,-79.96253&sspn=0.007104,0.020084&layer=c&ie=UTF8&ll=40.437361,-79.960599&spn=0.007104,0.027122&z=16&cbll=40.433975,-79.962101&cbp=2,142.0851621378081,,0,3.3364732946064946

I'm not sure why the coordinates are repeated a few times, I suspect it might have something to do with viewing direction and the like. I haven't checked whether this works for other coordinates. Hope this helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文