在 Google 地球插件中绘制动画线
有没有办法使用 JavaScript API 在 Google 地球插件中逐步绘制一条线?
如果这不可能,是否有一种迂回的方法可以达到相同的效果?
我想要实现的目标与此类似: http://www.wolfpil.de/v3 /animated-poly_v3.html
Is there a way to incrementally draw a line in the Google Earth Plug-in using the JavaScript API?
If that's not possible, is there a round about method to achieve the same effect?
What I want to achieve is similar to this: http://www.wolfpil.de/v3/animated-poly_v3.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是完全可能的,公平地说,将示例中的代码转换为使用地球而不是地图、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 插件添加到地图实现中,看一下下面的地图/地球集成示例。这仅意味着在您发布的示例中添加几行代码,以允许从地图 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
Yes this is entirely possible, and to be fair it would be trivial to convert the code in the example to use the earth, rather than maps, api. All you would need to do is to find any references to maps objects and simply use the equivalent earth api objects. The math and timing is all done for you...
If you wanted to convert it take a look at the following links, they should give you everything you need to know.
Information on Geometries and Overlays
https://developers.google.com/earth/documentation/geometries
Example of Drawing line strings
http://earth-api-samples.googlecode.com/svn/trunk/examples/linestring.html
Example of Smooth Animation with frameend
http://earth-api-samples.googlecode.com/svn/trunk/examples/event-frameend.html
Finally, you could also just add the earth plugin to the maps implementation, take a look at the following example of Maps/Earth Integration. This would just mean adding the a few lines of code to the example you posted allowing the 'earth' mode to be activated from the maps api. If set up correctly things like polylines are available across the map/earth displays.
Earth Maps integration
http://earth-api-samples.googlecode.com/svn/trunk/examples/maps-integration.html
Beefy integration example
http://earth-api-samples.googlecode.com/svn/trunk/demos/mapsapi/beefy.html