【问题标题】:KML Direction of Movement LineKML 运动线方向
【发布时间】:2017-05-12 07:26:50
【问题描述】:

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

【问题讨论】:

    标签: kml google-earth worldwind


    【解决方案1】:

    抱歉,我无法在 cmets 中要求澄清(我没有足够的声誉)。我假设您正在寻找一种输入标题并让 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>
    

    【讨论】:

    • 正是我想要的。谢谢!
    • 请在接受之前检查它是否有效,我都是凭记忆完成的 :) 如果标题在内联样式的 IconStyle 标记中不起作用,您可能需要将其移回原来的样式定义,在工作流程方面稍微麻烦一些,但仍然比手动计算端点好。
    • @dubdubdubdot 嘿伙计们,不确定这是否同样有效。它的移动很有趣,具体取决于您倾斜它的方式。看:NASA:i.imgur.com/1inWyy4.gif - 和谷歌(安德鲁的解决方案):i.imgur.com/Np1vZ4e.gif
    • 好点。这令人沮丧。就我而言,自上而下的视图是最重要的,但侧视图的倾斜并不理想。
    • @dubdubdubdot 我在我的答案中添加了一个将地标图标与一条线相结合的结果的 GIF,你能检查一下并告诉我你的印象吗?
    【解决方案2】:

    将自定义浮动地标与 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>
    

    【讨论】:

    • 这有点像我想要的,只是我希望这条线指向轨道前进的方向(例如距离北极 135 度)
    • 是的,就像 WorldWind 屏幕截图中所示的那样,但有一条引导线。
    猜你喜欢
    • 2017-07-02
    • 1970-01-01
    • 1970-01-01
    • 2017-05-05
    • 2014-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多