【解决办法】获取当前屏幕窗口分辨率,赋予WebGL画布,参考代码:
var xres = parseInt(window.screen.width * window.devicePixelRatio);
var yres = parseInt(window.screen.height * window.devicePixelRatio);
let viewer = new SuperMap3D.Viewer('Container', {
navigation: false,
contextOptions: {
contextType: Number(EngineType), // Webgl2:2 ; WebGPU:3
maxDrawingBufferWidth: xres,
maxDrawingBufferHeight: yres,
},
});
viewer.resolutionScale = window.devicePixelRatio;