[OpenLayers-Users] How many rules in SLD
Özkan, Ayhan
oezkan at bi.bisnode.de
Wed Jun 23 04:23:02 EDT 2010
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100623/6fa3270a/attachment.html
More information about the Users
mailing list