Hi Tim,

your link did not really help me a lot, i tried to understand it several times before, but did not suceed. here are some of my notices i made, i do not know if these are bugs or feature(is not a bug an unknown feature? okay different discussion)

1:) Using SLD to write styles from a default layer
When i want to store the default style information of a simple vector-layer, the styling informations are stored within the property defaultStyle of my Style-object
In order to store i via SLD-Format, i have to put a Rulke around it?

2.) Reading SLD from a file
when i read my sld form a file, each styling information is stored within a some strange rules wouln't make it sense to get a single way where to store these informations? or is this behaviour kept due to backwardscompatibilty?

3.) Readning several styles for a layer from SLD
while reading several rules from a sld file, each rule haviing its own name (default, select) the last rule overwrites all rules?

i am very confused about using sld and styles within Openlayers

background information:
i am working on a openlayers based editor, for manipulating multipolygons in differente layers (working great)
and giving each layer a userdefined style(not working)

thx carsten

Tim Schaub schrieb:
Hey-

[EMAIL PROTECTED] wrote:
Hi Carsten,

I've posted some of my code to pastebin, hopefully it will help you. Btw
SLD does not *need* the filters, a Rule can perfectly be valid without a
filter.

http://pastebin.com/m42ddc858

Best regards,
Bart

first and best answer to my problem upto now

where come your symbolizers and filters from ?
how did you instantiate them ?

You can also read http://trac.openlayers.org/wiki/Styles

A rule has an optional filter. A symbolizer is an object with properties to be used in drawing the feature.

Tim

[EMAIL PROTECTED] schrieb:
Hi,

SLD needs more stuff, e.g. NamedLayers and UserStyles. I am using the
following but I am not sure if this will still work in 2.7.

    var sld = {version: "1.0.0", namedLayers: {}};
    for (var i=0; i<layerNames.length; i++) {
        sld.namedLayers[layerNames[i]] = {name: layerNames[i],
userStyles:
[]};
        sld.namedLayers[layerNames[i]].userStyles.push({rules: []});
        sld.namedLayers[layerNames[i]].userStyles[0].rules.push(
            new OpenLayers.Rule({symbolizer: symbolizers[i], filter:
filters[i]}));
    }
    var frmt = new OpenLayers.Format.SLD();
    return frmt.write(sld);

Best regards,
Bart


Hi list,

im a working on a webbased editor.
Manipulating geometries works fine, changing color too.
But now i want to store my changed styles as SLD


CODE:

     var myStyles = new OpenLayers.StyleMap({
         "default": new OpenLayers.Style({
             pointRadius: "5", // sized according to type attribute
             fillColor: "#ffcc66",
             strokeColor: "#ff9933",
             strokeWidth: 2
         }),
         "select": new OpenLayers.Style({
             fillColor: "#66ccff",
             strokeColor: "#3399ff"
         })
     });

     var _sld=new OpenLayers.Format.SLD();
     var _style=myStyles.styles['default'];
     var _xml=_sld.write(_style);
     console.log(_xml);

Result in console:
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld";
version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld
http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

Any ideas why my xml keeps empty? I cannot see an error?

thx Carsten

--
Mit freundlichen Grüßen / Yours faithfully
Carsten Eider

Dipl. Inf. (FH)

Kompetenzzentrum für Innovative Informationssysteme

c/o Fachhochschhule Bingen / University of applied sciences Bingen

Berlinstraße 109
55411 Bingen

Tel: +49 (0) 6721 / 409-179
Fax: +49 (0) 6721 / 409-158
email: [EMAIL PROTECTED]
Internet: iis.fh-bingen.de


_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev



--
Mit freundlichen Grüßen / Yours faithfully
Carsten Eider

Dipl. Inf. (FH)

Kompetenzzentrum für Innovative Informationssysteme

c/o Fachhochschhule Bingen / University of applied sciences Bingen

Berlinstraße 109
55411 Bingen

Tel: +49 (0) 6721 / 409-179
Fax: +49 (0) 6721 / 409-158
email: [EMAIL PROTECTED]
Internet: iis.fh-bingen.de


_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev



--
Mit freundlichen Grüßen / Yours faithfully
Carsten Eider

Dipl. Inf. (FH)

Kompetenzzentrum für Innovative Informationssysteme

c/o Fachhochschhule Bingen / University of applied sciences Bingen

Berlinstraße 109
55411 Bingen

Tel: +49 (0) 6721 / 409-179
Fax: +49 (0) 6721 / 409-158
email: [EMAIL PROTECTED]
Internet: iis.fh-bingen.de
begin:vcard
fn:Carsten Eider
n:Eider;Carsten
org:Fachhochschule Bingen;Kompetenzzentrum innovative Informationssysteme
adr;quoted-printable:;;berlinstra=C3=9Fe 109;Bingen;RLP;55411;Deutschland
email;internet:[EMAIL PROTECTED]
title:Dipl.-Inf.
tel;work:067214090179
x-mozilla-html:TRUE
url:iis.fh-bingen.de
version:2.1
end:vcard

_______________________________________________
Dev mailing list
Dev@openlayers.org
http://openlayers.org/mailman/listinfo/dev

Reply via email to