如何在 Google Earth 中重置相机高度

发布于 2025-01-07 08:23:49 字数 320 浏览 2 评论 0原文

我想将相机位置重置为更高的位置或更小的变焦。

我正在查看这里的代码:

http:// /earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html

我认为应该使用 DS_simulator 对象来完成,但我无法找出如何完成。

任何帮助表示赞赏。

I want to reset the camera position to a much higher position or lesser zoom.

I am looking at the code here:

http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html

I think it should be done using DS_simulator object, but am not able to find out how.

Any help is appreciated.

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

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

发布评论

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

评论(1

看轻我的陪伴 2025-01-14 08:23:49

您可以使用 CameraLookAt 来实现此目的。放大和缩小由 LookAtrange 属性和 Cameraaltitude 属性控制。

以下是使用 lookat 设置范围的快速示例。

// Get the current view.
var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);

// Zoom out to twice the current range.
lookAt.setRange(lookAt.getRange() * 2.0);

// Update the view in Google Earth.
ge.getView().setAbstractView(lookAt);

有关使用这两个对象控制视图的更多信息,请参阅本文档。
https://developers.google.com/earth/documentation/camera_control

此外,您还可以在这里玩一个工作示例。
http://code.google.com/apis/ajax/playground/ ?exp=earth#move_camera

You can use the Camera or LookAt to achieve this. Zooming in and out is controlled by the range attribute for a LookAt, and the altitude attribute for a Camera.

Here is a quick example of setting the range using a lookat.

// Get the current view.
var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);

// Zoom out to twice the current range.
lookAt.setRange(lookAt.getRange() * 2.0);

// Update the view in Google Earth.
ge.getView().setAbstractView(lookAt);

See this document for more information on controling the view using these two objects.
https://developers.google.com/earth/documentation/camera_control

Also, you can play with a working example here.
http://code.google.com/apis/ajax/playground/?exp=earth#move_camera

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