I have a problem with my cesium globe. I have want to add a layer on the globe with a GeoServer WMS. The WMS layer appears but it turns the entire globe white. And without the WMS layer everything is normal. I have no error in the console (no CORS error), I don’t really understand what is happening. Does anyone know what to do? I don't know if the problem come from Cesium or maybe GeoServer?
Here the code I use and a picture of the problem.
Cesium.Ion.defaultAccessToken = 'my access token';
// Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.
var viewer = new Cesium.Viewer('cesiumContainer', {
geocoder: false,
animation: false,
creditsDisplay: false,
timeline: false,
fullscreenButton: false,
terrainProvider: Cesium.createWorldTerrain()
});
const provider = new Cesium.WebMapServiceImageryProvider({
url : 'http://localhost:8080/geoserver/wms',
layers : 'scv:epneige_snowpark',
transparent: true,
format : 'image/jpeg',
proxy: new Cesium.DefaultProxy('/proxy/')
});
const imageryLayer = new Cesium.ImageryLayer(provider);
viewer.imageryLayers.add(imageryLayer);
viewer.camera.flyTo({
destination : Cesium.Cartesian3.fromDegrees(6.568828, 44.922505, 3000),
orientation : {
heading : Cesium.Math.toRadians(250.0),
pitch : Cesium.Math.toRadians(-25.0),
}
});
More information about the geoserver logs :
03 juin 20:38:44 INFO [geoserver.wms] - Request: getMap Angle = 0.0 BaseUrl = http://localhost:8080/geoserver/ Bbox = SRSEnvelope[6.536865234374994 : 6.547851562500002, 44.901123046875 : 44.912109375] BgColor = java.awt.Color[r=255,g=255,b=255] Buffer = 0 Clip = null CQLFilter = null Crs = GEOGCS["WGS 84", DATUM["World Geodetic System 1984", SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], AUTHORITY["EPSG","6326"]], PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], UNIT["degree", 0.017453292519943295], AXIS["Geodetic longitude", EAST], AXIS["Geodetic latitude", NORTH], AUTHORITY["EPSG","4326"]] Elevation = [] Env = {} Exceptions = SE_XML FeatureId = null FeatureVersion = null Filter = null Format = image/jpeg FormatOptions = {} Get = true Height = 256 Interpolations = [] Layers = [org.geoserver.wms.MapLayerInfo@1deeaf87] MaxFeatures = null Palette = null RawKvp = {REQUEST=GetMap, FORMAT=image/jpeg, SRS=EPSG:4326, BBOX=6.536865234374994,44.901123046875,6.547851562500002,44.912109375, VERSION=1.1.1, STYLES=, SERVICE=WMS, WIDTH=256, HEIGHT=256, LAYERS=scv:epneige_snowpark} RemoteOwsType = null RemoteOwsURL = null Request = GetMap RequestCharset = UTF-8 ScaleMethod = null Sld = null SldBody = null SldVersion = null SortBy = null SortByArrays = null SRS = EPSG:4326 StartIndex = null StyleBody = null StyleFormat = sld Styles = [StyleImpl[ name=epneige_color]] StyleUrl = null StyleVersion = null Tiled = false TilesOrigin = null Time = [] Transparent = false ValidateSchema = false Version = 1.1.1 ViewParams = null Width = 256
transparent
andformat
options coming from?image/png
instead ofimage/jpeg
.