I am using geoserver and sld :
I want to make all labels visible at all zoom levels. How can I do that with SLD?
<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"
xmlns="http://www.opengis.net/sld"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<NamedLayer>
<Name>Attribute-based polygon</Name>
<UserStyle>
<Title>HAPPY FACE</Title>
<FeatureTypeStyle>
<Rule>
<Name>min</Name>
<Title>Data Unavailable</Title>
<ogc:Filter>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>0</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:Filter>
<PolygonSymbolizer>
<Stroke>
<CssParameter name="stroke">#000000</CssParameter>
<CssParameter name="stroke-width">1</CssParameter>
</Stroke>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>Cluster</ogc:PropertyName>
</Label>
<Halo>
<Radius>3</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
</TextSymbolizer>
</Rule>
<Rule>
<Name>min</Name>
<Title>From 0 Less than 92</Title>
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>0</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>92</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:And>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#2C6700</CssParameter>
</Fill>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>Cluster</ogc:PropertyName>
</Label>
<Halo>
<Radius>3</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
</TextSymbolizer>
</Rule>
<Rule>
<Name>PS_GPRS_to_WCDMA_HOSR</Name>
<Title>From 92 Less Than 94</Title>
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>92</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>94</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:And>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#004040</CssParameter>
</Fill>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>Cluster</ogc:PropertyName>
</Label>
<Halo>
<Radius>3</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
</TextSymbolizer>
</Rule>
<Rule>
<Name>third_PS_GPRS_to_WCDMA_HOSR</Name>
<Title>From 94 Less Than 95</Title>
<ogc:Filter>
<ogc:And>
<ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>94</ogc:Literal>
</ogc:PropertyIsGreaterThanOrEqualTo>
<ogc:PropertyIsLessThan>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>95</ogc:Literal>
</ogc:PropertyIsLessThan>
</ogc:And>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#D0CA9C</CssParameter>
</Fill>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>Cluster</ogc:PropertyName>
</Label>
<Halo>
<Radius>3</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
</TextSymbolizer>
</Rule>
<Rule>
<Name>Large_PS_GPRS_to_WCDMA_HOSR</Name>
<Title>Greater Than 95</Title>
<ogc:Filter>
<ogc:PropertyIsGreaterThan>
<ogc:PropertyName>PS_GPRS_to_WCDMA_HOSR</ogc:PropertyName>
<ogc:Literal>98.5</ogc:Literal>
</ogc:PropertyIsGreaterThan>
</ogc:Filter>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
</PolygonSymbolizer>
<TextSymbolizer>
<Label>
<ogc:PropertyName>Cluster</ogc:PropertyName>
</Label>
<Halo>
<Radius>3</Radius>
<Fill>
<CssParameter name="fill">#FFFFFF</CssParameter>
</Fill>
</Halo>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
items.push({
xtype: "gx_mappanel",
ref: "mapPanel",
region: "center",
map: {
numZoomLevels: 19,
controls: controls
},
zoom:8,
center:[lon,lat],
layers: [
new OpenLayers.Layer.WMS( "TBF Drop Rate DL ",
url,
{layers: 'NCellGisData:TBF_DROP_RATE_DL_DAILY' ,transparent: "true",format: "image/png",tiled:"yes"},
{
buffer: 0,
isBaseLayer :true,
tiled: true
}
)
]
});
Best Answer
Also have a look at the max displacement and goodness of fit labelling parameters:
http://docs.geoserver.org/latest/en/user/styling/sld-reference/labeling.html#maxdisplacement