<div dir="ltr">Hello everyone,<br><br>I have a question about how to formulate the
proper call for this WMS request. I am using geoserver and PostGIS to
publish a raster dataset. I have made a SLD for this categorical raster
that will allow me to turn each pixel value on an off. The initial style
makes the raster completely transparent as each pixle value opacity is
set to '0' and it works fine when previewing layer through geoserver. <br><br>We
can take url of the map add on &env=lcwater:1 and the resulting
image looks fine in preview. It only displays water for the entire
globe. However, we have tried unsuccessfully to properly call the wms
into any mapping application (leaflet & openlayers). When the WMS is
added to map only center of base map image is visible. Recapping, I
have one layer on my map, which is supposed to be transparent, and a
base layer. The center is correctly showing the transparency, but edges
are not. The SLD is not working across the map. <br><br>However, as the
user pans or zooms the SLD updates, makes the map transparent and they
see the base map. My conclusion is that the SLD is not being
consistently applied in all of the raster overviews. Because as you zoom
and pan, different areas become transparent.<br>However, because this
is a global map we always get some non application of the SLD around
+/-180 location. Here raster is always visible.<br><br>Something strange
is happening in the pyramids. Perhaps the SLD is erroring when it can
not find the values at different pyramid levels, but it works fine in
the geosever preview, so we must be submitting the request incorrectly.
Here is the request we are using.<br><br>var ext_world = ol.proj.transformExtent([-180, -65, 180, 90], 'EPSG:4326', 'EPSG:3857')<br>var
mapCenter = ol.proj.transform([0,40], 'EPSG:4326', 'EPSG:3857');
var view = new ol.View({center: mapCenter, zoom: 2,
extent: ext_world});<br>var map = new ol.Map({target: 'map', renderer: 'canvas', view: view});<br><br>var glc_src = new ol.source.TileWMS({<br> <br>
url:
'<a href="https://localhost:8080/geoserver/Shoumith/wms?service=WMS&version=1.1.0&request=GetMap&layers=Shoumith:glc_dynamic&styles=&format=application/openlayers">https://localhost:8080/geoserver/Shoumith/wms?service=WMS&version=1.1.0&request=GetMap&layers=Shoumith:glc_dynamic&styles=&format=application/openlayers</a>',<br> attributions: [new ol.Attribution({html: 'TODO: UPDATE'})],<br> params: {format: 'image/png', styles:'glc_dynamic'},<br>});<br> <br>var lyr_glc = new ol.layer.Tile({<br> source: glc_src<br>});<br> <br>glc_src.updateParams({'ENV':'lcwater:1;lcbare:1'})</div>