@openglobus/og 0.22.1 → 0.22.2

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/lib/js/Globe.js CHANGED
@@ -123,7 +123,8 @@ class Globe {
123
123
  context: {
124
124
  //alpha: false,
125
125
  antialias: false,
126
- premultipliedAlpha: false
126
+ premultipliedAlpha: false,
127
+ preserveDrawingBuffer: false
127
128
  }
128
129
  }), {
129
130
  autoActivate: false,
@@ -292,6 +292,7 @@ declare class Renderer {
292
292
  * @public
293
293
  */
294
294
  draw(): void;
295
+ getImageDataURL(type?: string, quality?: number): string;
295
296
  protected _screenFrameMSAA(): void;
296
297
  protected _screenFrameNoMSAA(): void;
297
298
  /**
@@ -764,6 +764,10 @@ class Renderer {
764
764
  e.mouseState.moving = false;
765
765
  e.touchState.moving = false;
766
766
  }
767
+ getImageDataURL(type = "image/png", quality = 1.0) {
768
+ this.draw();
769
+ return this.handler.canvas ? this.handler.canvas.toDataURL(type, quality) : "";
770
+ }
767
771
  _screenFrameMSAA() {
768
772
  let h = this.handler;
769
773
  let sh = h.programs.toneMapping, p = sh._program, gl = h.gl;
@@ -28,6 +28,7 @@ export interface IHandlerParameters {
28
28
  alpha?: boolean;
29
29
  antialias?: boolean;
30
30
  premultipliedAlpha?: boolean;
31
+ preserveDrawingBuffer?: boolean;
31
32
  };
32
33
  extensions?: string[];
33
34
  autoActivate?: boolean;
@@ -120,6 +121,7 @@ declare class Handler {
120
121
  alpha?: boolean;
121
122
  antialias?: boolean;
122
123
  premultipliedAlpha?: boolean;
124
+ preserveDrawingBuffer?: boolean;
123
125
  };
124
126
  extensions: string[];
125
127
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openglobus/og",
3
- "version": "0.22.1",
3
+ "version": "0.22.2",
4
4
  "description": "[openglobus](https://www.openglobus.org/) is a javascript/typescript library designed to display interactive 3d maps and planets with map tiles, imagery and vector data, markers, and 3D objects. It uses the WebGL technology, open source, and completely free.",
5
5
  "directories": {
6
6
  "example": "./sandbox"