谷歌街景网址

发布于 2024-07-10 21:33:11 字数 245 浏览 13 评论 0原文

您好,我有一个属性的地址,我的应用程序可以启动浏览器来访问 http://maps.google .com?q=searchStringHere。 如果找到良好的匹配,它将直接带到那里。 我可以在 url 中附加任何内容,使其在没有确切坐标的情况下切换到街景吗? 我不想编写任何 JavaScript 或 Flash 代码。

Hi I have the address of a property and my application can launch a browser to go to http://maps.google.com?q=searchStringHere. If a good match is found it will take it directly there. Is there any thing I can append to the url to make it switch to streetview without having the exact coordinates? I dont't want to code any javascript or flash.

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

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

发布评论

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

评论(5

人疚 2024-07-17 21:33:11

构建 Google 街景 URL

基本 Google 地图 URL
http://maps.google.com/maps?q=

q= 查询 - 任何已传递的内容此参数中的内容被视为已在maps.google.com 页面上的查询框中输入。

显示 GPS 线位置的基本网址

http://maps.google.com/maps?q =31.33519,-89.28720

http://maps.google.com/ maps?q=&layer=c

layer= 激活叠加层。 当前选项是“t”交通,“c”街景。 附加(例如,layer=tc)以表示同时。

http://maps.google.com/maps?q=& layer=c&cbll=

cbll= 街景视图的纬度、经度

http://maps.google.com/maps?q=&layer=c&cbll=31.33519,-89.28720

http://maps.google.com/maps?q=&layer=c&cbll= 31.335198,-89.287204&cbp=

cbp= 街景窗口,接受 5 个参数:

  1. 街景/地图排列,11=上半街景和下半地图,12=主要是街景和角落地图

  2. 旋转角度/方位(以度为单位)

  3. 倾斜角度,-90(垂直向上)至 90(垂直向下)

  4. 缩放级别,0-2

    p>

  5. 俯仰(以度为单位)-90(垂直向上)至 90(垂直向下),默认 5

下面的一项是:(11)上半部街景和下半部地图,(0)朝北,(0)直行,(0)正常缩放,(0)Pitch of 0

这一项的作用是就是,如果你想面向不同的方向(11后面的0),只需改变电线即可
http://maps.google.com/maps?q=&layer=c&cbll=31.335198,-89.287204&cbp=11,0,0,0,0

了解更多 Google 街景代码解释

Building a Google Street View URL

Basic Google Map URL
http://maps.google.com/maps?q=

q= Query - anything passed in this parameter is treated as if it had been typed into the query box on the maps.google.com page.

Basic url to display GPS cords location

http://maps.google.com/maps?q=31.33519,-89.28720

http://maps.google.com/maps?q=&layer=c

layer= Activates overlays. Current options are "t" traffic, "c" street view. Append (e.g. layer=tc) for simultaneous.

http://maps.google.com/maps?q=&layer=c&cbll=

cbll= Latitude,longitude for Street View

http://maps.google.com/maps?q=&layer=c&cbll=31.33519,-89.28720

http://maps.google.com/maps?q=&layer=c&cbll=31.335198,-89.287204&cbp=

cbp= Street View window that accepts 5 parameters:

  1. Street View/map arrangement, 11=upper half Street View and lower half map, 12=mostly Street View with corner map

  2. Rotation angle/bearing (in degrees)

  3. Tilt angle, -90 (straight up) to 90 (straight down)

  4. Zoom level, 0-2

  5. Pitch (in degrees) -90 (straight up) to 90 (straight down), default 5

The one below is: (11) upper half Street View and lower half map, (0) Facing North, (0) Straight Ahead, (0) Normal Zoom, (0) Pitch of 0

This one works as is, just change the cords and if you want to face a different direction (the 0 after 11)
http://maps.google.com/maps?q=&layer=c&cbll=31.335198,-89.287204&cbp=11,0,0,0,0

For more Google Street View code interpertation

童话 2024-07-17 21:33:11

不幸的是不是——根据地址,没有简单的答案。

首先,Google 地图网站的参数列表已记录在此处,因此您可以使用它作为起点。

最简单的部分是您需要选择街景图层“&layer=c”。

但是,在该图层中显示任何内容之前,您需要指定视图所在的位置。 您可以通过 cbll 中的纬度和经度以及 cbp 中的一些选项设置相机的角度来设置位置。

要从地址获取纬度和经度,您需要使用 地理编码服务,例如 Google 地图 api

但是,这只能让您看到该地址附近的街景。 除了知道街景需要来自哪里之外,您还需要知道将相机指向哪个角度 - 每个地址的角度都不同,具体取决于街景相机拍摄照片的最近点所在的位置,因此自动完成并不容易(根据我所知的任何可用信息......)

Unfortunately not - there's no simple answer, based on the address.

Firstly, the list of parameters for the Google Maps site is documented here, so you can use that as your starting point.

The easy part is that you need to select the streetview layer "&layer=c".

However, before anything will display in that layer, you need to specify where your view is. You set the position by the latitude and longitude in cbll and the angle of the camera with some options in cbp.

To get the latitude and longitude from the address, you need to use a geocoding service, like the google maps api.

However, this will only get you a street view close to the address. In addition to knowing where the street view needs to be from, you also need to know which angle to point the camera at - this will be different for every address, depending on where the nearest point the StreetView camera took a photo from was, so it's not easy to do automatically (with any information that I know is available...)

清晰传感 2024-07-17 21:33:11

更新 07/2019

到目前为止,10/2018 的解决方案仍然适用于我,但我找到了构建街景 URL 的官方记录方法:

形成街景 URL

https://www.google.com/maps/@ ?api=1&map_action=pano¶meters

参数

  • ma​​p_action=pano (必需):指定要显示的视图类型。 地图和街景共享相同的端点。 为了确保显示全景图,必须将操作指定为 pano。

还需要以下 URL 参数之一:

  • 视点:查看器显示最接近视点位置拍摄的全景图,指定为以逗号分隔的纬度/经度坐标(例如 46.414382,10.013988) 。 由于街景图像会定期刷新,并且每次拍摄的照片可能会略有不同,因此当图像更新时,您所在的位置可能会捕捉到不同的全景图。

  • pano:要显示的图像的特定全景 ID。 如果您指定全景,您还可以指定视点。 仅当 Google 地图找不到全景 ID 时才使用该视点。 如果指定了全景但未找到,并且未指定视点,则不会显示全景图像。 相反,Google 地图会以默认模式打开,显示以用户当前位置为中心的地图。

以下 URL 参数是可选的:

  • heading:以北顺时针方向指示摄像机的罗盘方向。 可接受的值范围是 -180 到 360 度。 如果省略,则根据查询的视点(如果指定)和图像的实际位置选择默认航向。

  • 俯仰:指定相机的向上或向下角度。 俯仰角度以 -90 到 90 度为单位指定。正值将使相机向上倾斜,而负值将使相机向下倾斜。 默认间距 0 是根据捕获图像时相机的位置设置的。 因此,0 节距通常(但并不总是)是水平的。 例如,在山上拍摄的图像可能会呈现非水平的默认倾斜度。

  • fov:确定图像的水平视野。 视野以度数表示,范围为 10 - 100。默认为 90。处理固定大小的视口时,视野被视为缩放级别,数字越小表示缩放级别越高.

示例 1:仅使用视点来指定位置。

https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=48.857832,2.295226& header=-45&pitch=38&fov=80

来源:https:// /developers.google.com/maps/documentation/urls/guide
(滚动到底部查看街景 URL)

UPDATE 07/2019:

Solution of 10/2018 still works for me as of now, but I have found an official documented way to construct the Street View URL:

Forming the Street View URL

https://www.google.com/maps/@?api=1&map_action=pano¶meters

Parameters

  • map_action=pano (required): Specifies the type of view to display. Maps and Street View share the same endpoint. To ensure a panorama is displayed, the action must be specified as pano.

One of the following URL parameters is also required:

  • viewpoint: The viewer displays the panorama photographed closest to the viewpoint location, specified as comma-separated latitude/longitude coordinates (for example 46.414382,10.013988). Because Street View imagery is periodically refreshed, and photographs may be taken from slightly different positions each time, it's possible that your location may snap to a different panorama when imagery is updated.

  • pano: The specific panorama ID of the image to display. If you specify a pano you may also specify a viewpoint. The viewpoint is only used if Google Maps cannot find the panorama ID. If pano is specified but not found, and a viewpoint is NOT specified, no panorama image is displayed. Instead, Google Maps opens in default mode, displaying a map centered on the user's current location.

The following URL parameters are optional:

  • heading: Indicates the compass heading of the camera in degrees clockwise from North. Accepted values are from -180 to 360 degrees. If omitted, a default heading is chosen based on the viewpoint (if specified) of the query and the actual location of the image.

  • pitch: Specifies the angle, up or down, of the camera. The pitch is specified in degrees from -90 to 90. Positive values will angle the camera up, while negative values will angle the camera down. The default pitch of 0 is set based on on the position of the camera when the image was captured. Because of this, a pitch of 0 is often, but not always, horizontal. For example, an image taken on a hill will likely exhibit a default pitch that is not horizontal.

  • fov: Determines the horizontal field of view of the image. The field of view is expressed in degrees, with a range of 10 - 100. It defaults to 90. When dealing with a fixed-size viewport, the field of view is considered the zoom level, with smaller numbers indicating a higher level of zoom.

Example 1: Uses only a viewpoint to specify location.

https://www.google.com/maps/@?api=1&map_action=pano&viewpoint=48.857832,2.295226&heading=-45&pitch=38&fov=80

Source: https://developers.google.com/maps/documentation/urls/guide
(scroll to the bottom for Street View URLs)

南七夏 2024-07-17 21:33:11

更新 10/2018

GET API(参见 Haygood 的回答)似乎已经过时,但某些调用似乎仍然有效。

基本网址

更改为 http://www.google.com/maps (map.google.com/maps 仍然有效,但会重定向)

参数:

  • q:被忽略,可以跳过
    更多 Google 街景代码解释

  • 图层:参数必须设置为c< /em> (t 不再受支持并破坏它)

  • cbll:纬度和经度(不变)
  • cbp:仅仍然支持参数 2(旋转角度)和 5(俯仰)

    1. 被忽略,可以是0或空字符串

    2. 旋转角度/方位(以度为单位)

    3. 被忽略,可以是0或空字符串

    4. 被忽略,可以是0或空字符串

    5. 俯仰(以度为单位)-90(垂直向上)到 90(垂直向下)

更新示例:http://www.google.com/maps?layer=c&cbll=31.335198,-89.287204

http:// www.google.com/maps?layer=c&cbll=31.335198,-89.287204&cbp=,30,,,20,旋转角度 30,俯仰角度 20。

Update 10/2018

The GET API (see Haygood's answer) seems to be outdated but some calls still seem to work.

Base URL:

changed to http://www.google.com/maps (map.google.com/maps still works but redirects)

Parameters:

  • q: is ignored, can be skipped
    For more Google Street View code interpertation

  • layer: The parameter must be set to c (t is no more supported and breaks it)

  • cbll: latitude and longitude (unchanged)
  • cbp: only parameter 2 (rotation angle) and 5 (pitch) are still supported

    1. is ignored, can be 0 or empty string

    2. Rotation angle/bearing (in degrees)

    3. is ignored, can be 0 or empty string

    4. is ignored, can be 0 or empty string

    5. Pitch (in degrees) -90 (straight up) to 90 (straight down)

Updated examples: http://www.google.com/maps?layer=c&cbll=31.335198,-89.287204

or http://www.google.com/maps?layer=c&cbll=31.335198,-89.287204&cbp=,30,,,20 with rotation 30 and pitch 20.

难理解 2024-07-17 21:33:11

您可以通过按街景视图顶部的链接按钮来获取这些值。

You can get the values by pressing the link button at the top of the street view.

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