在 KML 中设置标签样式

Setting lablestyle in KML

我使用 python 的 simplekml 模块创建了以下 KML 文件

    <?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
<Document id="feat_1">
    <Style id="stylesel_0">
        <LabelStyle id="substyle_0">
            <color>ff0000ff</color>
            <colorMode>normal</colorMode>
            <scale>1</scale>
        </LabelStyle>
    </Style>
    <Placemark id="feat_2">
        <name>Test</name>
        <styleUrl>#stylesel_0</styleUrl>
        <Point id="geom_0">
            <coordinates>12.581811,55.682581,0.0</coordinates>
        </Point>
    </Placemark>
</Document>
</kml>

但是当我在解释器中加载文档时,标记显示为标准蓝色,而不是我指定的红色 (ff0000ff)。我做错了什么?

您没有对样式定义中的标记图标进行任何更改。要更改图标,请使用 <IconStyle>

<Style id="stylesel_0">
    <LabelStyle id="substyle_0">
        <color>ff0000ff</color>
        <colorMode>normal</colorMode>
        <scale>1</scale>
    </LabelStyle>
    <IconStyle>
        <scale>1.0</scale>
        <Icon>
           <href>http://maps.google.com/mapfiles/ms/icons/red.png</href>
        </Icon>
    </IconStyle>
</Style>