I am trying to have a gx:track's line to have different colour in different part in the track depending on some conditions, but I am unable to find way to colour part of a track. I am using C# to generate the kml file. BTW my gx:track's has extendedData.
I know I can apply lineStyle to the gx:track but that will only apply to the whole track, but I would like to have different colour along the track's line.
Thanks in advance.
Terry
KML files can be created / edited with a text editor (NotePad, etc.) and there are lots of examples that can be downloaded and used as templates (copy/paste). You can also use a spreadsheet to enter the information, and then export that file to a text file, rename it with a . kml extension, and post that...
You can use Keyhole Markup Language (KML) files to view and share Google Earth information. These files store geographic data and content associated with Google Earth.
As previous answer says, you have to split track into segments and color each segment individually. There is no other way to do this using KML. But remember that this can create very large KML files for long tracks! So try to save some space by using shared styles.
I would recommend creating one "gx:track" with low "draworder" for whole track and collection of placemarks with different colors and high "draworder" for every small segment of track.
You can examine results of this approach here: http://www.zonefivesoftware.com/sporttracks/plugins/?p=dobrou-extensions (it is a plugin for application SportTracks).
It's my tool for visualization of GPS tracks. It does track coloring by creating placemark, with own color style, for every track segment.
Here you can see examples tracks colored in KML:
Track colored by speed #1 KMZ
Track colored by speed #2 KMZ
Track colored by elevation KMZ
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With