Установлен GeoServer - 2.1.2, загружен shp файл, создан store в активном workspace.
Отображение через openlayer
Код: Выделить всё
tiled = new OpenLayers.Layer.WMS(
"topp:mymap - Tiled", "http://XX.XX.XX.XX:8080/geoserver/topp/wms",
{
LAYERS: 'topp:mymap',
SLD: 'http://XX.XX.XX.XX/sld/polygon_simplepolygon.sld',
STYLES: '',
format: 'image/png',
tiled: true,
tilesOrigin : map.maxExtent.left + ',' + map.maxExtent.bottom
}
);
map.addLayers([tiled]);
Код: Выделить всё
<?xml version="1.0" encoding="UTF-8"?>
<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">
<!-- a Named Layer is the basic building block of an SLD document -->
<NamedLayer>
<Name>default_polygon</Name>
<UserStyle>
<!-- Styles can have names, titles and abstracts -->
<Title>Default Polygon</Title>
<Abstract>A sample style that draws a polygon</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering polygons -->
<FeatureTypeStyle>
<Rule>
<PolygonSymbolizer>
<Fill>
<CssParameter name="fill">#FF0000</CssParameter>
</Fill>
<Stroke>
<CssParameter name="stroke">#FFFFFF</CssParameter>
<CssParameter name="stroke-width">2</CssParameter>
</Stroke>
</PolygonSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
По логам GeoServer'a видно что происходит подгрузка SLD и его парсинг, но стиль не подключается
Код: Выделить всё
18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.ows] - Getting layers and styles from reomte SLD
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - First 4 bytes of XML doc are : 3C ('<') 3F ('?') 78 ('x') 6D ('m')
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 1. Inferred encoding: UTF-8
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Charset detection phase 2. Charset in XML declaration is `UTF-8`.
18 Oct 17:59:10 DEBUG [geoserver.requests] - Trying to create reader basing on existing charset information: `UTF-8`.
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - parsingExpression CssParameter
18 Oct 17:59:10 DEBUG [geotools.filter] - processing root CssParameter
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1
18 Oct 17:59:10 DEBUG [geotools.styling] - number of fts set 1