0

I used the simplekml module for python to create the following KML file

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

But when I load the document in an interpreter, the marker shows as the standard blue instead of the red color (ff0000ff) i assigned. What am I doing wrong?

4

1 回答 1

1

您没有做任何事情来更改样式定义中标记的图标。要更改图标使用<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>
于 2015-06-12T12:32:26.127 回答