gralobe 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/gralobe.js +12 -4
- package/dist/gralobe.js.map +1 -1
- package/dist/gralobe.umd.cjs +1 -1
- package/dist/gralobe.umd.cjs.map +1 -1
- package/package.json +1 -1
package/dist/gralobe.js
CHANGED
|
@@ -4861,12 +4861,20 @@ class eo {
|
|
|
4861
4861
|
}
|
|
4862
4862
|
/**
|
|
4863
4863
|
* Capture a single screenshot (includes legend if visible)
|
|
4864
|
+
* Uses an offscreen renderer to avoid disturbing the main display
|
|
4864
4865
|
*/
|
|
4865
4866
|
screenshot(e = {}) {
|
|
4866
|
-
const { width: t = 1920, height: i = 1080 } = e,
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4867
|
+
const { width: t = 1920, height: i = 1080, filename: n } = e, r = new S.WebGLRenderer({
|
|
4868
|
+
antialias: !0,
|
|
4869
|
+
preserveDrawingBuffer: !0
|
|
4870
|
+
});
|
|
4871
|
+
r.setSize(t, i), r.setPixelRatio(1);
|
|
4872
|
+
const s = this.camera.clone();
|
|
4873
|
+
s.aspect = t / i, s.updateProjectionMatrix(), r.render(this.scene, s), this.compositeCanvas.width = t, this.compositeCanvas.height = i, this.compositeCtx.drawImage(r.domElement, 0, 0), this.drawOverlaysOnCanvas(this.compositeCtx, t, i);
|
|
4874
|
+
const o = this.compositeCanvas.toDataURL("image/png");
|
|
4875
|
+
r.dispose();
|
|
4876
|
+
const l = n ? `${n}.png` : `globe-${Date.now()}.png`;
|
|
4877
|
+
this.downloadFile(o, l);
|
|
4870
4878
|
}
|
|
4871
4879
|
/**
|
|
4872
4880
|
* Start recording video using MediaRecorder
|