KML运动方向线

时间:2016-12-28 03:02:46

标签: kml google-earth worldwind

我一直在与NASA WorldWind和Google Earth合作。我正在使用KML placemark作为图标,我希望在KML中复制一个Header / Leader Line。我想要一个类似于DIRECTION_OF_MOVEMENT行如何在WorldWind中工作的引导线,以便它在2525符号系统上实现。基本上,该线指示对象移动的方向,并且无论地图的方向如何,它都会指向该标题,如附加屏幕截图中的黑线所示。如何在Google地球中使用KML复制此内容?

enter image description here

2 个答案:

答案 0 :(得分:3)

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

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

  1. 创建一个图标,描绘您的标题线朝上,以便向北旋转0度,例如垂直线(使用图标在Google地球上放大和缩小时会有额外的缩放奖励)
  2. 使用Style和IconStyle来使用步骤1中的图标。
  3. 使用地标中的样式,并添加其他样式以设置标题。
  4. 以下是一个示例实现:

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

答案 1 :(得分: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>