我有一些雷達數據可以用Google Earth插件顯示。通常,它是一些具有座標和時間戳的地面物體。我遵循https://developers.google.com/kml/documentation/time中的說明,嘗試了時間戳和時間跨度,並且工作正常。但是顯示效果並不令人滿意。Google地球如何平滑地動畫KML地標
對於時間戳解決方案,地標恰好在「」標籤指示的時間短暫閃爍。當我按下播放按鈕時,沒有任何東西出現在地圖上。 代碼示例:
<Folder>
<name>Vehicles</name>
<description>Timeline information of vehicles</description>
<Placemark>
<name>2</name>
<description>(-84.114231,39.785436,-0.000216),V(13.411216,37.555181) at 0.00s</description>
<TimeStamp>
<when>2012-09-19T08:00:00Z</when>
</TimeStamp>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.114231,39.785436,-0.000216</coordinates>
</Point>
</Placemark>
<Placemark>
<name>910</name>
<description>(-84.110335,39.788438,-0.000024),V(0.000000,0.000000) at 0.80s</description>
<TimeStamp>
<when>2012-09-19T08:00:30Z</when>
</TimeStamp>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.110335,39.788438,-0.000024</coordinates>
</Point>
</Placemark>
<Placemark>
<name>2</name>
<description>(-84.114133,39.785494,-0.000285),V(13.411216,37.555118) at 0.80s</description>
<TimeStamp>
<when>2012-09-19T08:00:30Z</when>
</TimeStamp>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.114133,39.785494,-0.000285</coordinates>
</Point>
</Placemark>
<Placemark>
<name>910</name>
<description>(-84.110307,39.788410,-0.000046),V(3.499966,307.390012) at 1.60s</description>
<TimeStamp>
<when>2012-09-19T08:01:00Z</when>
</TimeStamp>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.110307,39.788410,-0.000046</coordinates>
</Point>
</Placemark>
</Folder>
...
對於時間跨度的情況下,動畫是確定的,但總有一個尾巴,然後每個對象:在先前幀中的地標還不能在新的時間跨度的開始立即消失。
代碼示例:
...
<Folder>
<name>Vehicles</name>
<description>Timeline information of vehicles</description>
<Placemark>
<name>2</name>
<description>(-84.114231,39.785436,-0.000216),V(13.411216,37.555181) at 0.00s</description>
<TimeSpan>
<begin>2012-09-19T08:00:00Z</begin>
<end>2012-09-19T08:00:10Z</end>
</TimeSpan>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.114231,39.785436,-0.000216</coordinates>
</Point>
</Placemark>
<Placemark>
<name>910</name>
<description>(-84.110335,39.788438,-0.000024),V(0.000000,0.000000) at 0.80s</description>
<TimeSpan>
<begin>2012-09-19T08:00:10Z</begin>
<end>2012-09-19T08:00:20Z</end>
</TimeSpan>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.110335,39.788438,-0.000024</coordinates>
</Point>
</Placemark>
<Placemark>
<name>2</name>
<description>(-84.114133,39.785494,-0.000285),V(13.411216,37.555118) at 0.80s</description>
<TimeSpan>
<begin>2012-09-19T08:00:10Z</begin>
<end>2012-09-19T08:00:20Z</end>
</TimeSpan>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.114133,39.785494,-0.000285</coordinates>
</Point>
</Placemark>
<Placemark>
<name>910</name>
<description>(-84.110307,39.788410,-0.000046),V(3.499966,307.390012) at 1.60s</description>
<TimeSpan>
<begin>2012-09-19T08:00:20Z</begin>
<end>2012-09-19T08:00:30Z</end>
</TimeSpan>
<styleUrl>#vehicleStyle</styleUrl>
<Point>
<coordinates>-84.110307,39.788410,-0.000046</coordinates>
</Point>
</Placemark>
</Folder>
...
那麼,有沒有解決方案,使標連續動畫?謝謝。
P.S.不考慮跟蹤,因爲數據點之間的跟蹤信息目前不可用。
真的很難知道你在這裏問的是什麼,你可以試着重新回答這個問題嗎?如果你正在使用Earth Plugin,那麼通過javascript api而不是直接在Kml中處理任何動畫可能會更好...... – Fraser 2013-03-13 20:43:28
對不起,如果我沒有說清楚。我的問題是,我有一堆車輛軌跡表示爲與時間戳相關的一些離散點。因此,如果我逐幀播放這些視頻,預期的輸出可能是一些連續移動的道路。這些數據是從其他一些程序生成的,並且數量很大。所以我認爲使用kml作爲雙方的接口更容易。 – user2162367 2013-03-15 14:41:00