Your absolutely right, I discover thet only using the version "<<span class="start-tag">script</span><span class="attribute-name"> src</span>=<span class="attribute-value">"<a href="http://www.openlayers.org/dev/lib/OpenLayers.js">http://www.openlayers.org/dev/lib/OpenLayers.js</a>"</span>></<span class="end-tag">script</span>>" 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 <<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>> 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>
> Hi all,<br>
><br>
> Can anyone explain why when I run the example:<br>
><br>
> <a href="http://www.openlayers.org/dev/examples/kml-layer.html" target="_blank">http://www.openlayers.org/dev/examples/kml-layer.html</a><br>
><br>
> it appears a line and 3 polygons with 3 different colors and if I use<br>
> exactly the same code with the same layer, the polygons are replaced by one<br>
> line?????<br>
><br>
> The code is this:<br>
><br>
> map.addLayer(new OpenLayers.Layer.GML("KML", "kml/lines.kml",<br>
> {<br>
> format: OpenLayers.Format.KML,<br>
> formatOptions: {<br>
> extractStyles: true,<br>
> extractAttributes: true<br>
> }<br>
> }));<br>
><br>
> and in fact, the layer has three polygons with different colors. What am I<br>
> missing.<br>
><br>
> I have try also to reference the library that it is online but i still stay<br>
> with out seeing the polygons.<br>
><br>
> 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's no polygons<br>
anywhere in this demo, so perhaps I'm confused. In any case, if you're<br>
not using a recent trunk, you won'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>