fix: pass preserveDrawingBuffer to Mapbox for screenshot support (#2723)#2843
fix: pass preserveDrawingBuffer to Mapbox for screenshot support (#2723)#2843
Conversation
修复 Issue #2723: 配置 preserveDrawingBuffer: true 截图不生效 当使用 Mapbox 地图时,需要将 preserveDrawingBuffer 选项传递给 Mapbox 实例的 WebGL 上下文,这样才能使用 html2canvas 等工具 正确截图。 修改内容: - 从 MapboxService 配置中提取 preserveDrawingBuffer 参数 - 传递给 Mapbox 构造函数
|
There was a problem hiding this comment.
Code Review
This pull request introduces the preserveDrawingBuffer configuration option to the Mapbox service. A critical issue was identified where the removal of the ...rest spread operator during the Mapbox instance initialization causes other configuration parameters (such as zoom, center, and pitch) to be lost. The feedback suggests restoring the spread operator to prevent this regression.
| attributionControl, | ||
| bearing: rotation, | ||
| ...rest, | ||
| preserveDrawingBuffer: preserveDrawingBuffer ?? undefined, |
修复 Issue #2723: 配置 preserveDrawingBuffer: true 截图不生效
当使用 Mapbox 地图时,需要将 preserveDrawingBuffer 选项传递给 Mapbox 实例的 WebGL 上下文,这样才能使用 html2canvas 等工具正确截图。
修改内容: