ol 10.5.1-dev.1748530933717 → 10.5.1-dev.1748531944555
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 +5 -0
- package/source/TileDebug.d.ts.map +1 -1
- package/source/TileDebug.js +4 -2
- package/util.js +1 -1
package/package.json
CHANGED
package/source/TileDebug.d.ts
CHANGED
|
@@ -29,6 +29,10 @@ export type Options = {
|
|
|
29
29
|
* Should include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
|
|
30
30
|
*/
|
|
31
31
|
template?: string | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* CSS color to fill text and stroke grid lines of each tile.
|
|
34
|
+
*/
|
|
35
|
+
color?: string | undefined;
|
|
32
36
|
};
|
|
33
37
|
/**
|
|
34
38
|
* @typedef {Object} Options
|
|
@@ -44,6 +48,7 @@ export type Options = {
|
|
|
44
48
|
* If both `source` and individual options are specified the individual options will have precedence.
|
|
45
49
|
* @property {string} [template='z:{z} x:{x} y:{y}'] Template for labeling the tiles.
|
|
46
50
|
* Should include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
|
|
51
|
+
* @property {string} [color='grey'] CSS color to fill text and stroke grid lines of each tile.
|
|
47
52
|
*/
|
|
48
53
|
/**
|
|
49
54
|
* @classdesc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TileDebug.d.ts","sourceRoot":"","sources":["TileDebug.js"],"names":[],"mappings":";;;;;iBAcc,OAAO,YAAY,EAAE,cAAc
|
|
1
|
+
{"version":3,"file":"TileDebug.d.ts","sourceRoot":"","sources":["TileDebug.js"],"names":[],"mappings":";;;;;iBAcc,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAFjD;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;GAMG;AACH;IACE;;OAEG;IACH,sBAFW,OAAO,EA2FjB;CACF;sBAxHqB,gBAAgB"}
|
package/source/TileDebug.js
CHANGED
|
@@ -24,6 +24,7 @@ import ImageTile from './ImageTile.js';
|
|
|
24
24
|
* If both `source` and individual options are specified the individual options will have precedence.
|
|
25
25
|
* @property {string} [template='z:{z} x:{x} y:{y}'] Template for labeling the tiles.
|
|
26
26
|
* Should include `{x}`, `{y}` or `{-y}`, and `{z}` placeholders.
|
|
27
|
+
* @property {string} [color='grey'] CSS color to fill text and stroke grid lines of each tile.
|
|
27
28
|
*/
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -44,6 +45,7 @@ class TileDebug extends ImageTile {
|
|
|
44
45
|
options = options || {};
|
|
45
46
|
const template = options.template || 'z:{z} x:{x} y:{y}';
|
|
46
47
|
const source = options.source;
|
|
48
|
+
const color = options.color || 'grey';
|
|
47
49
|
|
|
48
50
|
super({
|
|
49
51
|
transition: 0,
|
|
@@ -97,10 +99,10 @@ class TileDebug extends ImageTile {
|
|
|
97
99
|
const [width, height] = this.getTileSize(z);
|
|
98
100
|
const context = createCanvasContext2D(width, height);
|
|
99
101
|
|
|
100
|
-
context.strokeStyle =
|
|
102
|
+
context.strokeStyle = color;
|
|
101
103
|
context.strokeRect(0.5, 0.5, width + 0.5, height + 0.5);
|
|
102
104
|
|
|
103
|
-
context.fillStyle =
|
|
105
|
+
context.fillStyle = color;
|
|
104
106
|
context.strokeStyle = 'white';
|
|
105
107
|
context.textAlign = 'center';
|
|
106
108
|
context.textBaseline = 'middle';
|
package/util.js
CHANGED