KML IconStyle 颜色输入为蓝色,但在 Google 地球中显示为红色

Stu*_*ber 3 kml google-earth kmz

我使用十六进制颜色来标记图标。对于蓝色,我使用0000ff. 在 KML 文件中,它是<color>ff0000ff</color>. 但是,当在 Google 地球中打开 KML 时,图标地标为红色。

查看https://developers.google.com/kml/documentation/kmlreference我的看法是颜色应该编码为ff+ hexadecimal number,因此黑色表示为ff000000,这有效,但ff0000ff蓝色则不然。

我尝试了各种样式和图标选项,但没有成功。我已经阅读并看到了如何合并图标和颜色的分层效果。似乎使用wht-blank.png将是一个中性画布来应用颜色,但我怀疑它可能会产生干扰。

下面是我的测试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>
        <name>kml_test</name>
        <Placemark>
            <name>uniq_name</name>
            <Style>
                <IconStyle>
                    <scale>1</scale>
                    <color>ff0000ff</color>
                    <Icon>
                        <href>http://maps.google.com/mapfiles/kml/paddle/wht-blank.png</href>
                    </Icon>
                </IconStyle>
            </Style>
            <LabelStyle>
                <color>ffffffff</color>
                <scale>0.6</scale>
            </LabelStyle>
            <LookAt>
                <longitude>-118.000000</longitude>
                <latitude>34.000000</latitude>
                <range>1000</range>
            </LookAt>
            <Point>
                <altitudeMode>clampToGround</altitudeMode>
                <extrude>0</extrude>
                <coordinates>-118.000000,34.000000,0</coordinates>
            </Point>
        </Placemark>
    </Document>
</kml>
Run Code Online (Sandbox Code Playgroud)

我希望<color>ff0000ff</color>在 Google Earth 中打开 kml 时显示蓝色图标,而不是红色图标。

Chr*_*ams 9

KML 不使用正常的颜色顺序,而是采用蓝、绿、红的相反顺序,或者:AABBGGRR,其中 AA 是 Alpha 或透明度,BB 是蓝色,GG 是绿色,RR 是红色。

有关详细信息,请参阅标签的文档<color>,此处: https: //developers.google.com/kml/documentation/kmlreference#elements-specific-to-colorstyle

特别是这一行:

The order of expression is aabbggrr
Run Code Online (Sandbox Code Playgroud)

对于蓝色图标,您需要使用:<color>ffff0000</color>