ol 9.1.1-dev.1714524795662 → 9.1.1-dev.1714566334338

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": "ol",
3
- "version": "9.1.1-dev.1714524795662",
3
+ "version": "9.1.1-dev.1714566334338",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -1 +1 @@
1
- {"version":3,"file":"TileLayer.d.ts","sourceRoot":"","sources":["TileLayer.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;EAQE;;;;;;;;;kBAmBY,MAAM;;;;oBACN,MAAM;;;;;;;;;;;;;;;;;wBAQP,OAAO,0BAA0B,EAAE,OAAO;8BAG1C,OAAO,4BAA4B,EAAE,QAAQ;wCAG7C,OAAO,4BAA4B,EAAE,OAAO;AAjBzD;;;;;;;;GAQG;AAEH;;GAEG;AACH;;GAEG;AACH;;GAEG;AAEH;;;;;GAKG;AACH;IACE;;;OAGG;IACH,uBAHW,SAAS,WACT,OAAO,EA8CjB;IAzCC;;;OAGG;IACH,iBAAa;IAEb;;OAEG;IACH,sBAAyC;IAEzC;;OAEG;IACH,wBAA6C;IAE7C;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAuE;IAGvE;;;OAGG;IACH,yBAAqD;IAGvD;;OAEG;IACH,eAFW,OAAO,QAcjB;IAUD,oDAEC;IAED,8DAGC;IAED,sMA+FC;IAED;;;OAGG;IACH,eAHW,OAAO,gBAAgB,EAAE,KAAK,GAC7B,iBAAiB,GAAC,UAAU,GAAC,YAAY,GAAC,QAAQ,CA4F7D;CAgBF;wBAzWuB,4BAA4B;uCAK7C,oBAAoB"}
1
+ {"version":3,"file":"TileLayer.d.ts","sourceRoot":"","sources":["TileLayer.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;EAQE;;;;;;;;;kBAmBY,MAAM;;;;oBACN,MAAM;;;;;;;;;;;;;;;;;wBAQP,OAAO,0BAA0B,EAAE,OAAO;8BAG1C,OAAO,4BAA4B,EAAE,QAAQ;wCAG7C,OAAO,4BAA4B,EAAE,OAAO;AAjBzD;;;;;;;;GAQG;AAEH;;GAEG;AACH;;GAEG;AACH;;GAEG;AAEH;;;;;GAKG;AACH;IACE;;;OAGG;IACH,uBAHW,SAAS,WACT,OAAO,EA8CjB;IAzCC;;;OAGG;IACH,iBAAa;IAEb;;OAEG;IACH,sBAAyC;IAEzC;;OAEG;IACH,wBAA6C;IAE7C;;;;;;;;;;;;;;;;OAgBG;IACH,iBAAuE;IAGvE;;;OAGG;IACH,yBAAqD;IAGvD;;OAEG;IACH,eAFW,OAAO,QAqBjB;IAqBD,oDAEC;IAED,8DAGC;IAED,sMA+FC;IAED;;;OAGG;IACH,eAHW,OAAO,gBAAgB,EAAE,KAAK,GAC7B,iBAAiB,GAAC,UAAU,GAAC,YAAY,GAAC,QAAQ,CA4F7D;CAqBF;wBAhYuB,4BAA4B;uCAK7C,oBAAoB"}
@@ -129,10 +129,17 @@ class WebGLTileLayerRenderer extends WebGLBaseTileLayerRenderer {
129
129
  */
130
130
  reset(options) {
131
131
  super.reset(options);
132
+ if (this.helper) {
133
+ const gl = this.helper.getGL();
134
+ for (const paletteTexture of this.paletteTextures_) {
135
+ paletteTexture.delete(gl);
136
+ }
137
+ }
132
138
 
133
139
  this.vertexShader_ = options.vertexShader;
134
140
  this.fragmentShader_ = options.fragmentShader;
135
141
  this.paletteTextures_ = options.paletteTextures || [];
142
+
136
143
  if (this.helper) {
137
144
  this.program_ = this.helper.getProgram(
138
145
  this.fragmentShader_,
@@ -149,6 +156,17 @@ class WebGLTileLayerRenderer extends WebGLBaseTileLayerRenderer {
149
156
  this.helper.flushBufferData(this.indices_);
150
157
  }
151
158
 
159
+ removeHelper() {
160
+ if (this.helper) {
161
+ const gl = this.helper.getGL();
162
+ for (const paletteTexture of this.paletteTextures_) {
163
+ paletteTexture.delete(gl);
164
+ }
165
+ }
166
+
167
+ super.removeHelper();
168
+ }
169
+
152
170
  createTileRepresentation(options) {
153
171
  return new TileTexture(options);
154
172
  }
@@ -358,6 +376,11 @@ class WebGLTileLayerRenderer extends WebGLBaseTileLayerRenderer {
358
376
  const helper = this.helper;
359
377
  if (helper) {
360
378
  const gl = helper.getGL();
379
+ for (const paletteTexture of this.paletteTextures_) {
380
+ paletteTexture.delete(gl);
381
+ }
382
+ this.paletteTextures_.length = 0;
383
+
361
384
  gl.deleteProgram(this.program_);
362
385
  delete this.program_;
363
386
  helper.deleteBuffer(this.indices_);
package/util.js CHANGED
@@ -33,4 +33,4 @@ export function getUid(obj) {
33
33
  * OpenLayers version.
34
34
  * @type {string}
35
35
  */
36
- export const VERSION = '9.1.1-dev.1714524795662';
36
+ export const VERSION = '9.1.1-dev.1714566334338';
@@ -20,5 +20,9 @@ declare class PaletteTexture {
20
20
  * @return {WebGLTexture} The texture.
21
21
  */
22
22
  getTexture(gl: WebGLRenderingContext): WebGLTexture;
23
+ /**
24
+ * @param {WebGLRenderingContext} gl Rendering context.
25
+ */
26
+ delete(gl: WebGLRenderingContext): void;
23
27
  }
24
28
  //# sourceMappingURL=PaletteTexture.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PaletteTexture.d.ts","sourceRoot":"","sources":["PaletteTexture.js"],"names":[],"mappings":";AAAA;;GAEG;AAEH;IACE;;;OAGG;IACH,kBAHW,MAAM,QACN,UAAU,EAWpB;IARC,aAAgB;IAChB,iBAAgB;IAEhB;;;OAGG;IACH,iBAAoB;IAGtB;;;OAGG;IACH,eAHW,qBAAqB,GACpB,YAAY,CAwBvB;CACF"}
1
+ {"version":3,"file":"PaletteTexture.d.ts","sourceRoot":"","sources":["PaletteTexture.js"],"names":[],"mappings":";AAAA;;GAEG;AAEH;IACE;;;OAGG;IACH,kBAHW,MAAM,QACN,UAAU,EAWpB;IARC,aAAgB;IAChB,iBAAgB;IAEhB;;;OAGG;IACH,iBAAoB;IAGtB;;;OAGG;IACH,eAHW,qBAAqB,GACpB,YAAY,CAwBvB;IAED;;OAEG;IACH,WAFW,qBAAqB,QAO/B;CACF"}
@@ -45,6 +45,16 @@ class PaletteTexture {
45
45
  }
46
46
  return this.texture_;
47
47
  }
48
+
49
+ /**
50
+ * @param {WebGLRenderingContext} gl Rendering context.
51
+ */
52
+ delete(gl) {
53
+ if (this.texture_) {
54
+ gl.deleteTexture(this.texture_);
55
+ }
56
+ this.texture_ = null;
57
+ }
48
58
  }
49
59
 
50
60
  export default PaletteTexture;