<html><body>OL Users,<br><br>Could some one please help?<br><br>I can not extract attributes in a KML file. Here is my KML:<br><br><?xml version="1.0" encoding="utf-8" ?><br><kml xmlns="http://www.opengis.net/kml/2.2"><br>   <Document><br>      <Folder><br>         <name>ba_uf</name><br>         <Schema name="ba_uf" id="ba_ufID"><br>            <SimpleField type="string" name="ID"></SimpleField><br>            <SimpleField type="string" name="Regiao"></SimpleField><br>            <SimpleField type="string" name="State"></SimpleField><br>            <SimpleField type="float" name="Area"></SimpleField><br>         </Schema><br>         <Placemark><br>            <Style><br>               <LineStyle><color>ff0000ff</color></LineStyle><br>               <PolyStyle><fill>0</fill></PolyStyle><br>            </Style><br>            <ExtendedData><br>               <SchemaData schemaUrl="#ba_ufID"><br>                  <SimpleData name="ID">2909901</SimpleData><br>                  <SimpleData name="Regiao">Nordeste></SimpleData><br>                  <SimpleData name="State">BAHIA></SimpleData><br>                  <SimpleData name="Area">0</SimpleData><br>               </SchemaData><br>            </ExtendedData><br>            <Point>             <br>               <coordinates>-39.492025999999996,-17.997105999999992</coordinates> <br>            </Point>     <br>        </Placemark><br>      </Folder><br>   </Document><br></kml><br><br>This what I am using to extract and style the attributes:<br><br>...<br>        new OpenLayers.Layer.Vector("ESTADO DA BAHIA", {<br>            strategies: [new OpenLayers.Strategy.Fixed()],<br>            protocol: new OpenLayers.Protocol.HTTP({<br>                url: "kml/ba_uf_900913a.kml",<br>                format: new OpenLayers.Format.KML({<br>                   extractStyles: false, <br>                   extractAttributes: true,<br>                   srsName: "EPSG:900913"<br>                })<br>            }),<br>                style: {<br>                  fillColor: "#ffffff",<br>                  fillOpacity: 0,<br>                  strokeWidth: 1, <br>                  strokeColor: "#0000ff", <br>                  strokeOpacity: 1,<br>                  label: "${State}",<br>                  fontColor: "#ffffff",<br>                  fontFamily: "sans-serif",<br>                  fontSize: "15px",<br>                  fontWeight: "bold"<br>                }<br>...<br><br>I want the attribute for State to be rendered on the map, but I only get ${State} rendered.<br><br>I've tried additng <value></value> and label: "${State}" or label: "${State.value}" . I get either ${State} or ${State.value} rendered on the map, but never the actual attribute, which is BAHIA.<br><br>It has been suggested that I should add <br><displayName>><![CDATA[<b> ... </b>]]></displayName> in <SimpleField ...></SimpleField><br><br>It just doesn't work. Could someone help please?<br><br>Thanks a lot in advance.<br><br>Reinaldo<br><br>
<hr>
<br>
Reinaldo Escada Chohfi<br>
Sócio Gerente<br>
GeoDesign Internacional<br>
<a href="http://www.geodesign.com.br">www.geodesign.com.br</a><br>
Tel./Fax: (12) 3153-5115<br>
 <br>
Inteligência e Tecnologia Espacial de Ponta<br>
 <br></body></html>