我想将相机位置重置为更高的位置或更小的变焦。
我在这里查看代码:
http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html
我认为应该使用 DS_simulator 对象来完成,但我无法找出方法。
任何帮助表示赞赏。
我想将相机位置重置为更高的位置或更小的变焦。
我在这里查看代码:
http://earth-api-samples.googlecode.com/svn/trunk/demos/drive-simulator/index.html
我认为应该使用 DS_simulator 对象来完成,但我无法找出方法。
任何帮助表示赞赏。
您可以使用Camera
orLookAt
来实现此目的。放大和缩小由 a 的range
属性和 aLookAt
的altitude
属性控制Camera
。
这是一个range
使用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