javascript-如何在Google Earth中设置kml文件的动画范围
目前,如果我单击该按钮,地图将开始动画。但它永远不会停止,它无限地活跃。如果有一个地图/文件是 2004-2008 年的,我只想让它自动停止在 2008 年 12 月 31 日。我怎样才能做到这一点?
我尝试过
var timeSpan = ge.createTimeSpan('');
timeSpan.getBegin().set('2004');
timeSpan.getEnd().set('2008');
ge.getTime().setTimePrimitive(timeSpan);
但它不起作用,我认为它可能无法达到我的目的。 所以请帮助我,我很挣扎......
Currently, if I click the button, the map will start to animate. But it never stops, it animates infinitely. If there is a map/file is from 2004-2008, I just want that it stops on 2008-12-31 automatically. How can I do that?
I tried
var timeSpan = ge.createTimeSpan('');
timeSpan.getBegin().set('2004');
timeSpan.getEnd().set('2008');
ge.getTime().setTimePrimitive(timeSpan);
But it does not work, I think it may not work for my purpose.
So please help me, I am so strugling....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以做一些事情,但如果不了解您要构建的内容,就很难知道该推荐什么。一个建议:
这样,用户可能会以干扰您可能试图讲述的故事的方式摆弄 UI(例如拖动滑块)...
您可以在以下位置查看上面提到的大部分代码的示例http://code.google.com/apis/ajax/playground/#internal_clock_rate 以及 http://code.google.com/apis/earth/documentation/time.html
There's a few things you can do, and it's hard to know what to recommend without know more what you are trying to build. One suggestion:
This way a user can'd be fiddling with the UI (e.g. dragging the slider around) in a way that interferes with the story you are probably trying to tell...
You can see examples of much of the code mentioned above at http://code.google.com/apis/ajax/playground/#internal_clock_rate and some additional documentation at http://code.google.com/apis/earth/documentation/time.html