Le Thursday 06 September 2007 13:23:58 Christopher Schmidt, vous avez écrit :
> On Thu, Sep 06, 2007 at 12:44:00PM +0200, Jacolin Yves wrote:
> > Hi List,
> >
> > I am looking how to change "icons" of a GML layer. I read this bug trac
> > [1] which seems working for WMS layer (not tested but seems interesting).
> >
> > Is this working for GML layers? This bug indicates that it could be
> > implemanted for the 2.6 release.
>
> You've linked to a bug on SLD rendering. Client side SLD rendering is
> vaguely planned for 2.6.
>
> However, it is possible to style your features when loading GML: you
> simply set up the default styles for your layer to have things like
> strokeColor/fillColor or graphicHeight/Width/externalGraphic.
>
> If you need to do per-feature rendering decisions, you can also do them
> in the preFeatureInsert hook, by looking at the passed in feature and
> changing its style properties.
>
> See http://openlayers.org/dev/examples/vector-features.html for more
> examples.
>
> Regards,

Hi,

I have some question about this. I succeed to override the preFeatureInsert 
and succeed to change the style for all feature (which is not my final 
purpose).

I would like to use a sld webservice for my layer, how can I use the sld 
content in the preFeatureInsert? Here my code:
/****************************************
        function HbsVector() {
                this.preFeatureInsert = function(feature) {
                    this.style.fillOpacity = 1;
                   this.style.fillColor= "#0000FF";
                   this.style.graphicOpacity = 1;
                   this.style.strokeColor= "#0000FF";
                   this.style.strokeWidth = 3;
                   this.style.pointRadius = 6;

                   OpenLayers.Feature.Vector.style['default'] = this.style;
                }
        }
        HbsVector.prototype = new OpenLayers.Layer.Vector();
        var HbsGML = new HbsVector();
        HbsGML.preFeatureInsert();
        
        var gml = new OpenLayers.Layer.GML("GML", "data.gml,{sld:"navitia.sld", 
transparent:'true'});
/****************************************

Thanks,

Y.
-- 
Yves Jacolin
---
http://softlibre.gloobe.org
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to