conflict between elevation for MousePosition & terrain layer
Description
If one defines a wms layer to be used for elevation info via MousePosition plugin, then it's also used for terrain via GeoserverBILProvider, while i think it should be enabled for the terrain only if another terrain layer wasnt configured.
I've also witnessed bad crashes (not 100% reproductible) with the following STR:
- enable mouseposition -> client queries the wms layer for bil data
- enabled 3d mode -> either the browser goes OOM, or there's a backtrace in the console log about 'cesium widget' being undefined.. if i can reproduce it will report backtrace.
How to reproduce
configure ms2 with a terrain provider and an addltional layer for elevation/MousePosition:
"terrainProvider": {
"type": "cesium",
"url": "https://3d.craig.fr/terrain",
"requestVertexNormals": true
}
...
"name": "Map",
"cfg": {
"additionalLayers": [{
"type": "wms",
"url": "https://wms.craig.fr/mnt",
"visibility": true,
"title": "Elevation",
"name": "mnt_raw",
"format": "image/bil",
"useForElevation": true,
"nodata": -9999,
"littleendian": true,
"hidden": true
}],
...
"name": "MousePosition",
"cfg": {
"editCRS": true,
"showLabels": true,
"showElevation": true,
"showToggle": true,
"filterAllowedCRS": ["EPSG:4326", "EPSG:3857"],
"additionalCRS": {}
}
- enable Mouseposition, the WMS server with BIL data is queried for elevation info
- switch to 3d mode, the WMS server with BIL data is still queried/hammered for terrain info
Expected Result
I would expect the cesium terrain provider to be used in priority for the terrain/relief (as its super fast, and optimized/native for cesium), instead of the WMS/BIL layer (which can be very resource consuming)
Current Result
the WMS/BIL server is used for the terrain/relief. The TerrainProvider layer info is fetched (eg there are hits on layer.json) but not used (zero hits on terrain tiles)
Other useful information
two ideas:
- add the WMS elevation layer as GeoserverBILProvider in cesium only if type is ellipsoid (eg the default, no terrain specified there)
- add a new flag (defaulting to true or false) to the additional layer allowing to enable/disable the layer for terrain, and keep/use it only for elevation/mouseposition (eg there's
useForElevation, maybeuseForTerrain?)
@tdipisa @allyoucanmap i see that #8323 allows for much improved terrain support, in this context what will happen for the additionalLayers used in the mouseposition plugin ? will we be able to use the additional wms layer only for elevation info (and not terrain) ?
@landryb
will we be able to use the additional wms layer only for elevation info (and not terrain) ?
No, we have anyway already defined a new issue for this. I'm going to close this issue in favor of #8579.