ol 10.2.2-dev.1727768316442 → 10.2.2-dev.1727793722519

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": "10.2.2-dev.1727768316442",
3
+ "version": "10.2.2-dev.1727793722519",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -43,11 +43,11 @@ export type Options = {
43
43
  * each tile. See examples/canvas-tiles for an example.
44
44
  * @api
45
45
  */
46
- declare class TileDebug extends XYZ {
46
+ declare class TileDebug extends ImageTile {
47
47
  /**
48
48
  * @param {Options} [options] Debug tile options.
49
49
  */
50
50
  constructor(options?: Options | undefined);
51
51
  }
52
- import XYZ from './XYZ.js';
52
+ import ImageTile from './ImageTile.js';
53
53
  //# sourceMappingURL=TileDebug.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TileDebug.d.ts","sourceRoot":"","sources":["TileDebug.js"],"names":[],"mappings":";;;;;iBAUc,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;AAFjD;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH;IACE;;OAEG;IACH,2CAkCC;CACF;gBA/De,UAAU"}
1
+ {"version":3,"file":"TileDebug.d.ts","sourceRoot":"","sources":["TileDebug.js"],"names":[],"mappings":";;;;;iBAUc,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;AAFjD;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH;IACE;;OAEG;IACH,2CA+BC;CACF;sBA5DqB,gBAAgB"}
@@ -2,9 +2,9 @@
2
2
  * @module ol/source/TileDebug
3
3
  */
4
4
 
5
- import XYZ from './XYZ.js';
5
+ import ImageTile from './ImageTile.js';
6
6
  import {createCanvasContext2D} from '../dom.js';
7
- import {toSize} from '../size.js';
7
+ import {renderXYZTemplate} from '../uri.js';
8
8
 
9
9
  /**
10
10
  * @typedef {Object} Options
@@ -26,7 +26,7 @@ import {toSize} from '../size.js';
26
26
  * each tile. See examples/canvas-tiles for an example.
27
27
  * @api
28
28
  */
29
- class TileDebug extends XYZ {
29
+ class TileDebug extends ImageTile {
30
30
  /**
31
31
  * @param {Options} [options] Debug tile options.
32
32
  */
@@ -35,16 +35,16 @@ class TileDebug extends XYZ {
35
35
  * @type {Options}
36
36
  */
37
37
  options = options || {};
38
+ const template = options.template || 'z:{z} x:{x} y:{y}';
38
39
 
39
40
  super({
40
41
  projection: options.projection,
41
42
  tileGrid: options.tileGrid,
42
43
  wrapX: options.wrapX !== undefined ? options.wrapX : true,
43
44
  zDirection: options.zDirection,
44
- url: options.template || 'z:{z} x:{x} y:{y}',
45
- tileLoadFunction: (tile, text) => {
46
- const z = tile.getTileCoord()[0];
47
- const tileSize = toSize(this.tileGrid.getTileSize(z));
45
+ loader: (z, x, y, loaderOptions) => {
46
+ const text = renderXYZTemplate(template, z, x, y, loaderOptions.maxY);
47
+ const tileSize = this.getTileSize(z);
48
48
  const context = createCanvasContext2D(tileSize[0], tileSize[1]);
49
49
 
50
50
  context.strokeStyle = 'grey';
@@ -58,10 +58,7 @@ class TileDebug extends XYZ {
58
58
  context.lineWidth = 4;
59
59
  context.strokeText(text, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]);
60
60
  context.fillText(text, tileSize[0] / 2, tileSize[1] / 2, tileSize[0]);
61
-
62
- /** @type {import("../ImageTile.js").default} */ (tile).setImage(
63
- context.canvas,
64
- );
61
+ return context.canvas;
65
62
  },
66
63
  });
67
64
  }
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 = '10.2.2-dev.1727768316442';
36
+ export const VERSION = '10.2.2-dev.1727793722519';