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/dist/ol.js +1 -1
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/source/TileDebug.d.ts +2 -2
- package/source/TileDebug.d.ts.map +1 -1
- package/source/TileDebug.js +8 -11
- package/util.js +1 -1
package/package.json
CHANGED
package/source/TileDebug.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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,
|
|
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"}
|
package/source/TileDebug.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @module ol/source/TileDebug
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import ImageTile from './ImageTile.js';
|
|
6
6
|
import {createCanvasContext2D} from '../dom.js';
|
|
7
|
-
import {
|
|
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
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
const
|
|
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