0

当我使用标准的 Google Earth 地标图标时,我可以设置 ARGB 颜色。但是,当我使用自己的 png 图片时,<color></color>标签没有影响,颜色保持不变。

我需要对我的图片应用什么才能使其符合color标签?我曾尝试使用 SVG,但这根本没有显示。

<IconStyle>
  <scale>0.75</scale>
  <color>ffffffff</color>  <= works with the GM icons, but not with mine
  <Icon>
    <href>http://...myimage.png</href>
  </Icon>
</IconStyle>
4

1 回答 1

1

白色ffffffff是默认颜色 - 意味着没有颜色混合。颜色标签的格式为aabbggrr而不是 ARGB。指定非白色以与图像的 RGB 颜色值混合(或混合)。

除非您还想混合背景颜色,否则在图标具有透明背景的情况下效果最佳。一些技巧包括使用 3 色图标:0=透明背景、1=黑色轮廓和 2=纯白色填充颜色。这很好地融入了 Google 地球。例如,看看 Google 地球http://maps.google.com/mapfiles/kml/shapes/arrow.png中的箭头图标。

这是一个示例,橙色 RSS 提要图标上的白色与绿色混合,显示图标混合为绿色。

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
    <Placemark>
        <name>Placemark</name>
        <description><![CDATA[icon: <br/>
         <img src="http://www.feedicons.com/images/feed-icon-28x28.png">]]>
        </description>
        <Style>     
            <IconStyle>
                <color>ff00ff00</color>
                <Icon>
                    <href>http://www.feedicons.com/images/feed-icon-28x28.png</href>
                </Icon>                    
            </IconStyle>
        </Style>
        <Point>
            <coordinates>48.11427038011192,29.00801197928001</coordinates>
        </Point>
    </Placemark>
</kml>
于 2012-12-14T13:46:33.013 回答