KML - 在标签中隐藏名称

dyl*_*nmc 2 xml kml

我非常努力地为地标命名,但没有将其显示在地图上的地标旁边。当您转到 Google 地图的左侧时,列表中的所有地标都显示[no name]。那么,有没有办法摆脱名称(如果我想命名地标并将该文件夹显示在左侧)?

我的 KML 结构如下所示:

<?xml version=\"1.0\" encoding=\"utf-8\" ?>
<kml xmlns=\"http://earth.google.com/kml/2.2\">
<Document>
<name>foo</name>
<Folder>
    <name>bar</name>
    <description>foo bar</description>
    <Placemark>
        <Style>
            <LineStyle>
                <color>ffff0000</color>
                <width>2</width>
            </LineStyle>
        </Style>
        <name></name>
        <LineString>
            <coordinates>{},{},{},{},{},{}</coordinates>
        </LineString>
    </Placemark>
    <Placemark>
        <Style>
            <IconStyle>
                <Icon><href>file://{11}arrow.png </href></Icon>
                <heading>{4}</heading>
                <color>{10}</color>
                <scale>.6</scale>
            </IconStyle>
        </Style>
        <name></name>
        <scale>0</scale>
        <color>{10}</color>
        <description>{9}<br/><b>duration:</b> {8}<br/><b>time:</b> {7}<br/><b>CNR:</b> {5}<br/><b>BER:</b> {6}</description>
        <Point><coordinates>{0},{1},{2}</coordinates></Point>
    </Placemark>

    <Placemark>
        <Style>
            <LineStyle>
                <color>ffff0000</color>
                <width>2</width>
            </LineStyle>
        </Style>
        <name></name>
        <LineString>
            <coordinates>{},{},{},{},{},{}</coordinates>
        </LineString>
    </Placemark>
    <Placemark>
        <Style>
            <IconStyle>
                <Icon><href>file://{11}arrow.png </href></Icon>
                <heading>{4}</heading>
                <color>{10}</color>
                <scale>.6</scale>
            </IconStyle>
        </Style>
        <name></name>
        <scale>0</scale>
        <color>{10}</color>
        <description>{9}<br/><b>duration:</b> {8}<br/><b>time:</b> {7}<br/><b>CNR:</b> {5}<br/><b>BER:</b> {6}</description>
        <Point><coordinates>{0},{1},{2}</coordinates></Point>
    </Placemark>
    ...repeat <Placemark><LineString></LineString></Placemark><Placemark></Placemark>...
</Folder></Document>
</kml>
Run Code Online (Sandbox Code Playgroud)

您可以看到样式块后面的名称是空的,因为我真的不希望它显示在地标旁边。(快速说明:括号来自写入文件的 python 脚本,所以只需忽略括号。)

如果我确实在<name</name>里面放了一些东西(在“正常”地标内而不是在 内LineString),我该如何让它不显示在地标旁边?

zig*_*zag 5

使用<LabelStyle>元素<scale>将标签的属性设置为0。这将允许您为Placemark侧面板中显示的名称命名,但地图上不显示标签。