Hi, 

does anybody know how many rules are allowed in SLD? The rules are created in a 
foreach loop.

 

<script type="text/javascript">

var map,landkreise;

.....

theSLD_BODY='<StyledLayerDescriptor version="1.0.0" 
xsi:schemaLocation="http://www.opengis.net/sld 
http://schemas.opengeospatial.net/sld/1.0.0/StyledLayerDescriptor.xsd";>';

    theSLD_BODY +='<NamedLayer>';

    theSLD_BODY +=' <Name>testdaten</Name>';

    theSLD_BODY +=' <UserStyle>';

    theSLD_BODY +=' <FeatureTypeStyle>';

[%- FOREACH rule IN Rules %]

    theSLD_BODY +='   <Rule>';

    theSLD_BODY +='     <ogc:Filter>';

    theSLD_BODY +='       <ogc:PropertyIsLike wildCard="*" singleChar="." 
escape="!">';

    theSLD_BODY +='         <ogc:PropertyName>[% rule.field 
%]</ogc:PropertyName>';

    theSLD_BODY +='         <ogc:Literal>[% rule.value %]</ogc:Literal>';

    theSLD_BODY +='       </ogc:PropertyIsLike>';

    theSLD_BODY +='     </ogc:Filter>';

    theSLD_BODY +='     <PolygonSymbolizer>';

    theSLD_BODY +='       <Fill>';

    theSLD_BODY +='         <CssParameter name="fill">[%- rule.color 
-%]</CssParameter>';

    theSLD_BODY +='       </Fill>';

    theSLD_BODY +='       <Stroke>';

    theSLD_BODY +='         <CssParameter name="stroke">#000000</CssParameter>';

    theSLD_BODY +='         <CssParameter name="stroke-width">2</CssParameter>';

    theSLD_BODY +='       </Stroke>';

    theSLD_BODY +='     </PolygonSymbolizer>';

    theSLD_BODY +='   </Rule>';

[% END %]

theSLD_BODY +='</FeatureTypeStyle>   </UserStyle>  
</NamedLayer></StyledLayerDescriptor>';

//

landkreise.mergeNewParams({"SLD_BODY" : theSLD_BODY});

......

</script>

Does anybody have another solution for coloring the map for more than 400 rules?

Thanks in advance

Ayhan Özkan 

                

 

_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to