[OpenLayers-Users] Layers and SLD not working
coderage
code.rage at yahoo.com
Sun Sep 23 15:08:15 EDT 2007
Hi foks,
Somebody plz tell me whats wrong with this,
I got two layers on my API code, im trying to display the second one when i
zoom in to scale 40,000. Its not working, then i tried to fix this using
SLD, there the second layer is hidden ok, but NEVER displayed at all.
Using Geoserver 1.5.3 with openlayers.
Heres the code from the HTML page and the SLD both:
function init(){
var options={scales:[200,500,10000,20000,40000,50000,100000,300000]};
map = new OpenLayers.Map('map',options, {controls:[], 'projection':
'EPSG:20499', 'units':'m'});
OpenLayers.IMAGE_RELOAD_ATTEMPTS = 5;
var bounds = new
OpenLayers.Bounds(50.355115262864274,25.766139474587497,50.73744555025769,26.32975672282734)
boundry = new OpenLayers.Layer.WMS(
"sf:boundry", "http://localhost:8080/geoserver/wms",
{
height: '500',
width: '600',
layers: 'sf:boundry',
styles: '',
srs: 'EPSG:20499',
format: 'image/png', tiled: 'true', tilesOrigin :
"50.355115262864274,25.766139474587497"
},
{maxExtent: bounds, projection: "EPSG:20499", buffer: 0}
);
map.addLayer(boundry);
avenues = new OpenLayers.Layer.WMS(
"sf:avenues", "http://localhost:8080/geoserver/wms",
{
height: '500',
width: '600',
layers: 'sf:avenues',
styles: '',
srs: 'EPSG:20499',
transparent: 'true',
format: 'image/png', tiled: 'true', transparent: true, tilesOrigin :
"50.355115262864274,25.766139474587497"
},
{maxExtent: bounds, minScale: 40000, projection: "EPSG:20499",
buffer: 0}
);
map.addLayer(avenues);
========================================================
in SLD :
<FeatureTypeStyle>
<FeatureTypeName>Feature</FeatureTypeName>
<Rule> <!-- Highway thick line drawn first-->
<MinScaleDenominator>50000</MinScaleDenominator>
<MaxScaleDenominator>500</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#0000FF</CssParameter>
<CssParameter name="stroke-width">10</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
</FeatureTypeStyle>
<FeatureTypeStyle>
<FeatureTypeName>Feature</FeatureTypeName>
<Rule> <!-- Highway thin line drawn second -->
<MinScaleDenominator>50000</MinScaleDenominator>
<MaxScaleDenominator>500</MaxScaleDenominator>
<LineSymbolizer>
<Stroke>
<CssParameter name="stroke">#A9F5F2</CssParameter>
<CssParameter name="stroke-width">9</CssParameter>
</Stroke>
</LineSymbolizer>
</Rule>
Please suggest a solution to this.
Regards
Code
--
View this message in context: http://www.nabble.com/Layers-and-SLD-not-working-tf4505480.html#a12849454
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list