<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=937103617-17022009><FONT face=Arial 
color=#0000ff size=2>Hi Mauro,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=937103617-17022009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left>&nbsp;&nbsp;&nbsp; &lt;ExtendedData&gt;&lt;SchemaData 
schemaUrl="#CALOPICOS"&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&lt;SimpleData name="COD_PRO"&gt;16&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;SimpleData name="NOME"&gt;COSTA 
VOLPINO&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&lt;SimpleData 
name="NOME_PRO"&gt;BERGAMO&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;SimpleData 
name="SIGLA_PRO"&gt;BG&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;SimpleData 
name="COD_ISTAT"&gt;16086&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/SchemaData&gt;&lt;/ExtendedData&gt;</DIV>
<DIV dir=ltr align=left><SPAN class=937103617-17022009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=937103617-17022009><FONT face=Arial 
color=#0000ff size=2>if these your attributes, then (my guess) the Format.KML 
parser will not found anything. It has to be something like 
&lt;name&gt;Something&lt;/name&gt;.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=937103617-17022009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=937103617-17022009><FONT face=Arial 
color=#0000ff size=2>Arnd Wippermann</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=937103617-17022009><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV><FONT face=Arial color=#0000ff 
size=2></FONT><BR>
<DIV class=OutlookMessageHeader lang=de dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Von:</B> users-bounces@openlayers.org 
[mailto:users-bounces@openlayers.org] <B>Im Auftrag von </B>Mauro 
Bianchi<BR><B>Gesendet:</B> Dienstag, 17. Februar 2009 14:38<BR><B>An:</B> 
Christopher Schmidt<BR><B>Cc:</B> users@openlayers.org; Andreas 
Hocevar<BR><B>Betreff:</B> Re: [OpenLayers-Users] GML and KML 
styleMap<BR></FONT><BR></DIV>
<DIV></DIV>Yes,<BR>I am using v. 2.7 but it's&nbsp; like the extractStyles 
attribute&nbsp; behaves correctly.<BR><BR>I've come to the real problem in my 
code: it seems like feature attributes are not loaded from the KML file (and 
extractAttributes is set to true). (I'm debugging with firebug)<BR>This causes 
visualization problem as I set a "loadend" event which modifies the styleMap 
adding a rule based on one of the attributes. This works perfectly with the GML 
format.<BR><BR>here is an excerpt of my KML file (with only 1 feature in this 
case):<BR><BR><BR><BR>&lt;?xml version="1.0" encoding="utf-8" ?&gt;<BR>&lt;kml 
xmlns="<A href="http://www.opengis.net/kml/2.2" 
target=_blank>http://www.opengis.net/kml/2.2</A>"&gt;<BR>&lt;Document&gt;&lt;Folder&gt;&lt;name&gt;
<DIV class="ArwC7c ckChnd" id=:st>CALOPICOS&lt;/name&gt;<BR>&lt;Schema 
name="CALOPICOS" id="CALOPICOS"&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;SimpleField 
name="Name" type="string"&gt;&lt;/SimpleField&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;SimpleField name="Description" 
type="string"&gt;&lt;/SimpleField&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;SimpleField 
name="COD_PRO" type="int"&gt;&lt;/SimpleField&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;SimpleField name="NOME" 
type="string"&gt;&lt;/SimpleField&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;SimpleField 
name="NOME_PRO" type="string"&gt;&lt;/SimpleField&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;SimpleField name="SIGLA_PRO" 
type="string"&gt;&lt;/SimpleField&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;SimpleField 
name="COD_ISTAT" 
type="float"&gt;&lt;/SimpleField&gt;<BR>&lt;/Schema&gt;<BR>&nbsp; 
&lt;Placemark&gt;<BR>&nbsp;&nbsp;&nbsp; &lt;ExtendedData&gt;&lt;SchemaData 
schemaUrl="#CALOPICOS"&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&lt;SimpleData name="COD_PRO"&gt;16&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;SimpleData name="NOME"&gt;COSTA 
VOLPINO&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
&lt;SimpleData 
name="NOME_PRO"&gt;BERGAMO&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;SimpleData 
name="SIGLA_PRO"&gt;BG&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp; &lt;SimpleData 
name="COD_ISTAT"&gt;16086&lt;/SimpleData&gt;<BR>&nbsp;&nbsp;&nbsp; 
&lt;/SchemaData&gt;&lt;/ExtendedData&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&lt;Polygon&gt;&lt;outerBoundaryIs&gt;&lt;LinearRing&gt;&lt;coordinates&gt;10.085200473748921,45.822892231012993,0 
10.084585250268859,45.824369844126821,0 10.082453051210173,45.825119119054406,0 
10.081007598805416,45.82684743097554,0 10.079839599744659,45.828613605040289,0 
10.07717727161147,45.830258855140812,0 10.075010482295186,45.832070393590513,0 
10.074058365470743,45.834532025789372,0 10.073265850979176,45.837262169208579,0 
10.06965146883106,45.839991757279705,0 10.069422672793097,45.842248559262387,0 
10.064130839354922,45.846186242510463,0 10.063978762676339,45.846484679629334,0 
10.06434346681317,45.847880880744242,0 10.065628096568989,45.849984053949292,0 
10.06583877006006,45.852668775022906,0 10.059618008333993,45.853626698390897,0 
10.060379779795703,45.8545691964189,0 10.061666817265563,45.856798398052135,0 
10.062159359739915,45.86042556732729,0 10.062166458357162,45.861136549440864,0 
10.062491195614504,45.862798642438662,0 10.065108076125764,45.864151370298352,0 
10.068276042583895,45.865093859662544,0 10.072075944094292,45.865310285186304,0 
10.076297156735873,45.86666119250448,0 10.079277324783051,45.868118179615614,0 
10.081854931270923,45.869902922584458,0 10.083140114771034,45.871807873298508,0 
10.083937880830906,45.874153962689711,0 10.090736923776577,45.868904916714143,0 
10.098095854836334,45.859113773118835,0 10.100973987278632,45.857677479099273,0 
10.102589304925999,45.857121865281528,0 10.104952026382794,45.857639077088834,0 
10.10549408372342,45.855091158649536,0 10.105693309684447,45.854094662090652,0 
10.1137341462167,45.847482107958633,0 10.114255005756153,45.84534837924182,0 
10.116027434531851,45.844462518344471,0 10.122735862283923,45.836476225598282,0 
10.121797095471102,45.835576381034869,0 10.120717567718057,45.834317883315961,0 
10.120381475009312,45.833691133795753,0 10.119058597198419,45.83249351040147,0 
10.11877669773189,45.831276682048355,0 10.118713269859052,45.831002783035999,0 
10.119842908081528,45.829790128259653,0 10.120160355091627,45.828927453139038,0 
10.119746843183558,45.828530977131464,0 10.119565205620738,45.827097151264411,0 
10.117436113711921,45.826937981496528,0 10.114963648834435,45.825459025574261,0 
10.115432920583952,45.823735317328207,0 10.114350889127907,45.822251764759208,0 
10.112532429508482,45.820712370359843,0 10.111123144812886,45.819110463619964,0 
10.109297908149857,45.817058044204309,0 10.108380256032628,45.815572837402364,0 
10.107786712642209,45.813796458819702,0 10.105413813519233,45.813810441626721,0 
10.103850765681402,45.812956988036674,0 10.101945727268799,45.811076233310892,0 
10.101763303405559,45.809412865143194,0 10.098657051624869,45.808088648873721,0 
10.097241706756741,45.807485228316132,0 10.093045867937683,45.805500291707737,0 
10.090559449954725,45.804542976919514,0 10.088601629641808,45.807842401601263,0 
10.085108910653183,45.816286768196576,0 10.085674454851302,45.822370351516362,0 
10.085264836458663,45.822738770296141,0 
10.085200473748921,45.822892231012993,0&lt;/coordinates&gt;&lt;/LinearRing&gt;&lt;/outerBoundaryIs&gt;&lt;/Polygon&gt;<BR>&nbsp;&nbsp;&nbsp; 
&nbsp; 
&lt;Style&gt;&lt;LineStyle&gt;&lt;color&gt;ff0000ff&lt;/color&gt;&lt;/LineStyle&gt;&nbsp; 
&lt;PolyStyle&gt;&lt;fill&gt;1&lt;/fill&gt;&lt;/PolyStyle&gt;&lt;/Style&gt;<BR>&nbsp; 
&lt;/Placemark&gt;<BR><BR>&lt;/Folder&gt;&lt;/Document&gt;&lt;/kml&gt;</DIV><BR><BR>
<DIV class=gmail_quote>2009/2/17 Christopher Schmidt <SPAN dir=ltr>&lt;<A 
href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</A>&gt;</SPAN><BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
  <DIV class=Ih2E3d>On Tue, Feb 17, 2009 at 11:53:12AM +0100, Andreas Hocevar 
  wrote:<BR>&gt; On Tue, Feb 17, 2009 at 10:44 AM, goliah &lt;<A 
  href="mailto:bianchimro@gmail.com">bianchimro@gmail.com</A>&gt; wrote:<BR>&gt; 
  &gt; I'm trying to load a layer from a local file, using a GML or KML 
  format<BR>&gt; &gt; based on file extension, and applying the same styleMap in 
  both cases.<BR>&gt; &gt; The following code only works for GML but not for KML 
  format.<BR>&gt; &gt; The var filename is the file to load and the var 
  layertype is the extension<BR>&gt; &gt; of the file.<BR>&gt; &gt;<BR>&gt; &gt; 
  Any hint?<BR>&gt;<BR>&gt; Without knowing your KML data, my guess would be 
  that the KML has<BR>&gt; inline styles, which would override your 
  styleMap.<BR><BR></DIV>Assuming you're using 2.7 though, this shouldn't be an 
  issue with<BR>extractStyles false:<BR><BR>&nbsp;<A 
  href="http://trac.openlayers.org/ticket/1576" 
  target=_blank>http://trac.openlayers.org/ticket/1576</A><BR><BR>So if this is 
  the case, then we should probably look into it and fix it.<BR><BR>Goliah, are 
  you using 2.7? Does this seem like it is possibly the 
  case?<BR><BR>Regards,<BR><FONT color=#888888>--<BR>Christopher 
  Schmidt<BR>MetaCarta<BR></FONT></BLOCKQUOTE></DIV><BR><BR clear=all><BR>-- 
<BR>Mauro Bianchi<BR><A 
href="mailto:bianchimro@gmail.com">bianchimro@gmail.com</A><BR><BR></BODY></HTML>