使用kml在Google地球中设置线条动画

use*_*877 5 kml google-earth

我很熟练使用animated update谷歌地球的功能,并使用它来移动models.我真正想做的是能够line在谷歌地球上制作(例如上下)动画,但我发现这很棘手.

我在开始时拥有该线的经度和纬度.例如,线坐标是:

-88,17,100 -88.20270841086835,17.21899813162266,100

然后,我希望在raise5秒的时间内将该线的一端达到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>
Run Code Online (Sandbox Code Playgroud)

但我现在迷失了如何使用<gx:AnimatedUpdate>将一端从100移动到500.

我确定它很容易 - 有人能指出我正确的方向吗?

Jas*_*nM1 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>
Run Code Online (Sandbox Code Playgroud)

有关详细信息,请参阅https://developers.google.com/kml/documentation/touring#tourtimelines