I’m writing an application to render trails on a map. I would like to dynamically modify the color of these trails depending on eg. how muddy they are.
I’m using the Google Maps v3 API.
I would like to do everything in Javascript, if possible. The KML may not be served on the same domain as the page containing the Javascript so I might not be able to XmlHttpRequest it.
It looks like the color is specified in the KML file itself, so I could write server-side code to fetch the original KML and re-serve a modified version of it.
My question is: can I do this without server-side processing and just set a property on the KmlLayer to set the color?
I don’t think there is any property on KmlLayer object to change the color as of now. It is possible to dynamically change the polygon fillColor
using for example
But
fillColoris not an option in KmlLayer constructor.