2012-11-16 9 views
5

私はgoogle earthのanimated update機能を使って完成しました。それを使ってmodelsを移動しています。私が本当にやりたいことは、Google Earthでline(たとえば上と下)をアニメーション化できるようにすることですが、これは難解です。kmlを使用してGoogle Earthでラインをアニメーション化

私は最初の行の経度と緯度を持っています。例えば、行座標は、次のとおり

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

I、次いで5秒間の期間にわたって500の高度まで、このラインのraise一端にたい。

私は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> 

しかし、イムは、今イム必ずその簡単な500に100から

を一方の端を上に移動する<gx:AnimatedUpdate>を使用する方法についての失われた - ことができます誰かが正しい方向に私を向ける?

答えて

5

トリックは、目印ではなくLineString要素(そのIDを持つ)を更新することです。

相対的な標高100mから500mに変化する行をアニメーション表示する、実用的なKMLのツアーです。

<?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

+0

質問答え、多くの感謝を参照してください – user1829877

関連する問題