ol 10.6.2-dev.1759181617751 → 10.6.2-dev.1760464564972
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/BingMaps.d.ts +5 -0
- package/source/BingMaps.d.ts.map +1 -1
- package/source/BingMaps.js +3 -1
- package/source/Google.d.ts +20 -0
- package/source/Google.d.ts.map +1 -1
- package/source/Google.js +24 -4
- package/util.js +1 -1
package/package.json
CHANGED
package/source/BingMaps.d.ts
CHANGED
|
@@ -68,6 +68,10 @@ export type Options = {
|
|
|
68
68
|
* which is unique for each imagery set in BingMaps.
|
|
69
69
|
*/
|
|
70
70
|
placeholderTiles?: boolean | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* The Bing Map Metadata API URL.
|
|
73
|
+
*/
|
|
74
|
+
url?: string | undefined;
|
|
71
75
|
};
|
|
72
76
|
export type BingMapsImageryMetadataResponse = {
|
|
73
77
|
/**
|
|
@@ -174,6 +178,7 @@ export type CoverageArea = {
|
|
|
174
178
|
* @property {boolean} [placeholderTiles] Whether to show BingMaps placeholder tiles when zoomed past the maximum level provided in an area. When `false`, requests beyond
|
|
175
179
|
* the maximum zoom level will return no tile. When `true`, the placeholder tile will be returned. When not set, the default behaviour of the imagery set takes place,
|
|
176
180
|
* which is unique for each imagery set in BingMaps.
|
|
181
|
+
* @property {string} [url='https://dev.virtualearth.net/REST/v1/Imagery/Metadata/'] The Bing Map Metadata API URL.
|
|
177
182
|
*/
|
|
178
183
|
/**
|
|
179
184
|
* @typedef {Object} BingMapsImageryMetadataResponse
|
package/source/BingMaps.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BingMaps.d.ts","sourceRoot":"","sources":["BingMaps.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH,mCAHW,OAAO,iBAAiB,EAAE,SAAS,GAClC,MAAM,CAoBjB;;;;;;;;;;;;;;;;;;SAkBa,MAAM;;;;gBACN,MAAM
|
|
1
|
+
{"version":3,"file":"BingMaps.d.ts","sourceRoot":"","sources":["BingMaps.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH,mCAHW,OAAO,iBAAiB,EAAE,SAAS,GAClC,MAAM,CAoBjB;;;;;;;;;;;;;;;;;;SAkBa,MAAM;;;;gBACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA0BN,MAAM;;;;uBACN,MAAM;;;;8BACN,MAAM;;;;kBACN,KAAK,CAAC,WAAW,CAAC;;;;;;eAKlB,KAAK,CAAC,QAAQ,CAAC;;;;;;iBAKf,MAAM;;;;gBACN,MAAM;;;;aACN,MAAM;;;;aACN,MAAM;;;;cACN,MAAM;;;;wBACN,KAAK,CAAC,MAAM,CAAC;;;;;;;;;;mBAMb,KAAK,CAAC,YAAY,CAAC;;;;;;;;;;aAMnB,MAAM;;;;aACN,MAAM;;;;UACN,KAAK,CAAC,MAAM,CAAC;;AAhE3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH;;;;;;GAMG;AAEH;;;GAGG;AAEH;;;;;;;;;GASG;AAEH;;;;GAIG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAmEjB;IAhDC;;;OAGG;IACH,eAAmB;IAEnB;;;OAGG;IACH,iBAAyE;IAEzE;;;OAGG;IACH,iBAAoE;IAEpE;;;OAGG;IACH,gBAA0B;IAE1B;;;OAGG;IACH,oBAAqC;IAErC;;;OAGG;IACH,0BAAiD;IAgBnD;;;;;OAKG;IACH,aAHY,MAAM,CAKjB;IAED;;;;;OAKG;IACH,iBAHY,MAAM,CAKjB;IAED;;OAEG;IACH,wCAFW,+BAA+B,QA4HzC;CACF;sBAtUqB,gBAAgB"}
|
package/source/BingMaps.js
CHANGED
|
@@ -71,6 +71,7 @@ const TOS_ATTRIBUTION =
|
|
|
71
71
|
* @property {boolean} [placeholderTiles] Whether to show BingMaps placeholder tiles when zoomed past the maximum level provided in an area. When `false`, requests beyond
|
|
72
72
|
* the maximum zoom level will return no tile. When `true`, the placeholder tile will be returned. When not set, the default behaviour of the imagery set takes place,
|
|
73
73
|
* which is unique for each imagery set in BingMaps.
|
|
74
|
+
* @property {string} [url='https://dev.virtualearth.net/REST/v1/Imagery/Metadata/'] The Bing Map Metadata API URL.
|
|
74
75
|
*/
|
|
75
76
|
|
|
76
77
|
/**
|
|
@@ -173,7 +174,8 @@ class BingMaps extends TileImage {
|
|
|
173
174
|
this.placeholderTiles_ = options.placeholderTiles;
|
|
174
175
|
|
|
175
176
|
const url =
|
|
176
|
-
|
|
177
|
+
(options.url ||
|
|
178
|
+
'https://dev.virtualearth.net/REST/v1/Imagery/Metadata/') +
|
|
177
179
|
this.imagerySet_ +
|
|
178
180
|
'?uriScheme=https&include=ImageryProviders&key=' +
|
|
179
181
|
this.apiKey_ +
|
package/source/Google.d.ts
CHANGED
|
@@ -85,6 +85,10 @@ export type Options = {
|
|
|
85
85
|
* zoom levels. See {@link module :ol/tilegrid/TileGrid~TileGrid#getZForResolution}.
|
|
86
86
|
*/
|
|
87
87
|
zDirection?: number | import("../array.js").NearestDirectionFunction | undefined;
|
|
88
|
+
/**
|
|
89
|
+
* The Google Tile server URL.
|
|
90
|
+
*/
|
|
91
|
+
url?: string | undefined;
|
|
88
92
|
};
|
|
89
93
|
export type SessionTokenRequest = {
|
|
90
94
|
/**
|
|
@@ -181,6 +185,7 @@ export type SessionTokenResponse = {
|
|
|
181
185
|
* @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0]
|
|
182
186
|
* Choose whether to use tiles with a higher or lower zoom level when between integer
|
|
183
187
|
* zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}.
|
|
188
|
+
* @property {string} [url='https://tile.googleapis.com/'] The Google Tile server URL.
|
|
184
189
|
*/
|
|
185
190
|
/**
|
|
186
191
|
* @typedef {Object} SessionTokenRequest
|
|
@@ -251,6 +256,21 @@ declare class Google extends TileImage {
|
|
|
251
256
|
* @private
|
|
252
257
|
*/
|
|
253
258
|
private previousViewportExtent_;
|
|
259
|
+
/**
|
|
260
|
+
* @type {string}
|
|
261
|
+
* @private
|
|
262
|
+
*/
|
|
263
|
+
private createSessionUrl_;
|
|
264
|
+
/**
|
|
265
|
+
* @type {string}
|
|
266
|
+
* @private
|
|
267
|
+
*/
|
|
268
|
+
private tileUrl_;
|
|
269
|
+
/**
|
|
270
|
+
* @type {string}
|
|
271
|
+
* @private
|
|
272
|
+
*/
|
|
273
|
+
private attributionUrl_;
|
|
254
274
|
/**
|
|
255
275
|
* @return {Error|null} A source loading error. When the source state is `error`, use this function
|
|
256
276
|
* to get more information about the error. To debug a faulty configuration, you may want to use
|
package/source/Google.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Google.d.ts","sourceRoot":"","sources":["Google.js"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"Google.d.ts","sourceRoot":"","sources":["Google.js"],"names":[],"mappings":";;;;;SAcc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAkCN,MAAM;;;;cACN,MAAM;;;;YACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAYN,MAAM;;;;YACN,MAAM;;;;eACN,MAAM;;;;gBACN,MAAM;;;;iBACN,MAAM;;AAtDpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;;;;;;;;;;;GAYG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,qBAFW,OAAO,EAiHjB;IA7FC;;;OAGG;IACH,gBAA0B;IAE1B;;;OAGG;IACH,eAAkB;IAgClB;;;OAGG;IACH,6BAA+C;IAE/C;;;OAGG;IACH,2BAAuB;IAEvB;;;OAGG;IACH,0BAAsB;IAEtB;;;OAGG;IACH,qCAAiC;IAEjC;;;OAGG;IACH,gCAA4B;IAI5B;;;OAGG;IACH,0BAAqD;IAErD;;;OAGG;IACH,iBAAsC;IAEtC;;;OAGG;IACH,wBAAmD;IAKrD;;;;;;;;;;;OAWG;IACH,YAXY,KAAK,GAAC,IAAI,CAarB;IAED;;;;;OAKG;IACH,uBAJW,MAAM,UACN,WAAW,GACV,OAAO,CAAC,QAAQ,CAAC,CAI5B;IAED;;;OAGG;IACH,uBA0DC;IAED;;;;OAIG;IACH,2BAoCC;CASF;sBAtUqB,gBAAgB"}
|
package/source/Google.js
CHANGED
|
@@ -8,9 +8,6 @@ import {toLonLat} from '../proj.js';
|
|
|
8
8
|
import {createXYZ, extentFromProjection} from '../tilegrid.js';
|
|
9
9
|
import TileImage from './TileImage.js';
|
|
10
10
|
|
|
11
|
-
const createSessionUrl = 'https://tile.googleapis.com/v1/createSession';
|
|
12
|
-
const tileUrl = 'https://tile.googleapis.com/v1/2dtiles';
|
|
13
|
-
const attributionUrl = 'https://tile.googleapis.com/tile/v1/viewport';
|
|
14
11
|
const maxZoom = 22;
|
|
15
12
|
|
|
16
13
|
/**
|
|
@@ -44,6 +41,7 @@ const maxZoom = 22;
|
|
|
44
41
|
* @property {number|import("../array.js").NearestDirectionFunction} [zDirection=0]
|
|
45
42
|
* Choose whether to use tiles with a higher or lower zoom level when between integer
|
|
46
43
|
* zoom levels. See {@link module:ol/tilegrid/TileGrid~TileGrid#getZForResolution}.
|
|
44
|
+
* @property {string} [url='https://tile.googleapis.com/'] The Google Tile server URL.
|
|
47
45
|
*/
|
|
48
46
|
|
|
49
47
|
/**
|
|
@@ -171,6 +169,26 @@ class Google extends TileImage {
|
|
|
171
169
|
*/
|
|
172
170
|
this.previousViewportExtent_;
|
|
173
171
|
|
|
172
|
+
const baseUrl = options.url || 'https://tile.googleapis.com/';
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* @type {string}
|
|
176
|
+
* @private
|
|
177
|
+
*/
|
|
178
|
+
this.createSessionUrl_ = baseUrl + 'v1/createSession';
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* @type {string}
|
|
182
|
+
* @private
|
|
183
|
+
*/
|
|
184
|
+
this.tileUrl_ = baseUrl + 'v1/2dtiles';
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* @type {string}
|
|
188
|
+
* @private
|
|
189
|
+
*/
|
|
190
|
+
this.attributionUrl_ = baseUrl + 'tile/v1/viewport';
|
|
191
|
+
|
|
174
192
|
this.createSession_();
|
|
175
193
|
}
|
|
176
194
|
|
|
@@ -205,7 +223,7 @@ class Google extends TileImage {
|
|
|
205
223
|
* @private
|
|
206
224
|
*/
|
|
207
225
|
async createSession_() {
|
|
208
|
-
const url =
|
|
226
|
+
const url = this.createSessionUrl_ + '?key=' + this.apiKey_;
|
|
209
227
|
const config = {
|
|
210
228
|
method: 'POST',
|
|
211
229
|
headers: {
|
|
@@ -246,6 +264,7 @@ class Google extends TileImage {
|
|
|
246
264
|
const session = sessionTokenResponse.session;
|
|
247
265
|
this.sessionTokenValue_ = session;
|
|
248
266
|
const key = this.apiKey_;
|
|
267
|
+
const tileUrl = this.tileUrl_;
|
|
249
268
|
this.tileUrlFunction = function (tileCoord, pixelRatio, projection) {
|
|
250
269
|
const z = tileCoord[0];
|
|
251
270
|
const x = tileCoord[1];
|
|
@@ -297,6 +316,7 @@ class Google extends TileImage {
|
|
|
297
316
|
this.previousViewportExtent_ = viewportExtent;
|
|
298
317
|
const session = this.sessionTokenValue_;
|
|
299
318
|
const key = this.apiKey_;
|
|
319
|
+
const attributionUrl = this.attributionUrl_;
|
|
300
320
|
const url = `${attributionUrl}?session=${session}&key=${key}&${viewportExtent}`;
|
|
301
321
|
this.previousViewportAttribution_ = await fetch(url)
|
|
302
322
|
.then((response) => response.json())
|
package/util.js
CHANGED