Ok<br><br>I finally found a solution (not sure it&#39;s the easier solution but it&#39;s working in all case<br><br>When declaring StyleMap I add this Rule:<br><br>new OpenLayers.Rule({<br>                            name : &quot;changestate&quot;,<br>
                            symbolizer: { &quot;Polygon&quot;: { display : &quot;none&quot;} },<br>                            filter: new OpenLayers.Filter.FeatureId({fids : []})<br>                            })<br><br>
So currently this has no impact, as the list of features id is empty.<br><br>Now, in my changestate function (this function is called when a feature status must be changed : show/hide)<br><br>                features = layer.features;<br>
                unactivelist = new Array(); // List of feature ids to hide<br>                n = 0;<br>                for(i=0;i&lt;dtnode.parent.childList.length;i++) { // I am using dynatree (tree with checkbox)<br><br>
                    // if style is defined (no stylemap associated) normal case, just style.display = &quot;none&quot;<br>                    if (features[i].style) {<br>                        if (dtnode.parent.childList[i].isSelected()) <br>
                            features[i].style.display = &quot;block&quot;;<br>                        else<br>                            features[i].style.display = &quot;none&quot;;<br>                    } else {<br>                        if (!dtnode.parent.childList[i].isSelected())// checkbox not active so add to unactive<br>
                            unactivelist[n++] = features[i].id;<br>                        }<br>                    }<br>               }<br><br>               //Get layer.stylemap.style.rules.filter and change fids to the new list, redraw the layer<br>
                    style = layer.styleMap.styles[&quot;default&quot;];<br>                    for(j=0;j&lt;style.rules.length;j++)<br>                    {<br>                        if (style.rules[j].name == &#39;changestate&#39;)<br>
                        {<br>                            style.rules[j].filter.fids = unactivelist;<br>                        }<br>                    }<br>                    <br>                }<br>                layer.redraw();<br>
<br><br><br><br><div class="gmail_quote">2010/8/4 Thomas PAPIN <span dir="ltr">&lt;<a href="mailto:thomas.papin@gmail.com">thomas.papin@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi, it&#39;s again me :)<br><br>When I want to hide/show a feature, I just do in a normal case: feature.style.display = &quot;none&quot;;<br>This is working great.<br><br>But in the following case it&#39;s not working, and I don&#39;t have what to do.<br>

<br>- I have a KML with placemark (Point and Polygon)<br>- Each Placemark have attributes like (fontColor,label,labeloffestY)<br>- I used a StyleMap to style the features of this KML<br>like that:<br>var extraMap = new OpenLayers.StyleMap({&#39;default&#39;:{<br>

            fillOpacity: 1,<br>            pointRadius: &quot;${pointSize}&quot;,<br>            label : &quot;${label}&quot;,<br>            fontColor: &quot;${fontColor}&quot;,<br>            fontSize: &quot;${labelSize}px&quot;,<br>

           ....<br><br>GMLlayer = new OpenLayers.Layer.GML(json.files[i].name, json.files[i].kml, <br>                                            {<br>                                                format: OpenLayers.Format.KML, <br>

                                                formatOptions: {<br>                                                    extractStyles: true, <br>                                                    extractAttributes: true,<br>

                                                    maxDepth: 2<br>                                                    },<br>                                                styleMap: style<br>                                            });<br>

<br>Then when I tried to do feature.style.display but feature.style is not defined.<br><br>What can I do :-( ?<br>
</blockquote></div><br>