ol 7.2.3-dev.1674137185986 → 7.2.3-dev.1674224116171
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/Image.d.ts +9 -1
- package/Image.d.ts.map +1 -1
- package/Image.js +22 -1
- package/MapBrowserEventHandler.d.ts.map +1 -1
- package/MapBrowserEventHandler.js +5 -7
- package/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/package.json +1 -1
- package/renderer/canvas/ImageLayer.js +3 -3
- package/source/ImageArcGISRest.d.ts +5 -0
- package/source/ImageArcGISRest.d.ts.map +1 -1
- package/source/ImageArcGISRest.js +9 -1
- package/source/ImageMapGuide.d.ts +5 -0
- package/source/ImageMapGuide.d.ts.map +1 -1
- package/source/ImageMapGuide.js +9 -1
- package/source/ImageStatic.d.ts.map +1 -1
- package/source/ImageStatic.js +2 -1
- package/source/ImageWMS.d.ts +5 -0
- package/source/ImageWMS.d.ts.map +1 -1
- package/source/ImageWMS.js +9 -1
- package/util.js +1 -1
package/Image.d.ts
CHANGED
|
@@ -46,8 +46,11 @@ declare class ImageWrapper extends ImageBase {
|
|
|
46
46
|
* @param {string} src Image source URI.
|
|
47
47
|
* @param {?string} crossOrigin Cross origin.
|
|
48
48
|
* @param {LoadFunction} imageLoadFunction Image load function.
|
|
49
|
+
* @param {CanvasRenderingContext2D} [context] Canvas context. When provided, the image will be
|
|
50
|
+
* drawn into the context's canvas, and `getImage()` will return the canvas once the image
|
|
51
|
+
* has finished loading.
|
|
49
52
|
*/
|
|
50
|
-
constructor(extent: import("./extent.js").Extent, resolution: number | undefined, pixelRatio: number, src: string, crossOrigin: string | null, imageLoadFunction: LoadFunction);
|
|
53
|
+
constructor(extent: import("./extent.js").Extent, resolution: number | undefined, pixelRatio: number, src: string, crossOrigin: string | null, imageLoadFunction: LoadFunction, context?: CanvasRenderingContext2D | undefined);
|
|
51
54
|
/**
|
|
52
55
|
* @private
|
|
53
56
|
* @type {string}
|
|
@@ -58,6 +61,11 @@ declare class ImageWrapper extends ImageBase {
|
|
|
58
61
|
* @type {HTMLCanvasElement|HTMLImageElement|HTMLVideoElement}
|
|
59
62
|
*/
|
|
60
63
|
private image_;
|
|
64
|
+
/**
|
|
65
|
+
* @private
|
|
66
|
+
* @type {CanvasRenderingContext2D}
|
|
67
|
+
*/
|
|
68
|
+
private context_;
|
|
61
69
|
/**
|
|
62
70
|
* @private
|
|
63
71
|
* @type {?function():void}
|
package/Image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["Image.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["Image.js"],"names":[],"mappings":"AA+KA;;;;;GAKG;AACH,mCALW,iBAAiB,GAAC,gBAAgB,GAAC,gBAAgB,qBACxC,GAAG,sBACH,GAAG,SACF,IAAI,CA2C1B;;;;;;;;;;;;;;;;kCAtMqB,YAAY,QAAE,MAAM,KAAG,IAAI;AAdjD;;;;;;;;;;;;;;;;GAgBG;AAEH;IACE;;;;;;;;;;OAUG;IACH,oBAVW,OAAO,aAAa,EAAE,MAAM,cAC5B,MAAM,GAAC,SAAS,cAChB,MAAM,OACN,MAAM,eACL,MAAM,4BACP,YAAY,kDAsDtB;IAtCC;;;OAGG;IACH,aAAe;IAEf;;;OAGG;IACH,eAAyB;IAKzB;;;OAGG;IACH,iBAAuB;IAEvB;;;OAGG;IACH,kBAAqB;IAQrB;;;OAGG;IACH,2BAA2C;IAsB7C;;;;OAIG;IACH,0BAIC;IAED;;;;OAIG;IACH,yBAOC;IAqBD;;OAEG;IACH,gBAFW,iBAAiB,GAAC,gBAAgB,GAAC,gBAAgB,QAK7D;IAED;;;;OAIG;IACH,uBAKC;CACF"}
|
package/Image.js
CHANGED
|
@@ -34,6 +34,9 @@ class ImageWrapper extends ImageBase {
|
|
|
34
34
|
* @param {string} src Image source URI.
|
|
35
35
|
* @param {?string} crossOrigin Cross origin.
|
|
36
36
|
* @param {LoadFunction} imageLoadFunction Image load function.
|
|
37
|
+
* @param {CanvasRenderingContext2D} [context] Canvas context. When provided, the image will be
|
|
38
|
+
* drawn into the context's canvas, and `getImage()` will return the canvas once the image
|
|
39
|
+
* has finished loading.
|
|
37
40
|
*/
|
|
38
41
|
constructor(
|
|
39
42
|
extent,
|
|
@@ -41,7 +44,8 @@ class ImageWrapper extends ImageBase {
|
|
|
41
44
|
pixelRatio,
|
|
42
45
|
src,
|
|
43
46
|
crossOrigin,
|
|
44
|
-
imageLoadFunction
|
|
47
|
+
imageLoadFunction,
|
|
48
|
+
context
|
|
45
49
|
) {
|
|
46
50
|
super(extent, resolution, pixelRatio, ImageState.IDLE);
|
|
47
51
|
|
|
@@ -60,6 +64,12 @@ class ImageWrapper extends ImageBase {
|
|
|
60
64
|
this.image_.crossOrigin = crossOrigin;
|
|
61
65
|
}
|
|
62
66
|
|
|
67
|
+
/**
|
|
68
|
+
* @private
|
|
69
|
+
* @type {CanvasRenderingContext2D}
|
|
70
|
+
*/
|
|
71
|
+
this.context_ = context;
|
|
72
|
+
|
|
63
73
|
/**
|
|
64
74
|
* @private
|
|
65
75
|
* @type {?function():void}
|
|
@@ -84,6 +94,17 @@ class ImageWrapper extends ImageBase {
|
|
|
84
94
|
* @api
|
|
85
95
|
*/
|
|
86
96
|
getImage() {
|
|
97
|
+
if (
|
|
98
|
+
this.state == ImageState.LOADED &&
|
|
99
|
+
this.context_ &&
|
|
100
|
+
!(this.image_ instanceof HTMLCanvasElement)
|
|
101
|
+
) {
|
|
102
|
+
const canvas = this.context_.canvas;
|
|
103
|
+
canvas.width = this.image_.width;
|
|
104
|
+
canvas.height = this.image_.height;
|
|
105
|
+
this.context_.drawImage(this.image_, 0, 0);
|
|
106
|
+
this.image_ = this.context_.canvas;
|
|
107
|
+
}
|
|
87
108
|
return this.image_;
|
|
88
109
|
}
|
|
89
110
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapBrowserEventHandler.d.ts","sourceRoot":"","sources":["MapBrowserEventHandler.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"MapBrowserEventHandler.d.ts","sourceRoot":"","sources":["MapBrowserEventHandler.js"],"names":[],"mappings":";AAYA;IACE;;;OAGG;IACH,iBAHW,OAAO,UAAU,EAAE,OAAO,sCAyGpC;IAnGC;;;;OAIG;IACH,aAAe;IAEf;;;OAGG;IACH,wBAAoB;IAEpB;;;OAGG;IACH,gBAFU,OAAO,CAEU;IAE3B;;;OAGG;IACH,kBAAsB;IAEtB;;;OAGG;IACH,0BAA2B;IAE3B;;;OAGG;IACH,uBAAqE;IAErE;;;;;OAKG;IACH,cAAiB;IAIjB;;;OAGG;IACH,wBAAyB;IAEzB;;;OAGG;IACH,wBAAyB;IAEzB,sBAAuB;IAEvB;;;OAGG;IACH,gCAKC;IAED;;;OAGG;IACH,kCAA8B;IAE9B;;;OAGG;IACH,4BAKC;IAED;;OAEG;IACH,8BAA6D;IAS/D;;;;OAIG;IACH,sBA6BC;IAED;;;;;;OAMG;IACH,8BA0BC;IAED;;;;OAIG;IACH,yBAiCC;IAED;;;;;OAKG;IACH,6BAEC;IAED;;;;OAIG;IACH,2BA4DC;IAED;;;;OAIG;IACH,2BAiBC;IAED;;;;;OAKG;IACH,wBAWC;IAED;;;;;;;OAOG;IACH,yBAUC;IAED;;;;;OAKG;IACH,kBAOC;CA0BF"}
|
|
@@ -8,7 +8,6 @@ import MapBrowserEventType from './MapBrowserEventType.js';
|
|
|
8
8
|
import PointerEventType from './pointer/EventType.js';
|
|
9
9
|
import Target from './events/Target.js';
|
|
10
10
|
import {PASSIVE_EVENT_LISTENERS} from './has.js';
|
|
11
|
-
import {VOID} from './functions.js';
|
|
12
11
|
import {listen, unlistenByKey} from './events.js';
|
|
13
12
|
|
|
14
13
|
class MapBrowserEventHandler extends Target {
|
|
@@ -259,12 +258,11 @@ class MapBrowserEventHandler extends Target {
|
|
|
259
258
|
);
|
|
260
259
|
this.dispatchEvent(newEvent);
|
|
261
260
|
|
|
262
|
-
|
|
263
|
-
this.down_
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
261
|
+
this.down_ = new PointerEvent(pointerEvent.type, pointerEvent);
|
|
262
|
+
Object.defineProperty(this.down_, 'target', {
|
|
263
|
+
writable: false,
|
|
264
|
+
value: pointerEvent.target,
|
|
265
|
+
});
|
|
268
266
|
|
|
269
267
|
if (this.dragListenerKeys_.length === 0) {
|
|
270
268
|
const doc = this.map_.getOwnerDocument();
|