【问题标题】:Setting lablestyle in KML在 KML 中设置标签样式
【发布时间】:2015-06-12 10:54:57
【问题描述】:

我使用 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)。我做错了什么?

【问题讨论】:

    标签: python kml simplekml


    【解决方案1】:

    您没有做任何事情来更改样式定义中标记的图标。要更改图标,请使用&lt;IconStyle&gt;

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

    【讨论】:

      猜你喜欢
      • 2019-02-10
      • 2018-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-12-05
      • 2018-09-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多