ol 9.2.5-dev.1718652616882 → 9.2.5-dev.1718925536936
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/DataTile.d.ts +14 -0
- package/DataTile.d.ts.map +1 -1
- package/DataTile.js +24 -1
- package/Map.d.ts +1 -1
- package/Map.d.ts.map +1 -1
- package/Map.js +9 -10
- package/Tile.d.ts +2 -22
- package/Tile.d.ts.map +1 -1
- package/Tile.js +2 -77
- package/TileQueue.d.ts.map +1 -1
- package/TileQueue.js +6 -4
- package/VectorRenderTile.d.ts +8 -13
- package/VectorRenderTile.d.ts.map +1 -1
- package/VectorRenderTile.js +17 -24
- package/VectorTile.d.ts +5 -5
- package/VectorTile.d.ts.map +1 -1
- package/VectorTile.js +3 -3
- package/dist/ol.d.ts +10 -2
- package/dist/ol.d.ts.map +1 -1
- package/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/featureloader.d.ts +4 -4
- package/featureloader.d.ts.map +1 -1
- package/featureloader.js +2 -2
- package/format/EsriJSON.d.ts +1 -1
- package/format/Feature.d.ts +8 -8
- package/format/Feature.d.ts.map +1 -1
- package/format/Feature.js +7 -5
- package/format/GeoJSON.d.ts +9 -9
- package/format/GeoJSON.d.ts.map +1 -1
- package/format/GeoJSON.js +10 -14
- package/format/JSONFeature.d.ts +7 -7
- package/format/JSONFeature.d.ts.map +1 -1
- package/format/JSONFeature.js +9 -11
- package/format/MVT.d.ts +12 -12
- package/format/MVT.d.ts.map +1 -1
- package/format/MVT.js +12 -14
- package/format/TextFeature.d.ts +1 -1
- package/format/TopoJSON.d.ts +1 -1
- package/format/WKB.d.ts +1 -1
- package/format/XMLFeature.d.ts +1 -1
- package/interaction/DragAndDrop.d.ts +1 -1
- package/layer/BaseTile.d.ts +23 -6
- package/layer/BaseTile.d.ts.map +1 -1
- package/layer/BaseTile.js +22 -3
- package/layer/Tile.d.ts +1 -1
- package/layer/Tile.d.ts.map +1 -1
- package/layer/Tile.js +3 -1
- package/layer/VectorTile.d.ts +19 -6
- package/layer/VectorTile.d.ts.map +1 -1
- package/layer/VectorTile.js +20 -8
- package/layer/WebGLTile.d.ts +5 -10
- package/layer/WebGLTile.d.ts.map +1 -1
- package/layer/WebGLTile.js +3 -12
- package/package.json +1 -1
- package/renderer/Layer.d.ts +22 -25
- package/renderer/Layer.d.ts.map +1 -1
- package/renderer/Layer.js +36 -36
- package/renderer/canvas/TileLayer.d.ts +100 -38
- package/renderer/canvas/TileLayer.d.ts.map +1 -1
- package/renderer/canvas/TileLayer.js +542 -329
- package/renderer/canvas/VectorTileLayer.d.ts +11 -11
- package/renderer/canvas/VectorTileLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorTileLayer.js +33 -46
- package/renderer/webgl/TileLayerBase.d.ts +0 -6
- package/renderer/webgl/TileLayerBase.d.ts.map +1 -1
- package/renderer/webgl/TileLayerBase.js +61 -78
- package/reproj/DataTile.d.ts.map +1 -1
- package/reproj/DataTile.js +103 -100
- package/source/BingMaps.d.ts +2 -2
- package/source/BingMaps.d.ts.map +1 -1
- package/source/BingMaps.js +1 -2
- package/source/CartoDB.d.ts +2 -2
- package/source/CartoDB.js +1 -1
- package/source/DataTile.d.ts +49 -20
- package/source/DataTile.d.ts.map +1 -1
- package/source/DataTile.js +56 -9
- package/source/GeoTIFF.d.ts +2 -6
- package/source/GeoTIFF.d.ts.map +1 -1
- package/source/GeoTIFF.js +3 -3
- package/source/Google.d.ts.map +1 -1
- package/source/Google.js +0 -2
- package/source/IIIF.d.ts +1 -1
- package/source/IIIF.js +1 -1
- package/source/ImageTile.d.ts +102 -0
- package/source/ImageTile.d.ts.map +1 -0
- package/source/ImageTile.js +208 -0
- package/source/OGCMapTile.d.ts +2 -2
- package/source/OGCMapTile.js +1 -1
- package/source/OGCVectorTile.d.ts +4 -4
- package/source/OGCVectorTile.js +2 -2
- package/source/OSM.d.ts +2 -7
- package/source/OSM.d.ts.map +1 -1
- package/source/OSM.js +1 -3
- package/source/StadiaMaps.d.ts +2 -2
- package/source/StadiaMaps.d.ts.map +1 -1
- package/source/StadiaMaps.js +2 -18
- package/source/Tile.d.ts +7 -36
- package/source/Tile.d.ts.map +1 -1
- package/source/Tile.js +5 -69
- package/source/TileArcGISRest.d.ts +2 -2
- package/source/TileArcGISRest.js +1 -1
- package/source/TileDebug.d.ts.map +1 -1
- package/source/TileDebug.js +0 -1
- package/source/TileImage.d.ts +7 -11
- package/source/TileImage.d.ts.map +1 -1
- package/source/TileImage.js +11 -43
- package/source/TileJSON.d.ts +2 -2
- package/source/TileJSON.js +1 -1
- package/source/TileWMS.d.ts +2 -2
- package/source/TileWMS.d.ts.map +1 -1
- package/source/TileWMS.js +1 -4
- package/source/UTFGrid.d.ts +1 -1
- package/source/UrlTile.d.ts +14 -12
- package/source/UrlTile.d.ts.map +1 -1
- package/source/UrlTile.js +12 -7
- package/source/Vector.d.ts +5 -5
- package/source/Vector.d.ts.map +1 -1
- package/source/Vector.js +3 -3
- package/source/VectorTile.d.ts +4 -17
- package/source/VectorTile.d.ts.map +1 -1
- package/source/VectorTile.js +10 -85
- package/source/WMTS.d.ts +2 -2
- package/source/WMTS.js +3 -3
- package/source/XYZ.d.ts +14 -17
- package/source/XYZ.d.ts.map +1 -1
- package/source/XYZ.js +7 -8
- package/source/Zoomify.d.ts +2 -2
- package/source/Zoomify.d.ts.map +1 -1
- package/source/Zoomify.js +3 -2
- package/source.d.ts +1 -0
- package/source.d.ts.map +1 -1
- package/source.js +1 -0
- package/tilecoord.d.ts +7 -0
- package/tilecoord.d.ts.map +1 -1
- package/tilecoord.js +11 -1
- package/tileurlfunction.d.ts +3 -7
- package/tileurlfunction.d.ts.map +1 -1
- package/tileurlfunction.js +14 -47
- package/uri.d.ts +23 -3
- package/uri.d.ts.map +1 -1
- package/uri.js +75 -0
- package/util.js +1 -1
package/tileurlfunction.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {string} template Template.
|
|
3
|
-
* @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid.
|
|
3
|
+
* @param {import("./tilegrid/TileGrid.js").default|null} tileGrid Tile grid.
|
|
4
4
|
* @return {import("./Tile.js").UrlFunction} Tile URL function.
|
|
5
5
|
*/
|
|
6
|
-
export function createFromTemplate(template: string, tileGrid: import("./tilegrid/TileGrid.js").default): import("./Tile.js").UrlFunction;
|
|
6
|
+
export function createFromTemplate(template: string, tileGrid: import("./tilegrid/TileGrid.js").default | null): import("./Tile.js").UrlFunction;
|
|
7
7
|
/**
|
|
8
8
|
* @param {Array<string>} templates Templates.
|
|
9
9
|
* @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid.
|
|
@@ -22,9 +22,5 @@ export function createFromTileUrlFunctions(tileUrlFunctions: Array<import("./Til
|
|
|
22
22
|
* @return {string|undefined} Tile URL.
|
|
23
23
|
*/
|
|
24
24
|
export function nullTileUrlFunction(tileCoord: import("./tilecoord.js").TileCoord, pixelRatio: number, projection: import("./proj/Projection.js").default): string | undefined;
|
|
25
|
-
|
|
26
|
-
* @param {string} url URL.
|
|
27
|
-
* @return {Array<string>} Array of urls.
|
|
28
|
-
*/
|
|
29
|
-
export function expandUrl(url: string): Array<string>;
|
|
25
|
+
export { expandUrl } from "./uri.js";
|
|
30
26
|
//# sourceMappingURL=tileurlfunction.d.ts.map
|
package/tileurlfunction.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tileurlfunction.d.ts","sourceRoot":"","sources":["tileurlfunction.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tileurlfunction.d.ts","sourceRoot":"","sources":["tileurlfunction.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,6CAJW,MAAM,YACN,OAAO,wBAAwB,EAAE,OAAO,GAAC,IAAI,GAC5C,OAAO,WAAW,EAAE,WAAW,CA0B1C;AAED;;;;GAIG;AACH,+CAJW,MAAM,MAAM,CAAC,YACb,OAAO,wBAAwB,EAAE,OAAO,GACvC,OAAO,WAAW,EAAE,WAAW,CAS1C;AAED;;;GAGG;AACH,6DAHW,MAAM,OAAO,WAAW,EAAE,WAAW,CAAC,GACrC,OAAO,WAAW,EAAE,WAAW,CAsB1C;AAED;;;;;GAKG;AACH,+CALW,OAAO,gBAAgB,EAAE,SAAS,cAClC,MAAM,cACN,OAAO,sBAAsB,EAAE,OAAO,GACrC,MAAM,GAAC,SAAS,CAI3B"}
|
package/tileurlfunction.js
CHANGED
|
@@ -2,18 +2,15 @@
|
|
|
2
2
|
* @module ol/tileurlfunction
|
|
3
3
|
*/
|
|
4
4
|
import {modulo} from './math.js';
|
|
5
|
+
import {renderXYZTemplate} from './uri.js';
|
|
5
6
|
import {hash as tileCoordHash} from './tilecoord.js';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @param {string} template Template.
|
|
9
|
-
* @param {import("./tilegrid/TileGrid.js").default} tileGrid Tile grid.
|
|
10
|
+
* @param {import("./tilegrid/TileGrid.js").default|null} tileGrid Tile grid.
|
|
10
11
|
* @return {import("./Tile.js").UrlFunction} Tile URL function.
|
|
11
12
|
*/
|
|
12
13
|
export function createFromTemplate(template, tileGrid) {
|
|
13
|
-
const zRegEx = /\{z\}/g;
|
|
14
|
-
const xRegEx = /\{x\}/g;
|
|
15
|
-
const yRegEx = /\{y\}/g;
|
|
16
|
-
const dashYRegEx = /\{-y\}/g;
|
|
17
14
|
return (
|
|
18
15
|
/**
|
|
19
16
|
* @param {import("./tilecoord.js").TileCoord} tileCoord Tile Coordinate.
|
|
@@ -25,21 +22,16 @@ export function createFromTemplate(template, tileGrid) {
|
|
|
25
22
|
if (!tileCoord) {
|
|
26
23
|
return undefined;
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
const y = range.getHeight() - tileCoord[2] - 1;
|
|
41
|
-
return y.toString();
|
|
42
|
-
});
|
|
25
|
+
let maxY;
|
|
26
|
+
const z = tileCoord[0];
|
|
27
|
+
if (tileGrid) {
|
|
28
|
+
// The `{-y}` placeholder only works for sources that have a tile grid at construction
|
|
29
|
+
const range = tileGrid.getFullTileRange(z);
|
|
30
|
+
if (range) {
|
|
31
|
+
maxY = range.getHeight() - 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return renderXYZTemplate(template, z, tileCoord[1], tileCoord[2], maxY);
|
|
43
35
|
}
|
|
44
36
|
);
|
|
45
37
|
}
|
|
@@ -95,31 +87,6 @@ export function nullTileUrlFunction(tileCoord, pixelRatio, projection) {
|
|
|
95
87
|
}
|
|
96
88
|
|
|
97
89
|
/**
|
|
98
|
-
*
|
|
99
|
-
* @return {Array<string>} Array of urls.
|
|
90
|
+
* TODO: Update ol-mapbox-style to import this from the uri.js module.
|
|
100
91
|
*/
|
|
101
|
-
export
|
|
102
|
-
const urls = [];
|
|
103
|
-
let match = /\{([a-z])-([a-z])\}/.exec(url);
|
|
104
|
-
if (match) {
|
|
105
|
-
// char range
|
|
106
|
-
const startCharCode = match[1].charCodeAt(0);
|
|
107
|
-
const stopCharCode = match[2].charCodeAt(0);
|
|
108
|
-
let charCode;
|
|
109
|
-
for (charCode = startCharCode; charCode <= stopCharCode; ++charCode) {
|
|
110
|
-
urls.push(url.replace(match[0], String.fromCharCode(charCode)));
|
|
111
|
-
}
|
|
112
|
-
return urls;
|
|
113
|
-
}
|
|
114
|
-
match = /\{(\d+)-(\d+)\}/.exec(url);
|
|
115
|
-
if (match) {
|
|
116
|
-
// number range
|
|
117
|
-
const stop = parseInt(match[2], 10);
|
|
118
|
-
for (let i = parseInt(match[1], 10); i <= stop; i++) {
|
|
119
|
-
urls.push(url.replace(match[0], i.toString()));
|
|
120
|
-
}
|
|
121
|
-
return urls;
|
|
122
|
-
}
|
|
123
|
-
urls.push(url);
|
|
124
|
-
return urls;
|
|
125
|
-
}
|
|
92
|
+
export {expandUrl} from './uri.js';
|
package/uri.d.ts
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module ol/uri
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* Appends query parameters to a URI.
|
|
6
3
|
*
|
|
@@ -10,4 +7,27 @@
|
|
|
10
7
|
* @return {string} The new URI.
|
|
11
8
|
*/
|
|
12
9
|
export function appendParams(uri: string, params: any): string;
|
|
10
|
+
/**
|
|
11
|
+
* @param {string} template The URL template. Should have `{x}`, `{y}`, and `{z}` placeholders. If
|
|
12
|
+
* the template has a `{-y}` placeholder, the `maxY` parameter must be supplied.
|
|
13
|
+
* @param {number} z The tile z coordinate.
|
|
14
|
+
* @param {number} x The tile x coordinate.
|
|
15
|
+
* @param {number} y The tile y coordinate.
|
|
16
|
+
* @param {number} [maxY] The maximum y coordinate at the given z level.
|
|
17
|
+
* @return {string} The URL.
|
|
18
|
+
*/
|
|
19
|
+
export function renderXYZTemplate(template: string, z: number, x: number, y: number, maxY?: number | undefined): string;
|
|
20
|
+
/**
|
|
21
|
+
* @param {Array<string>} urls List of URLs.
|
|
22
|
+
* @param {number} z The tile z coordinate.
|
|
23
|
+
* @param {number} x The tile x coordinate.
|
|
24
|
+
* @param {number} y The tile y coordinate.
|
|
25
|
+
* @return {string} The chosen URL.
|
|
26
|
+
*/
|
|
27
|
+
export function pickUrl(urls: Array<string>, z: number, x: number, y: number): string;
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} url URL.
|
|
30
|
+
* @return {Array<string>} Array of urls.
|
|
31
|
+
*/
|
|
32
|
+
export function expandUrl(url: string): Array<string>;
|
|
13
33
|
//# sourceMappingURL=uri.d.ts.map
|
package/uri.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uri.d.ts","sourceRoot":"","sources":["uri.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uri.d.ts","sourceRoot":"","sources":["uri.js"],"names":[],"mappings":"AAOA;;;;;;;GAOG;AACH,kCALW,MAAM,gBAGL,MAAM,CAiBjB;AAOD;;;;;;;;GAQG;AACH,4CARW,MAAM,KAEN,MAAM,KACN,MAAM,KACN,MAAM,8BAEL,MAAM,CAejB;AAED;;;;;;GAMG;AACH,8BANW,MAAM,MAAM,CAAC,KACb,MAAM,KACN,MAAM,KACN,MAAM,GACL,MAAM,CAMjB;AAED;;;GAGG;AACH,+BAHW,MAAM,GACL,MAAM,MAAM,CAAC,CA0BxB"}
|
package/uri.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* @module ol/uri
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import {hashZXY} from './tilecoord.js';
|
|
6
|
+
import {modulo} from './math.js';
|
|
7
|
+
|
|
5
8
|
/**
|
|
6
9
|
* Appends query parameters to a URI.
|
|
7
10
|
*
|
|
@@ -26,3 +29,75 @@ export function appendParams(uri, params) {
|
|
|
26
29
|
uri += uri.includes('?') ? '&' : '?';
|
|
27
30
|
return uri + qs;
|
|
28
31
|
}
|
|
32
|
+
|
|
33
|
+
const zRegEx = /\{z\}/g;
|
|
34
|
+
const xRegEx = /\{x\}/g;
|
|
35
|
+
const yRegEx = /\{y\}/g;
|
|
36
|
+
const dashYRegEx = /\{-y\}/g;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* @param {string} template The URL template. Should have `{x}`, `{y}`, and `{z}` placeholders. If
|
|
40
|
+
* the template has a `{-y}` placeholder, the `maxY` parameter must be supplied.
|
|
41
|
+
* @param {number} z The tile z coordinate.
|
|
42
|
+
* @param {number} x The tile x coordinate.
|
|
43
|
+
* @param {number} y The tile y coordinate.
|
|
44
|
+
* @param {number} [maxY] The maximum y coordinate at the given z level.
|
|
45
|
+
* @return {string} The URL.
|
|
46
|
+
*/
|
|
47
|
+
export function renderXYZTemplate(template, z, x, y, maxY) {
|
|
48
|
+
return template
|
|
49
|
+
.replace(zRegEx, z.toString())
|
|
50
|
+
.replace(xRegEx, x.toString())
|
|
51
|
+
.replace(yRegEx, y.toString())
|
|
52
|
+
.replace(dashYRegEx, function () {
|
|
53
|
+
if (maxY === undefined) {
|
|
54
|
+
throw new Error(
|
|
55
|
+
'If the URL template has a {-y} placeholder, the grid extent must be known',
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
return (maxY - y).toString();
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @param {Array<string>} urls List of URLs.
|
|
64
|
+
* @param {number} z The tile z coordinate.
|
|
65
|
+
* @param {number} x The tile x coordinate.
|
|
66
|
+
* @param {number} y The tile y coordinate.
|
|
67
|
+
* @return {string} The chosen URL.
|
|
68
|
+
*/
|
|
69
|
+
export function pickUrl(urls, z, x, y) {
|
|
70
|
+
const hash = hashZXY(z, x, y);
|
|
71
|
+
const index = modulo(hash, urls.length);
|
|
72
|
+
return urls[index];
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @param {string} url URL.
|
|
77
|
+
* @return {Array<string>} Array of urls.
|
|
78
|
+
*/
|
|
79
|
+
export function expandUrl(url) {
|
|
80
|
+
const urls = [];
|
|
81
|
+
let match = /\{([a-z])-([a-z])\}/.exec(url);
|
|
82
|
+
if (match) {
|
|
83
|
+
// char range
|
|
84
|
+
const startCharCode = match[1].charCodeAt(0);
|
|
85
|
+
const stopCharCode = match[2].charCodeAt(0);
|
|
86
|
+
let charCode;
|
|
87
|
+
for (charCode = startCharCode; charCode <= stopCharCode; ++charCode) {
|
|
88
|
+
urls.push(url.replace(match[0], String.fromCharCode(charCode)));
|
|
89
|
+
}
|
|
90
|
+
return urls;
|
|
91
|
+
}
|
|
92
|
+
match = /\{(\d+)-(\d+)\}/.exec(url);
|
|
93
|
+
if (match) {
|
|
94
|
+
// number range
|
|
95
|
+
const stop = parseInt(match[2], 10);
|
|
96
|
+
for (let i = parseInt(match[1], 10); i <= stop; i++) {
|
|
97
|
+
urls.push(url.replace(match[0], i.toString()));
|
|
98
|
+
}
|
|
99
|
+
return urls;
|
|
100
|
+
}
|
|
101
|
+
urls.push(url);
|
|
102
|
+
return urls;
|
|
103
|
+
}
|
package/util.js
CHANGED