2

有没有办法使用 JavaScript API 在 Google 地球插件中逐步绘制一条线?

如果那不可能,是否有一种方法可以达到相同的效果?

我想要实现的类似于:http ://www.wolfpil.de/v3/animated-poly_v3.html

4

1 回答 1

2

是的,这完全有可能,公平地说,将示例中的代码转换为使用地球而不是地图 API 是微不足道的。您需要做的就是找到对地图对象的任何引用,并简单地使用等效的地球 api 对象。数学和时间都为你完成了......

如果您想转换它,请查看以下链接,它们应该为您提供您需要知道的一切。

几何和叠加信息

https://developers.google.com/earth/documentation/geometries

画线串示例

http://earth-api-samples.googlecode.com/svn/trunk/examples/linestring.html

带有 frameend 的平滑动画示例

http://earth-api-samples.googlecode.com/svn/trunk/examples/event-frameend.html

最后,您也可以将 earth 插件添加到 maps 实现中,看看下面的 Maps/Earth Integration 示例。这只是意味着将几行代码添加到您发布的示例中,允许从地图 api 激活“地球”模式。如果设置正确,则可以在地图/地球显示中使用折线等内容。

地球地图集成

http://earth-api-samples.googlecode.com/svn/trunk/examples/maps-integration.html

强大的集成示例

http://earth-api-samples.googlecode.com/svn/trunk/demos/mapsapi/beefy.html

于 2012-02-25T19:58:17.617 回答