2016-12-28 112 views
1

我一直在与NASA WorldWind和Google Earth合作。我使用KML placemark作为图标,我希望能够以KML复制标题/引线。我想要一个类似于DIRECTION_OF_MOVEMENT行在WorldWind中工作的领导者行,以便在2525符号体系中实施。基本上,线条表示对象正在移动的方向,并且它保持指向该标题,而不管地图的方向如附图所示的黑线所示。如何在Google地球中使用KML复制此内容?KML移动方向线

enter image description here

回答

2

对不起,我不能要求在评论澄清(我没有足够的声誉)。我假设您正在寻找一种方法来输入标题,并让Google地球自动将某个方向指向该方向,因为目前要绘制该线,您必须计算要放下的每个标题线的开始和结束坐标。

如果是这样,我发现的唯一允许我指定标题的地方是IconStyle。这是我做的:

  1. 创建描述您的标题行朝上,以便旋转它北0度点,如垂直线(使用图标图标具有缩放,你放大的好处并在Google地球上显示)
  2. 使用样式和IconStyle可使用步骤1中的图标。
  3. 在地标中使用样式,并添加其他样式以设置标题。

这里是下面的范例:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<kml xmlns="http://earth.google.com/kml/2.1"> 
    <Document> 
     <Style id="headingexample"> 
      <IconStyle> 
       <scale>1</scale> 
       <Icon> 
        <href>http://freevector.co/wp-content/uploads/2013/11/1625-vertical-line3.png</href> 
       </Icon> 
      </IconStyle> 
     </Style> 
     <Placemark> 
      <styleUrl>#headingexample</styleUrl> 
      <Style> 
       <IconStyle> 
        <heading>135</heading> 
       </IconStyle> 
      </Style> 
      <Point> 
       <coordinates>-99.21,40.01</coordinates> 
      </Point> 
     </Placemark> 
    </Document> 
</kml> 
+0

正是我在找的东西。谢谢! – systemoutprintln

+0

在接受之前请检查它是否有效,我从内存中完成了所有操作:)如果标题在内嵌样式的IconStyle标记中不起作用,则可能必须将其移回到原始样式定义中,该定义稍微多一点繁琐的工作流程,但仍然比手动计算端点更好。 –

+0

它在第一次尝试!再次感谢.. – systemoutprintln

1

有关使用自定义的浮地标而再加上3D的轨道呢?

See it working

See the NASA Worldwind reference

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<kml xmlns="http://earth.google.com/kml/2.1"> 
    <Document> 

     <!-- Icon --> 
     <Style id="tactical_symbol_placemark"> 
      <IconStyle> 
       <scale>4</scale> 
       <Icon> 
        <href>http://i.imgur.com/EEhQcPj.png</href> 
       </Icon> 
      </IconStyle> 
     </Style> 
     <Placemark> 
      <styleUrl>#tactical_symbol_placemark</styleUrl> 
      <Point> 
       <altitudeMode>relativeToGround</altitudeMode> 
       <coordinates>-114.19327,51.4292695,6000</coordinates> 
      </Point> 
     </Placemark> 

     <!-- Line --> 
     <Style id="track_line"> 
      <LineStyle> 
       <color>FF000000</color> 
       <width>5.0</width> 
      </LineStyle> 
     </Style> 
     <Folder> 
      <name>tactical_symbols</name> 
      <Placemark> 
       <name>testing-Placemark-2</name> 
       <styleUrl>#track_line</styleUrl> 
       <LineString> 
        <extrude>false</extrude> 
        <altitudeMode>relativeToGround</altitudeMode> 
        <coordinates>-114.19827,51.279256,6000 -114.18827,51.579283,6000</coordinates> 
       </LineString> 
      </Placemark> 
     </Folder> 
    </Document> 
</kml> 
+0

这是有点儿八九不离十了我之后,除了我想要的线指向的方向,该轨道抽穗(例如在135度很北极) – systemoutprintln

+0

是的,就像那样,但有一个领导线,如WorldWind截图所示。 – systemoutprintln