[OpenLayers-Users] Ruled-Based Styling Does Not Work with KML File

reinaldo at geodesign.com.br reinaldo at geodesign.com.br
Fri Dec 14 11:06:48 PST 2012


Thanks a lot Matt. 

It worked. 

I read the OpenLayers.Format.KML documentation again and see that this
property was right there in front of my eyes:

kvpAttributes
(http://dev.openlayers.org/releases/OpenLayers-2.12/doc/apidocs/files/OpenLayers/Format/KML-js.html#OpenLayers.Format.KML.kvpAttributes){Boolean}
Only used if extractAttributes is true. 

I can start configuring my site with Solar Radiation Data for Brazil now.

Reinaldo
------------------------------------

Reinaldo Escada Chohfi
Sócio Gerente
GeoDesign Internacional
www.geodesign.com.br (http://www.geodesign.com.br)
Tel./Fax: (12) 3153-5115
Inteligência e Tecnologia Espacial de Ponta
---- Original Message ----
From: Matt Priour 
To: openlayers-users at lists.osgeo.org
Sent: Sex, Dez 14, 2012, 15:17 PM
Subject: Re: [OpenLayers-Users] Ruled-Based Styling Does Not Work with KML
File

              Since you are using a KML file with attributes in the
ExtendedData    section, you need to tell the KML parser to use a simple
attribute    key:value model if you want to write rule based styling
without an    additional conversion function.
    new OpenLayers.Format.KML({
                   extractStyles: false,
                   extractAttributes: true,
                   kvpAttribures: true, // 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20121214/6ca96f94/attachment.html>


More information about the Users mailing list