[OpenLayers-Users] Storing styles as SLD

Dipl. Inf. Carsten Eider eider at fh-bingen.de
Tue Nov 11 05:42:50 EST 2008


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: eider at fh-bingen.de
Internet: iis.fh-bingen.de 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: eider.vcf
Type: text/x-vcard
Size: 330 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/openlayers-users/attachments/20081111/bcc3dcb5/eider.vcf


More information about the Users mailing list