ol 9.2.5-dev.1720190104389 → 9.2.5-dev.1720344310382

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/ol.css CHANGED
@@ -348,3 +348,7 @@
348
348
  .ol-overviewmap .ol-overviewmap-box:hover {
349
349
  cursor: move;
350
350
  }
351
+
352
+ .ol-overviewmap .ol-viewport:hover {
353
+ cursor: pointer;
354
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "9.2.5-dev.1720190104389",
3
+ "version": "9.2.5-dev.1720344310382",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "map",
@@ -1 +1 @@
1
- {"version":3,"file":"ImageTile.d.ts","sourceRoot":"","sources":["ImageTile.js"],"names":[],"mappings":";;;;;qBAUa,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAqC,EAArC,OAAO,eAAe,EAAE,aAAa,KAAE,CAAC,OAAO,gBAAgB,EAAE,SAAS,GAAC,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC,CAAC;wBAIxJ,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAqC,EAArC,OAAO,eAAe,EAAE,aAAa,KAAE,MAAM;sBAI9E,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBjC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;AAiGjD;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,2CA2CC;IAED;;;OAGG;IACH,YAHW,OAAO,QAUjB;CACF;2BA1M0B,eAAe"}
1
+ {"version":3,"file":"ImageTile.d.ts","sourceRoot":"","sources":["ImageTile.js"],"names":[],"mappings":";;;;;qBAUa,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAqC,EAArC,OAAO,eAAe,EAAE,aAAa,KAAE,CAAC,OAAO,gBAAgB,EAAE,SAAS,GAAC,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC,CAAC;wBAIxJ,CAAS,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAM,EAAN,MAAM,EAAE,IAAqC,EAArC,OAAO,eAAe,EAAE,aAAa,KAAE,MAAM;sBAI9E,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqBjC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FjD;;;;;;;GAOG;AACH;IACE;;OAEG;IACH,2CA2CC;IAED;;;OAGG;IACH,YAHW,OAAO,QAUjB;CACF;2BAxM0B,eAAe"}
@@ -59,9 +59,7 @@ const loadError = new Error('Image failed to load');
59
59
  function loadImage(template, z, x, y, options) {
60
60
  return new Promise((resolve, reject) => {
61
61
  const image = new Image();
62
- if (options.crossOrigin !== undefined) {
63
- image.crossOrigin = options.crossOrigin;
64
- }
62
+ image.crossOrigin = options.crossOrigin ?? null;
65
63
  image.addEventListener('load', () => resolve(image));
66
64
  image.addEventListener('error', () => reject(loadError));
67
65
  image.src = renderXYZTemplate(template, z, x, y, options.maxY);
@@ -26,7 +26,7 @@ export function getRequestUrl(baseUrl: string, extent: import("../extent.js").Ex
26
26
  * or the entire code must form a valid ArcGIS SpatialReference definition.
27
27
  * @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport,
28
28
  * `2` means twice the size of the map viewport, and so on.
29
- * @property {string} [url] ArcGIS Rest service URL for a Map Service or Image Service. The url
29
+ * @property {string} url ArcGIS Rest service URL for a Map Service or Image Service. The url
30
30
  * should include /MapServer or /ImageServer.
31
31
  * @property {function(HTMLImageElement, string): Promise<import('../DataTile.js').ImageLike>} [load] Function
32
32
  * to perform loading of the image. Receives the created `HTMLImageElement` and the desired `src` as argument and
@@ -77,7 +77,7 @@ export type LoaderOptions = {
77
77
  * ArcGIS Rest service URL for a Map Service or Image Service. The url
78
78
  * should include /MapServer or /ImageServer.
79
79
  */
80
- url?: string | undefined;
80
+ url: string;
81
81
  /**
82
82
  * Function
83
83
  * to perform loading of the image. Receives the created `HTMLImageElement` and the desired `src` as argument and
@@ -1 +1 @@
1
- {"version":3,"file":"arcgisRest.d.ts","sourceRoot":"","sources":["arcgisRest.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,uCARW,MAAM,UACN,OAAO,cAAc,EAAE,MAAM,cAC7B,MAAM,cACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,gBAEtC,MAAM,CAqCjB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CAwCzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAvDa,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;mBAO1B,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
1
+ {"version":3,"file":"arcgisRest.d.ts","sourceRoot":"","sources":["arcgisRest.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,uCARW,MAAM,UACN,OAAO,cAAc,EAAE,MAAM,cAC7B,MAAM,cACN,MAAM,cACN,OAAO,uBAAuB,EAAE,OAAO,gBAEtC,MAAM,CAqCjB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CAwCzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAvDa,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;SAKnC,MAAM;;;;;;mBAEG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
@@ -74,7 +74,7 @@ export function getRequestUrl(
74
74
  * or the entire code must form a valid ArcGIS SpatialReference definition.
75
75
  * @property {number} [ratio=1.5] Ratio. `1` means image requests are the size of the map viewport,
76
76
  * `2` means twice the size of the map viewport, and so on.
77
- * @property {string} [url] ArcGIS Rest service URL for a Map Service or Image Service. The url
77
+ * @property {string} url ArcGIS Rest service URL for a Map Service or Image Service. The url
78
78
  * should include /MapServer or /ImageServer.
79
79
  * @property {function(HTMLImageElement, string): Promise<import('../DataTile.js').ImageLike>} [load] Function
80
80
  * to perform loading of the image. Receives the created `HTMLImageElement` and the desired `src` as argument and
@@ -90,6 +90,8 @@ export function getRequestUrl(
90
90
  export function createLoader(options) {
91
91
  const load = options.load ? options.load : decode;
92
92
  const projection = getProjection(options.projection || 'EPSG:3857');
93
+ const ratio = options.ratio ?? 1.5;
94
+ const crossOrigin = options.crossOrigin ?? null;
93
95
 
94
96
  /** @type {import('../Image.js').ImageObjectPromiseLoader} */
95
97
  return function (extent, resolution, pixelRatio) {
@@ -102,7 +104,7 @@ export function createLoader(options) {
102
104
  };
103
105
  Object.assign(params, options.params);
104
106
 
105
- extent = getRequestExtent(extent, resolution, pixelRatio, options.ratio);
107
+ extent = getRequestExtent(extent, resolution, pixelRatio, ratio);
106
108
 
107
109
  const src = getRequestUrl(
108
110
  options.url,
@@ -114,9 +116,7 @@ export function createLoader(options) {
114
116
  );
115
117
 
116
118
  const image = new Image();
117
- if (options.crossOrigin !== null) {
118
- image.crossOrigin = options.crossOrigin;
119
- }
119
+ image.crossOrigin = crossOrigin;
120
120
 
121
121
  return load(image, src).then((image) => {
122
122
  // Update resolution, because the server may return a smaller size than requested
@@ -9,7 +9,7 @@ export type LoaderOptions = {
9
9
  /**
10
10
  * The mapagent url.
11
11
  */
12
- url?: string | undefined;
12
+ url: string;
13
13
  /**
14
14
  * The `crossOrigin` attribute for loaded images. Note that
15
15
  * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
@@ -1 +1 @@
1
- {"version":3,"file":"mapguide.d.ts","sourceRoot":"","sources":["mapguide.js"],"names":[],"mappings":"AAqFA;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CA2BzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBA5FsB,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
1
+ {"version":3,"file":"mapguide.d.ts","sourceRoot":"","sources":["mapguide.js"],"names":[],"mappings":"AAqFA;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CA8BzD;;;;;SA3Ga,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAYG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
@@ -9,7 +9,7 @@ import {getRequestExtent} from './Image.js';
9
9
 
10
10
  /**
11
11
  * @typedef {Object} LoaderOptions
12
- * @property {string} [url] The mapagent url.
12
+ * @property {string} url The mapagent url.
13
13
  * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
14
14
  * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
15
15
  * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
@@ -91,14 +91,17 @@ function getUrl(
91
91
  */
92
92
  export function createLoader(options) {
93
93
  const load = options.load || decode;
94
+ const useOverlay = options.useOverlay ?? false;
95
+ const metersPerUnit = options.metersPerUnit || 1;
96
+ const displayDpi = options.displayDpi || 96;
97
+ const ratio = options.ratio ?? 1;
98
+ const crossOrigin = options.crossOrigin ?? null;
94
99
 
95
100
  /** @type {import('../Image.js').ImageObjectPromiseLoader} */
96
101
  return function (extent, resolution, pixelRatio) {
97
102
  const image = new Image();
98
- if (options.crossOrigin !== null) {
99
- image.crossOrigin = options.crossOrigin;
100
- }
101
- extent = getRequestExtent(extent, resolution, pixelRatio, options.ratio);
103
+ image.crossOrigin = crossOrigin;
104
+ extent = getRequestExtent(extent, resolution, pixelRatio, ratio);
102
105
  const width = getWidth(extent) / resolution;
103
106
  const height = getHeight(extent) / resolution;
104
107
  const size = [width * pixelRatio, height * pixelRatio];
@@ -107,9 +110,9 @@ export function createLoader(options) {
107
110
  options.params,
108
111
  extent,
109
112
  size,
110
- options.useOverlay,
111
- options.metersPerUnit || 1,
112
- options.displayDpi || 96,
113
+ useOverlay,
114
+ metersPerUnit,
115
+ displayDpi,
113
116
  );
114
117
  return load(image, src).then((image) => ({image, extent, pixelRatio}));
115
118
  };
@@ -3,7 +3,7 @@
3
3
  * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
4
4
  * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
5
5
  * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
6
- * @property {import("../extent.js").Extent} [imageExtent] Extent of the image in map coordinates.
6
+ * @property {import("../extent.js").Extent} imageExtent Extent of the image in map coordinates.
7
7
  * This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an
8
8
  * `ol/source/Image`, the same extent must be set as `extent` of the `ol/layer/Image`.
9
9
  * @property {string} url Image URL.
@@ -30,7 +30,7 @@ export type LoaderOptions = {
30
30
  * This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an
31
31
  * `ol/source/Image`, the same extent must be set as `extent` of the `ol/layer/Image`.
32
32
  */
33
- imageExtent?: import("../extent.js").Extent | undefined;
33
+ imageExtent: import("../extent.js").Extent;
34
34
  /**
35
35
  * Image URL.
36
36
  */
@@ -1 +1 @@
1
- {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["static.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CAmBzD;;;;;;;;;;;;;;;;;SA5Ba,MAAM;;;;;;mBACG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
1
+ {"version":3,"file":"static.d.ts","sourceRoot":"","sources":["static.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;GAYG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CAmBzD;;;;;;;;;;;;;iBA/Ba,OAAO,cAAc,EAAE,MAAM;;;;SAG7B,MAAM;;;;;;mBACG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
package/source/static.js CHANGED
@@ -10,7 +10,7 @@ import {getHeight, getWidth} from '../extent.js';
10
10
  * @property {null|string} [crossOrigin] The `crossOrigin` attribute for loaded images. Note that
11
11
  * you must provide a `crossOrigin` value if you want to access pixel data with the Canvas renderer.
12
12
  * See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image for more detail.
13
- * @property {import("../extent.js").Extent} [imageExtent] Extent of the image in map coordinates.
13
+ * @property {import("../extent.js").Extent} imageExtent Extent of the image in map coordinates.
14
14
  * This is the [left, bottom, right, top] map coordinates of your image. When using this loader with an
15
15
  * `ol/source/Image`, the same extent must be set as `extent` of the `ol/layer/Image`.
16
16
  * @property {string} url Image URL.
@@ -28,17 +28,17 @@ import {getHeight, getWidth} from '../extent.js';
28
28
  export function createLoader(options) {
29
29
  const load = options.load || decode;
30
30
  const extent = options.imageExtent;
31
- const image = new Image();
32
- if (options.crossOrigin !== null) {
33
- image.crossOrigin = options.crossOrigin;
34
- }
31
+ const crossOrigin = options.crossOrigin ?? null;
35
32
 
36
- return () =>
37
- load(image, options.url).then((image) => {
33
+ return () => {
34
+ const image = new Image();
35
+ image.crossOrigin = crossOrigin;
36
+ return load(image, options.url).then((image) => {
38
37
  const resolutionX = getWidth(extent) / image.width;
39
38
  const resolutionY = getHeight(extent) / image.height;
40
39
  const resolution =
41
40
  resolutionX !== resolutionY ? [resolutionX, resolutionY] : resolutionY;
42
41
  return {image, extent, resolution, pixelRatio: 1};
43
42
  });
43
+ };
44
44
  }
@@ -1 +1 @@
1
- {"version":3,"file":"wms.d.ts","sourceRoot":"","sources":["wms.js"],"names":[],"mappings":"AAyBA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,uCAPW,MAAM,UACN,OAAO,cAAc,EAAE,MAAM,QAC7B,OAAO,YAAY,EAAE,IAAI,cACzB,OAAO,uBAAuB,EAAE,OAAO,gBAEtC,MAAM,CAkBjB;AAED;;;;;;;;;GASG;AACH,oCATW,OAAO,WAAW,EAAE,MAAM,cAC1B,MAAM,cACN,MAAM,cACN,OAAO,YAAY,EAAE,UAAU,OAC/B,MAAM,2BAEN,OAAO,UAAU,EAAE,UAAU,GAC5B,MAAM,CA4CjB;AAED;;;;GAIG;AACH,uDAHW,MAAM,OAehB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CAgCzD;AAED;;;;;;;;;;;GAWG;AACH,2CATW,aAAa,cAIb,OAAO,kBAAkB,EAAE,UAAU,cACrC,MAAM,GACL,MAAM,GAAC,SAAS,CAwC3B;AAED;;;;;;;;;;GAUG;AACH,sCANW,aAAa,oCAGZ,MAAM,GAAC,SAAS,CAkC3B;AAlRD;;;GAGG;AACH,8BAFU,MAAM,CAEuB;;;;;;;;yBAU1B,gBAAgB,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;iBAsHpD,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;SAMnC,MAAM;;;;;;mBACG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
1
+ {"version":3,"file":"wms.d.ts","sourceRoot":"","sources":["wms.js"],"names":[],"mappings":"AAyBA;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,uCAPW,MAAM,UACN,OAAO,cAAc,EAAE,MAAM,QAC7B,OAAO,YAAY,EAAE,IAAI,cACzB,OAAO,uBAAuB,EAAE,OAAO,gBAEtC,MAAM,CAkBjB;AAED;;;;;;;;;GASG;AACH,oCATW,OAAO,WAAW,EAAE,MAAM,cAC1B,MAAM,cACN,MAAM,cACN,OAAO,YAAY,EAAE,UAAU,OAC/B,MAAM,2BAEN,OAAO,UAAU,EAAE,UAAU,GAC5B,MAAM,CA4CjB;AAED;;;;GAIG;AACH,uDAHW,MAAM,OAehB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH;;;;;GAKG;AACH,sCAJW,aAAa,GACZ,OAAO,aAAa,EAAE,wBAAwB,CA+BzD;AAED;;;;;;;;;;;GAWG;AACH,2CATW,aAAa,cAIb,OAAO,kBAAkB,EAAE,UAAU,cACrC,MAAM,GACL,MAAM,GAAC,SAAS,CAwC3B;AAED;;;;;;;;;;GAUG;AACH,sCANW,aAAa,oCAGZ,MAAM,GAAC,SAAS,CAkC3B;AAjRD;;;GAGG;AACH,8BAFU,MAAM,CAEuB;;;;;;;;yBAU1B,gBAAgB,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;iBAsHpD,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;SAMnC,MAAM;;;;;;mBACG,gBAAgB,QAAE,MAAM,KAAG,OAAO,CAAC,OAAO,gBAAgB,EAAE,SAAS,CAAC"}
package/source/wms.js CHANGED
@@ -166,6 +166,7 @@ export function createLoader(options) {
166
166
  const projection = getProjection(options.projection || 'EPSG:3857');
167
167
  const ratio = options.ratio || 1.5;
168
168
  const load = options.load || decode;
169
+ const crossOrigin = options.crossOrigin ?? null;
169
170
 
170
171
  /**
171
172
  * @type {import("../Image.js").Loader}
@@ -185,9 +186,7 @@ export function createLoader(options) {
185
186
  options.serverType,
186
187
  );
187
188
  const image = new Image();
188
- if (options.crossOrigin !== null) {
189
- image.crossOrigin = options.crossOrigin;
190
- }
189
+ image.crossOrigin = crossOrigin;
191
190
  return load(image, src).then((image) => ({image, extent, pixelRatio}));
192
191
  };
193
192
  }
@@ -266,15 +265,6 @@ export function getLegendUrl(options, resolution) {
266
265
  'FORMAT': 'image/png',
267
266
  };
268
267
 
269
- if (options.params === undefined || options.params['LAYER'] === undefined) {
270
- const layers = options.params.LAYERS;
271
- const isSingleLayer = !Array.isArray(layers) || layers.length === 1;
272
- if (!isSingleLayer) {
273
- return undefined;
274
- }
275
- baseParams['LAYER'] = layers;
276
- }
277
-
278
268
  if (resolution !== undefined) {
279
269
  const mpu =
280
270
  getProjection(options.projection || 'EPSG:3857').getMetersPerUnit() || 1;
@@ -284,5 +274,14 @@ export function getLegendUrl(options, resolution) {
284
274
 
285
275
  Object.assign(baseParams, options.params);
286
276
 
277
+ if (options.params !== undefined && baseParams['LAYER'] === undefined) {
278
+ const layers = baseParams['LAYERS'];
279
+ const isSingleLayer = !Array.isArray(layers) || layers.length !== 1;
280
+ if (!isSingleLayer) {
281
+ return undefined;
282
+ }
283
+ baseParams['LAYER'] = layers;
284
+ }
285
+
287
286
  return appendParams(options.url, baseParams);
288
287
  }
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 = '9.2.5-dev.1720190104389';
36
+ export const VERSION = '9.2.5-dev.1720344310382';