Stylizing KML file

219 views
Skip to first unread message

Toronto23

unread,
May 25, 2015, 8:48:39 PM5/25/15
to kml-support-g...@googlegroups.com
I was wondering how I can stylize the colour of a KML file that has polygons in it. Can I stylize it using the following code? If so, how? (My ultimate goal is to add this KML file to a google map with the custom styling I have applied).

<Style><LineStyle><color>ff0000ff</color></LineStyle><PolyStyle><fill>0</fill></PolyStyle></Style>



Thanks

barryhunter (KML Guru)

unread,
May 26, 2015, 1:20:28 PM5/26/15
to kml-support-g...@googlegroups.com
That tag would have to be added to every feature (usually a <Placemark>) for it to apply. 

Have to be careful if there is already a <Style> on the feature, its more complicated as need to merge them. 


Also if the feature is already using a <styleUrl> then it might be overridden from a specific referenced style. If all using a common style could just update that common style. 



... to be honest, unless you very familiaer with KML editing, its probably going to be easier to just update the style once you've imported the KML. It sounds like you want to do all features in the layer anyway. (or could even use Google Earth. It has a 'Share Style' option) 



Reply all
Reply to author
Forward
0 new messages