gis-common 5.1.32 → 5.1.34

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.
@@ -3354,26 +3354,27 @@ class Color {
3354
3354
  class CanvasDrawer {
3355
3355
  constructor(el) {
3356
3356
  __publicField(this, "ctx");
3357
+ __publicField(this, "canvas");
3357
3358
  if (el && typeof el === "string") {
3358
- el = document.querySelector("#" + el);
3359
- if (!el) {
3359
+ this.canvas = document.querySelector("#" + el);
3360
+ if (!this.canvas) {
3360
3361
  throw new Error("Element not found");
3361
3362
  }
3362
3363
  }
3363
3364
  if (el instanceof HTMLCanvasElement) {
3364
- const canvas = el;
3365
- if (canvas.getContext) {
3366
- this.ctx = canvas.getContext("2d");
3365
+ this.canvas = el;
3366
+ if (this.canvas.getContext) {
3367
+ this.ctx = this.canvas.getContext("2d");
3367
3368
  } else {
3368
3369
  throw new Error("getContext is not available on this element");
3369
3370
  }
3370
3371
  } else {
3371
- const canvas = document.createElement("canvas");
3372
- canvas.style.cssText = "position: absolute; display: block; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 999999;";
3373
- canvas.width = window.innerWidth;
3374
- canvas.height = window.innerHeight;
3375
- document.body.appendChild(canvas);
3376
- this.ctx = canvas.getContext("2d");
3372
+ this.canvas = document.createElement("canvas");
3373
+ this.canvas.style.cssText = "position: absolute; display: block; left: 0px; top: 0px; width: 100%; height: 100%; z-index: 999999;";
3374
+ this.canvas.width = window.innerWidth;
3375
+ this.canvas.height = window.innerHeight;
3376
+ document.body.appendChild(this.canvas);
3377
+ this.ctx = this.canvas.getContext("2d");
3377
3378
  if (!this.ctx) {
3378
3379
  throw new Error("getContext is not available on this element");
3379
3380
  }