我在使用Google地球的animated update
功能并使用它来移动models
时非常有成就感。我真正想做的是能够在Google地球中设置line
(例如上下)的动画,但我觉得这很棘手。
我在开始时拥有该线的经度和纬度。例如,线坐标是:
-88,17,100 -88.20270841086835,17.21899813162266,100
然后,我希望在5秒的时间内raise
此行的一端达到500的高度。
我使用LineString
绘制了这一行:
<Placemark id="path1">
<name>Untitled Path man</name>
<LineString>
<tessellate>1</tessellate>
<coordinates>
-88.,17,100 -88.20270841086835,17.21899813162266,100
</coordinates>
</LineString>
</Placemark>
但我现在迷失了如何使用<gx:AnimatedUpdate>
将一端从100移动到500.
我确定它很容易 - 有人能指出我正确的方向吗?
答案 0 :(得分:5)
诀窍是更新LineString元素(上面有id)而不是Placemark。
这是一个有效的KML示例导览,可以设置从100到500米的相对高度变化的线条。
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document>
<name>gx:AnimatedUpdate example</name>
<open>1</open>
<LookAt>
<longitude>-88.1351880996469</longitude>
<latitude>17.09943637744042</latitude>
<altitude>0</altitude>
<heading>49.91874373078863</heading>
<tilt>84.43764019949967</tilt>
<range>1929.311316966288</range>
<gx:altitudeMode>relativeToSeaFloor</gx:altitudeMode>
</LookAt>
<Placemark>
<name>Untitled Path man</name>
<LineString id="path1">
<tessellate>1</tessellate>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>
-88,17,100 -88.20270841086835,17.21899813162266,100
</coordinates>
</LineString>
</Placemark>
<gx:Tour>
<name>Play me!</name>
<gx:Playlist>
<gx:AnimatedUpdate>
<gx:duration>5</gx:duration>
<Update>
<targetHref/> <!-- Left empty to refer to the current file -->
<Change>
<LineString targetId="path1">
<coordinates>
-88,17,100 -88.20270841086835,17.21899813162266,500
</coordinates>
</LineString>
</Change>
</Update>
</gx:AnimatedUpdate>
<!-- Wait for the animation to complete (see the touring
tutorial for an explanation of how AnimatedUpdate's
duration isn't enough to guarantee this). -->
<gx:Wait>
<gx:duration>5.0</gx:duration>
</gx:Wait>
</gx:Playlist>
</gx:Tour>
</Document>
</kml>
有关详细信息,请参阅https://developers.google.com/kml/documentation/touring#tourtimelines