2

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

在此处输入图像描述

4

2 回答 2

3

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

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

  1. 创建一个图标,描绘您的航向线指向上方,将其旋转 0 度指向北,例如垂直线(使用图标可以在您在 Google 地球上放大和缩小时进行缩放)
  2. 使用 Style 和 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>
于 2017-01-05T15:26:57.647 回答
1

将自定义浮动地标与 3D 轨道结合使用会怎样?

看到它工作

请参阅 NASA Worldwind 参考资料

<?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>
于 2017-01-04T11:55:44.793 回答