Your absolutely right, I discover thet only using the version &quot;&lt;<span class="start-tag">script</span><span class="attribute-name"> src</span>=<span class="attribute-value">&quot;<a href="http://www.openlayers.org/dev/lib/OpenLayers.js">http://www.openlayers.org/dev/lib/OpenLayers.js</a>&quot;</span>&gt;&lt;/<span class="end-tag">script</span>&gt;&quot; could be possible to apply styles to the KML file. <br>
<br>So what is the best way to have good style on polygons?<br>GML does not have either and I was trying to avoid customizing one by one.<br><br>I need to draw a grid with ten classes and the simplest way it seemed to have a GML or KML file with all the polygons connected to a style!!!!<br>
<br>Thanks for your help<br><br>Carlos<br><br><br><br><div class="gmail_quote">On Tue, Feb 26, 2008 at 5:17 PM, Christopher Schmidt &lt;<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Tue, Feb 26, 2008 at 04:13:10PM +0100, Carlos Pinto wrote:<br>
&gt; Hi all,<br>
&gt;<br>
&gt; Can anyone explain why when I run the example:<br>
&gt;<br>
&gt; <a href="http://www.openlayers.org/dev/examples/kml-layer.html" target="_blank">http://www.openlayers.org/dev/examples/kml-layer.html</a><br>
&gt;<br>
&gt; it appears a line and 3 polygons with 3 different colors and if I use<br>
&gt; exactly the same code with the same layer, the polygons are replaced by one<br>
&gt; line?????<br>
&gt;<br>
&gt; The code is this:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.addLayer(new OpenLayers.Layer.GML(&quot;KML&quot;, &quot;kml/lines.kml&quot;,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; format: OpenLayers.Format.KML,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatOptions: {<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extractStyles: true,<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; extractAttributes: true<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}));<br>
&gt;<br>
&gt; and in fact, the layer has three polygons with different colors. What am I<br>
&gt; missing.<br>
&gt;<br>
&gt; I have try also to reference the library that it is online but i still stay<br>
&gt; with out seeing the polygons.<br>
&gt;<br>
&gt; Can anyone explain this?<br>
<br>
</div></div>What version of OpenLayers are you using? Probably not 2.6; possibly not<br>
2.5? It sounds like 2.4, though to be honest, there&#39;s no polygons<br>
anywhere in this demo, so perhaps I&#39;m confused. In any case, if you&#39;re<br>
not using a recent trunk, you won&#39;t have decent KML styling support,,<br>
which it sounds like might be your question.<br>
<br>
Regards,<br>
<font color="#888888">--<br>
Christopher Schmidt<br>
MetaCarta<br>
</font></blockquote></div><br>