@pirireis/webglobeplugins 1.5.1 → 1.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pirireis/webglobeplugins",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "main": "index.js",
5
5
  "author": "Toprak Nihat Deniz Ozturk",
6
6
  "license": "MIT",
@@ -70,6 +70,7 @@ export class IconFactory {
70
70
  if (!(combinationsMap instanceof Map)) {
71
71
  throw new Error('combinationsMap must be a Map instance.');
72
72
  }
73
+ console.log("combinationMap", combinationsMap);
73
74
  if (combinationsMap !== this.combinationMap) {
74
75
  this.combinationMap = combinationsMap;
75
76
  const baseSize = this.printer.baseSize;
@@ -28,6 +28,7 @@ export class PngBlobMapPart {
28
28
  img.onload = () => resolve(img);
29
29
  img.onerror = () => {
30
30
  this.imageCache.delete(src);
31
+ console.error(`Failed to load base64 image for src: ${src.slice(0, 64)}...`);
31
32
  reject(new Error(`Failed to load base64 image for src: ${src.slice(0, 64)}...`));
32
33
  };
33
34
  img.src = src;
@@ -1,6 +1,6 @@
1
1
  export class UrlImagePart {
2
2
  urlMap;
3
- static imageCache = new Map();
3
+ imageCache = new Map();
4
4
  constructor(urlMap) {
5
5
  this.urlMap = urlMap;
6
6
  }
@@ -12,7 +12,7 @@ export class UrlImagePart {
12
12
  return url;
13
13
  }
14
14
  loadImage(url) {
15
- const cached = UrlImagePart.imageCache.get(url);
15
+ const cached = this.imageCache.get(url);
16
16
  if (cached) {
17
17
  return cached;
18
18
  }
@@ -20,12 +20,13 @@ export class UrlImagePart {
20
20
  const img = new Image();
21
21
  img.onload = () => resolve(img);
22
22
  img.onerror = () => {
23
- UrlImagePart.imageCache.delete(url);
23
+ this.imageCache.delete(url);
24
+ console.error(`Failed to load image from URL: ${url}`);
24
25
  reject(new Error(`Failed to load image from URL: ${url}`));
25
26
  };
26
27
  img.src = url;
27
28
  });
28
- UrlImagePart.imageCache.set(url, imagePromise);
29
+ this.imageCache.set(url, imagePromise);
29
30
  return imagePromise;
30
31
  }
31
32
  async preparePart(partInput) {