I'm new to GeoServer and encountered the following problem that i don't know how to solve. I have PostGIS-Data in the luxemburghish SRID EPSG:2169 that I transform to EPSG:4326 (seems to be easier to use in OpenLayers) like this:
select f.objectid, f.geocode, f.btyp1_code, f.bewertung1,f.bkjahr,f.shape_ares, st_transform(f.the_geom,4326) as the_geom
from btk_f f
This query is used as a datasource in GeoServer to create a layer, that is served as WMS to be displayed in an OpenLayers Map. The data is styled using an SLD created in QGIS.
In the layer preview in GeoServer the layer displays as expected (showing polygons and labels following the style rules from QGIS)
When I'm loading the layer in OpenLayers (v.5.3.0) only the labels are displayed, not the polygons. Even the labels stop rendering at a certain zoom level. The resulting map (on OSM as background map) looks like this:
The code I use to insert the WMS-layer follows the latest tiled WMS-example from OpenLayers code.
// only the layer definition part
var layers = [
new ol.layer.Tile({
source: new ol.source.OSM()
}),
new ol.layer.Tile({
source: new ol.source.TileWMS({
url: 'https://ourdomain.com/geoserver/wms',
params: {'LAYERS': 'store:layer', CRS:'EPSG:4326'},
serverType: 'geoserver'
})
})
];
params
option in the API openlayers.org/en/latest/apidoc/… The OpenLayers default projection is web mercator so if you needed EPSG:4326 from the server you would need to specify it via theprojection
option (but if you were going to reproject EPSG:4326 you could also reproject EPSG:2169, it only needs a proj4 definition).ERROR [renderer.lite] - The specified mark brush://dense7 was not found!