KML Icons coloring - colors

I have a KML map with 3 different icons: red, blue and mixed. lately the icons in the map lost their red coloring. any idea what happened?
https://maps.google.com/maps?f=q&source=s_q&hl=he&geocode=&q=http://www.coal-ash.co.il/maps/coalash_map_kml/more_5000
The index on the right reflects the right shape and color.

You've explicitly specified the colour for each style via the <color> tags:
<IconStyle>
<color>ff8c4800</color>
<Icon>
<href>http://www.coal-ash.co.il/maps/sites/all/modules/coalash/icons/red.png</href>
</Icon>
</IconStyle>
This colour is applied as an overlay to your PNG icons. For example, if you use a neutral colour like AAAAAA00, you'll see that your icon will still be visible, but darkened.
Just remove the color tag, and your png icons will render correctly.

Related

Is there a way to make an svg icon more clearer or visible against a background color with less opacity?

The globe icon (svg icon) should be more clearer when against a background color with less opacity.
Right now, it is looking unclear:
However, ideally, the svg icon should look this way:

cairo + librsvg: draw svg icons forcing the colour at runtime

I'm using a set of svg icons in my applications, and I'm painting them using librsvg. These icons are all single-colour black drawings, and I can only draw them black because that is the colour written in the svg file.
There is a way I can to choose, at runtime, the colour (and possibily the alpha channel) of the icon just before painting them, without making a dedicated svg file for any colour I need? Can I make librsvg to ignore the colours written in the svg file and use only the one of my choice? Or any other workaround to have the same effect?
I'm thinking about loading the svg file content and modify in-memory the colour declarations, it should work, but I'm looking for a cleaner way.
Thanks.
You may want to monitor https://gitlab.gnome.org/GNOME/librsvg/issues/379 for a clean way to do this. In summary, librsvg needs an API to let you pass in an extra CSS stylesheet; this way your shapes can obtain their colors from that CSS.
https://gitlab.gnome.org/GNOME/gtk/issues/1471 mentions the way in which GTK hacks around this, and you may be able to use something similar. In short, it creates a wrapper SVG like this:
<svg ...>
<style type="text/css">
... extra styling here ...
</style>
<xi:include href="... original SVG encoded as a data:URL ..."/>
</svg>
(but check the actual source code in the comments there for the correct syntax!)

How to transform a Grayscale background SVG, to white or black colors

I have Gray SVG icons next to each Menu item (inherited from another project) and displaied as background.
I need to show them black or white but I don't how to achieve this.
As backgrounds I can't use fill css property. I tried with filter:brightness(100) to make them white but I loose anti-aliasing (and analogue with filter:brightness(0) to make them black).
Mask has still serious compatibility issues (e.g. Firefox does not allow external svg).
I tried also to import them as data-uri with LESS feature, but it was unuseful, so.... any suggestion?

How to make png image Google Earth <color> compliant?

When I use the standard Google Earth placemark icons, I can set a ARGB colour. However, when I use my own png image, the <color></color> tag has no impact, the colour remains unchanged.
What do I need to apply to my image in order to make it compliant with the color tag? I have tried to use SVG, but this does not show at all.
<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>
The white color ffffffff is the default - meaning no blending of colors. The color tag is of the form aabbggrr not ARGB. Specify a non-white color to get blended (or mixed-in) with RGB color values of the image.
Works best where icon has transparent background unless you want to blend the background color also. Some tricks include having a 3-color icon: 0=transparent background, 1=black outline and 2=solid white fill color. This blends well in Google Earth. For example take a look at the arrow icon in Google Earth http://maps.google.com/mapfiles/kml/shapes/arrow.png.
Here's an example with a white on orange RSS feed icon blended with green showing an icon blended to green.
<?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>

Issue with placemark 'auto' shading in Google Earth

I have a KML file with a list of placemarks that have custom icons, colors, and sizes. When I display the file in the Google Earth browser plugin, I see that icons that are situated below other icons are shaded. This makes the color of the icon different from what I have in the <color> tag. How do I disable the shading so that I always see the true color of the icon?
This is possible in the current version of the Api. You can control the icons color, animation, etc - but the clustering behavior and how it renders the icons is not exposed unfortunately.

Resources