MapGIS / WebClient-JavaScript

MapGIS Client for JavaScript, is a cloud GIS network client development platform. It makes a perfect fusion of traditional WebGIS and cloud GIS; also integrates four mainstream map open source frameworks and visualization libraries such as Echarts, MapV, and D3, etc.. Therefore, highly-efficient visual expression and analysis of big data and real-time streaming data have been further enhanced.
Apache License 2.0
175 stars 45 forks source link

Bug: Cesium Globe添加ElevationRamp材质,显示有错误 #141

Open JohnHenryEden opened 2 years ago

JohnHenryEden commented 2 years ago

Bug描述 为viewer.scene.globe添加ElevationRamp材质,显示有错误,跟下面的底图混杂在一起

重现步骤 使用CesiumTerrainProvider添加地形,使用如下代码添加材质:

const elevationRamp = [0.0, 1.0];
let getColorRamp = (selectedShading) => {
  const ramp = document.createElement("canvas");
  ramp.width = 100;
  ramp.height = 1;
  const ctx = ramp.getContext("2d");
  const grd = ctx.createLinearGradient(0, 0, 100, 0);
  grd.addColorStop(elevationRamp[0], "#000000"); //black
  grd.addColorStop(elevationRamp[1], "#ffffff"); //white
  ctx.fillStyle = grd;
  ctx.fillRect(0, 0, 100, 1);
  return ramp;
}
const minHeight = -100.0; // approximate dead sea elevation
const maxHeight = 3000.0; // approximate everest elevation
let shadingUniforms = {};
let material = Cesium.Material.fromType("ElevationRamp");
shadingUniforms = material.uniforms;
shadingUniforms.minimumHeight = minHeight;
shadingUniforms.maximumHeight = maxHeight;
shadingUniforms.image = getColorRamp('elevation');
viewer.scene.globe.material = material;

运行,即可重现

预计结果 正常显示globe材质

截图 b348ea445af6dbd1f280d1fe381ccaa

系统信息 OS: Win10 X64 Browser: Chrome

ParnDeedlit commented 2 years ago

好的 问题我们已经确认 已安排进研发计划中

JohnHenryEden commented 2 years ago

This is an automatic reply, your message has been received.I will read and reply the e-mail ASAP, sorry for any inconvience.黄靖珩,Huang Jingheng