ol 7.5.1 → 8.0.0-dev.1692053484481
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 +2 -2
- package/DataTile.d.ts.map +1 -1
- package/DataTile.js +3 -2
- package/Image.d.ts +139 -40
- package/Image.d.ts.map +1 -1
- package/Image.js +194 -96
- package/ImageCanvas.d.ts +2 -2
- package/ImageCanvas.d.ts.map +1 -1
- package/ImageCanvas.js +2 -2
- package/Object.d.ts +7 -0
- package/Object.d.ts.map +1 -1
- package/Object.js +8 -0
- package/dist/ol.js +2 -2
- package/dist/ol.js.map +1 -1
- package/expr/cpu.d.ts +71 -0
- package/expr/cpu.d.ts.map +1 -0
- package/expr/cpu.js +312 -0
- package/expr/expression.d.ts +97 -0
- package/expr/expression.d.ts.map +1 -0
- package/expr/expression.js +373 -0
- package/has.d.ts +5 -0
- package/has.d.ts.map +1 -1
- package/has.js +6 -0
- package/index.d.ts +1 -2
- package/index.js +1 -1
- package/layer/Base.d.ts +12 -8
- package/layer/Base.d.ts.map +1 -1
- package/layer/Base.js +12 -8
- package/layer/BaseVector.d.ts.map +1 -1
- package/layer/BaseVector.js +67 -33
- package/layer/Heatmap.d.ts.map +1 -1
- package/layer/Heatmap.js +16 -55
- package/layer/Layer.d.ts +2 -2
- package/layer/Layer.d.ts.map +1 -1
- package/layer/Layer.js +1 -1
- package/layer/WebGLPoints.d.ts +7 -12
- package/layer/WebGLPoints.d.ts.map +1 -1
- package/layer/WebGLPoints.js +7 -12
- package/package.json +1 -1
- package/render/Feature.d.ts +8 -0
- package/render/Feature.d.ts.map +1 -1
- package/render/Feature.js +9 -0
- package/render/canvas/Immediate.d.ts.map +1 -1
- package/render/canvas/Immediate.js +5 -3
- package/render/canvas/TextBuilder.js +2 -2
- package/render/canvas/style.d.ts +69 -0
- package/render/canvas/style.d.ts.map +1 -0
- package/render/canvas/style.js +1192 -0
- package/render/canvas.js +1 -1
- package/render/webgl/VectorStyleRenderer.d.ts.map +1 -1
- package/render/webgl/VectorStyleRenderer.js +4 -0
- package/renderer/Layer.d.ts +2 -2
- package/renderer/Layer.d.ts.map +1 -1
- package/renderer/Layer.js +1 -1
- package/renderer/canvas/ImageLayer.d.ts +4 -4
- package/renderer/canvas/ImageLayer.d.ts.map +1 -1
- package/renderer/canvas/ImageLayer.js +17 -12
- package/renderer/canvas/Layer.d.ts +2 -2
- package/renderer/canvas/Layer.d.ts.map +1 -1
- package/renderer/canvas/Layer.js +1 -1
- package/renderer/canvas/VectorImageLayer.d.ts.map +1 -1
- package/renderer/canvas/VectorImageLayer.js +3 -2
- package/renderer/webgl/VectorLayer.d.ts +1 -2
- package/renderer/webgl/VectorLayer.d.ts.map +1 -1
- package/reproj/Image.d.ts +5 -5
- package/reproj/Image.d.ts.map +1 -1
- package/reproj/Image.js +6 -6
- package/reproj.d.ts +2 -2
- package/reproj.d.ts.map +1 -1
- package/reproj.js +1 -1
- package/resolution.d.ts +13 -0
- package/resolution.d.ts.map +1 -0
- package/resolution.js +18 -0
- package/source/Image.d.ts +44 -7
- package/source/Image.d.ts.map +1 -1
- package/source/Image.js +97 -8
- package/source/ImageArcGISRest.d.ts +0 -23
- package/source/ImageArcGISRest.d.ts.map +1 -1
- package/source/ImageArcGISRest.js +18 -120
- package/source/ImageMapGuide.d.ts +0 -24
- package/source/ImageMapGuide.d.ts.map +1 -1
- package/source/ImageMapGuide.js +21 -113
- package/source/ImageStatic.d.ts +2 -27
- package/source/ImageStatic.d.ts.map +1 -1
- package/source/ImageStatic.js +20 -70
- package/source/ImageWMS.d.ts +2 -46
- package/source/ImageWMS.d.ts.map +1 -1
- package/source/ImageWMS.js +43 -201
- package/source/{Stamen.d.ts → StadiaMaps.d.ts} +17 -7
- package/source/StadiaMaps.d.ts.map +1 -0
- package/source/{Stamen.js → StadiaMaps.js} +85 -38
- package/source/TileArcGISRest.d.ts.map +1 -1
- package/source/TileArcGISRest.js +11 -22
- package/source/TileWMS.d.ts +0 -1
- package/source/TileWMS.d.ts.map +1 -1
- package/source/TileWMS.js +43 -106
- package/source/arcgisRest.d.ts +88 -0
- package/source/arcgisRest.d.ts.map +1 -0
- package/source/arcgisRest.js +131 -0
- package/source/common.d.ts +5 -0
- package/source/common.d.ts.map +1 -1
- package/source/common.js +6 -0
- package/source/mapguide.d.ts +52 -0
- package/source/mapguide.d.ts.map +1 -0
- package/source/mapguide.js +116 -0
- package/source/static.d.ts +45 -0
- package/source/static.d.ts.map +1 -0
- package/source/static.js +44 -0
- package/source/wms.d.ts +109 -1
- package/source/wms.d.ts.map +1 -1
- package/source/wms.js +170 -0
- package/source.d.ts +5 -1
- package/source.d.ts.map +1 -1
- package/source.js +5 -1
- package/style/flat.d.ts +332 -173
- package/style/flat.d.ts.map +1 -1
- package/style/flat.js +176 -248
- package/style/literal.d.ts +27 -72
- package/style/literal.d.ts.map +1 -1
- package/style/literal.js +14 -35
- package/util.d.ts.map +1 -1
- package/util.js +1 -1
- package/webgl/Helper.d.ts +7 -2
- package/webgl/Helper.d.ts.map +1 -1
- package/webgl/Helper.js +16 -27
- package/webgl/ShaderBuilder.d.ts +4 -14
- package/webgl/ShaderBuilder.d.ts.map +1 -1
- package/webgl/ShaderBuilder.js +72 -72
- package/webgl/styleparser.d.ts +3 -9
- package/webgl/styleparser.d.ts.map +1 -1
- package/webgl/styleparser.js +503 -88
- package/ImageBase.d.ts +0 -65
- package/ImageBase.d.ts.map +0 -1
- package/ImageBase.js +0 -98
- package/source/Stamen.d.ts.map +0 -1
package/render/canvas.js
CHANGED
|
@@ -439,7 +439,7 @@ export function drawImageOrLabel(
|
|
|
439
439
|
context.globalAlpha *= opacity;
|
|
440
440
|
}
|
|
441
441
|
if (transform) {
|
|
442
|
-
context.
|
|
442
|
+
context.transform.apply(context, transform);
|
|
443
443
|
}
|
|
444
444
|
|
|
445
445
|
if (/** @type {*} */ (labelOrImage).contextInstructions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorStyleRenderer.d.ts","sourceRoot":"","sources":["VectorStyleRenderer.js"],"names":[],"mappings":";;;;yBA0BU,MAAM;;;;;;;;;;;;;;;;;;;;;;;qBAeO,OAAO,eAAe,EAAE,WAAW,KAAE,MAAM,GAAC,MAAM,MAAM,CAAC;;;QAK5D,MAAM,GAAE,mBAAmB;;;QAC3B,MAAM,GAAE,OAAO,oBAAoB,EAAE,YAAY;;;;;;oBAKvD,MAAM,gBAAgB,CAAC;;;;uBACvB,MAAM,gBAAgB,CAAC;;;;kBACvB,MAAM,gBAAgB,CAAC;;;;6BACvB,OAAO,oBAAoB,EAAE,SAAS;;;;;;yBAKtC,YAAY,GAAC,IAAI;;;;4BACjB,YAAY,GAAC,IAAI;;;;uBACjB,YAAY,GAAC,IAAI;;;;;;;;;YAKjB,MAAM;;;;cACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAcP,OAAO,wBAAwB,EAAE,YAAY,GAAC,YAAY;AA9CvE;;;;;;;GAOG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH;IACE;;;OAGG;IACH,4BAHW,WAAW,UACX,OAAO,uBAAuB,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"VectorStyleRenderer.d.ts","sourceRoot":"","sources":["VectorStyleRenderer.js"],"names":[],"mappings":";;;;yBA0BU,MAAM;;;;;;;;;;;;;;;;;;;;;;;qBAeO,OAAO,eAAe,EAAE,WAAW,KAAE,MAAM,GAAC,MAAM,MAAM,CAAC;;;QAK5D,MAAM,GAAE,mBAAmB;;;QAC3B,MAAM,GAAE,OAAO,oBAAoB,EAAE,YAAY;;;;;;oBAKvD,MAAM,gBAAgB,CAAC;;;;uBACvB,MAAM,gBAAgB,CAAC;;;;kBACvB,MAAM,gBAAgB,CAAC;;;;6BACvB,OAAO,oBAAoB,EAAE,SAAS;;;;;;yBAKtC,YAAY,GAAC,IAAI;;;;4BACjB,YAAY,GAAC,IAAI;;;;uBACjB,YAAY,GAAC,IAAI;;;;;;;;;YAKjB,MAAM;;;;cACN,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAcP,OAAO,wBAAwB,EAAE,YAAY,GAAC,YAAY;AA9CvE;;;;;;;GAOG;AAEH;;;GAGG;AAEH;;;;;;GAMG;AAEH;;;;;GAKG;AAEH;;;;GAIG;AAEH;;;;;;;;GAQG;AAEH;;GAEG;AAEH;;;;;;;;;;;;GAYG;AACH;IACE;;;OAGG;IACH,4BAHW,WAAW,UACX,OAAO,uBAAuB,EAAE,OAAO,EA+IjD;IA5IC,iDAAqB;IAiCrB;;;OAGG;IACH,iBAAsC;IAEpC,sCAA4C;IAC5C,wCAAgD;IAChD,uCAGC;IAGH;;;OAGG;IACH,mBAA0C;IAExC,wCAAkE;IAClE,0CAAsE;IACtE,yCAGC;IAGH;;;OAGG;IACH,mBAA0C;IAExC,wCAAkE;IAClE,0CAAsE;IACtE,yCAGC;IAGH;;kBAA2C;IAC3C;;kBAAiC;IASjC;;;OAGG;IACH,+BAOC;IACD;;;OAGG;IACH,kCAiBC;IACD;;;OAGG;IACH,6BAYC;IAOH;;;;OAIG;IACH,+BAJW,OAAO,yBAAyB,EAAE,OAAO,aACzC,OAAO,oBAAoB,EAAE,SAAS,GACrC,QAAQ,YAAY,CAAC,CAqChC;IAED;;;;;OAKG;IACH,oCA+BC;IAED;;;;;;OAMG;IACH,gCAuEC;IAED;;;;;OAKG;IACH,gBAJW,YAAY,cACZ,OAAO,cAAc,EAAE,UAAU,2BACrB,IAAI,QA8B1B;IAED;;;;;;;;OAQG;IACH,wBAeC;CACF;6BAjd4B,uBAAuB"}
|
package/renderer/Layer.d.ts
CHANGED
|
@@ -104,11 +104,11 @@ declare class LayerRenderer<LayerType extends import("../layer/Layer.js").defaul
|
|
|
104
104
|
/**
|
|
105
105
|
* Load the image if not already loaded, and register the image change
|
|
106
106
|
* listener if needed.
|
|
107
|
-
* @param {import("../
|
|
107
|
+
* @param {import("../Image.js").default} image Image.
|
|
108
108
|
* @return {boolean} `true` if the image is already loaded, `false` otherwise.
|
|
109
109
|
* @protected
|
|
110
110
|
*/
|
|
111
|
-
protected loadImage(image: import("../
|
|
111
|
+
protected loadImage(image: import("../Image.js").default): boolean;
|
|
112
112
|
/**
|
|
113
113
|
* @protected
|
|
114
114
|
*/
|
package/renderer/Layer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["Layer.js"],"names":[],"mappings":";AAQA;;GAEG;AACH;IACE;;OAEG;IACH,mBAFW,SAAS,EAwBnB;IAnBC;;;OAGG;IACH,OAFU,OAAO,CAEA;IAEjB,eAAe;IACf,gCAAiE;IAEjE;;;OAGG;IACH,kBAFU,SAAS,CAEA;IAEnB;;OAEG;IACH,wBAFU,OAAO,gCAAgC,EAAE,OAAO,CAExB;IAGpC;;;;;OAKG;IACH,mBAJW,OAAO,aAAa,EAAE,KAAK,GAC1B,QAAQ,MAAM,OAAO,YAAY,EAAE,WAAW,CAAC,CAAC,CAK3D;IAED;;;OAGG;IACH,eAHW,OAAO,aAAa,EAAE,KAAK,GAC1B,iBAAiB,GAAC,UAAU,GAAC,YAAY,GAAC,QAAQ,GAAC,IAAI,CAIlE;IAED;;;;;OAKG;IACH,yBAHW,OAAO,WAAW,EAAE,UAAU,GAC7B,OAAO,CAIlB;IAED;;;;;;OAMG;IACH,wBAJW,OAAO,WAAW,EAAE,UAAU,UAC9B,WAAW,GAAC,IAAI,GACf,WAAW,GAAC,IAAI,CAI3B;IAED;;;;;OAKG;IACH;YALkB,MAAM;gBAAS,MAAM,GAAE,OAAO,YAAY,EAAE,OAAO;;aAC1D,MAAM,QACN,OAAO,YAAY,EAAE,OAAO,GAC3B,OAAO,GAAC,IAAI,CAQvB;IAED;;;;;;;;OAQG;IACH,yCAPW,OAAO,mBAAmB,EAAE,OAAO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O,GAAC,IAAI,CAQvB;IAED;;;;;;;;OAQG;IACH,yCAPW,OAAO,mBAAmB,EAAE,OAAO,cACnC,OAAO,uBAAuB,EAAE,OAAO;YAChC,MAAM;gBAAS,MAAM,GAAE,OAAO,YAAY,EAAE,OAAO;;eAChD,MAAM,QAAE,OAAO,iBAAiB,EAAE,OAAO,KAAE,OAAO,CAgBtE;IACD;;;;;;;;;OASG;IACH,0CARW,OAAO,kBAAkB,EAAE,UAAU,cACrC,OAAO,WAAW,EAAE,UAAU,gBAC9B,MAAM,gHAchB;IAED;;OAEG;IACH,YAFY,SAAS,CAIpB;IAED;;;OAGG;IACH,2BAAuB;IAEvB;;;;OAIG;IACH,2BAQC;IAED;;;;;;OAMG;IACH,2BAJW,OAAO,aAAa,EAAE,OAAO,GAC5B,OAAO,CAalB;IAED;;OAEG;IACH,0CAKC;CASF;uBAjMsB,kBAAkB"}
|
package/renderer/Layer.js
CHANGED
|
@@ -163,7 +163,7 @@ class LayerRenderer extends Observable {
|
|
|
163
163
|
/**
|
|
164
164
|
* Load the image if not already loaded, and register the image change
|
|
165
165
|
* listener if needed.
|
|
166
|
-
* @param {import("../
|
|
166
|
+
* @param {import("../Image.js").default} image Image.
|
|
167
167
|
* @return {boolean} `true` if the image is already loaded, `false` otherwise.
|
|
168
168
|
* @protected
|
|
169
169
|
*/
|
|
@@ -11,13 +11,13 @@ declare class CanvasImageLayerRenderer extends CanvasLayerRenderer<any> {
|
|
|
11
11
|
constructor(imageLayer: import("../../layer/Image.js").default<any>);
|
|
12
12
|
/**
|
|
13
13
|
* @protected
|
|
14
|
-
* @type {?import("../../
|
|
14
|
+
* @type {?import("../../Image.js").default}
|
|
15
15
|
*/
|
|
16
|
-
protected image_: import("../../
|
|
16
|
+
protected image_: import("../../Image.js").default | null;
|
|
17
17
|
/**
|
|
18
|
-
* @return {
|
|
18
|
+
* @return {import('../../DataTile.js').ImageLike} Image.
|
|
19
19
|
*/
|
|
20
|
-
getImage():
|
|
20
|
+
getImage(): import('../../DataTile.js').ImageLike;
|
|
21
21
|
/**
|
|
22
22
|
* @param {import("../../pixel.js").Pixel} pixel Pixel.
|
|
23
23
|
* @return {Uint8ClampedArray} Data at the pixel location.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageLayer.d.ts","sourceRoot":"","sources":["ImageLayer.js"],"names":[],"mappings":";AAuBA;;;;GAIG;AACH;IACE;;OAEG;IACH,qEAQC;IALC;;;OAGG;IACH,kBAFW,OAAO,
|
|
1
|
+
{"version":3,"file":"ImageLayer.d.ts","sourceRoot":"","sources":["ImageLayer.js"],"names":[],"mappings":";AAuBA;;;;GAIG;AACH;IACE;;OAEG;IACH,qEAQC;IALC;;;OAGG;IACH,kBAFW,OAAO,gBAAgB,EAAE,OAAO,QAEzB;IAGpB;;OAEG;IACH,YAFY,OAAO,mBAAmB,EAAE,SAAS,CAIhD;IAqDD;;;OAGG;IACH,eAHW,OAAO,gBAAgB,EAAE,KAAK,GAC7B,iBAAiB,CAyC5B;IAED;;;;;OAKG;IACH,wBAJW,OAAO,cAAc,EAAE,UAAU,UACjC,WAAW,GACV,WAAW,CAsHtB;CACF;gCAzQ+B,YAAY"}
|
|
@@ -35,16 +35,16 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @protected
|
|
38
|
-
* @type {?import("../../
|
|
38
|
+
* @type {?import("../../Image.js").default}
|
|
39
39
|
*/
|
|
40
40
|
this.image_ = null;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* @return {
|
|
44
|
+
* @return {import('../../DataTile.js').ImageLike} Image.
|
|
45
45
|
*/
|
|
46
46
|
getImage() {
|
|
47
|
-
return this.image_ ? this.image_.getImage()
|
|
47
|
+
return !this.image_ ? null : this.image_.getImage();
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -122,7 +122,7 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
const imageExtent = this.image_.getExtent();
|
|
125
|
-
const img = this.getImage();
|
|
125
|
+
const img = this.image_.getImage();
|
|
126
126
|
|
|
127
127
|
const imageMapWidth = getWidth(imageExtent);
|
|
128
128
|
const col = Math.floor(
|
|
@@ -153,14 +153,19 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
153
153
|
const image = this.image_;
|
|
154
154
|
const imageExtent = image.getExtent();
|
|
155
155
|
const imageResolution = image.getResolution();
|
|
156
|
+
const [imageResolutionX, imageResolutionY] = Array.isArray(imageResolution)
|
|
157
|
+
? imageResolution
|
|
158
|
+
: [imageResolution, imageResolution];
|
|
156
159
|
const imagePixelRatio = image.getPixelRatio();
|
|
157
160
|
const layerState = frameState.layerStatesArray[frameState.layerIndex];
|
|
158
161
|
const pixelRatio = frameState.pixelRatio;
|
|
159
162
|
const viewState = frameState.viewState;
|
|
160
163
|
const viewCenter = viewState.center;
|
|
161
164
|
const viewResolution = viewState.resolution;
|
|
162
|
-
const
|
|
163
|
-
(pixelRatio *
|
|
165
|
+
const scaleX =
|
|
166
|
+
(pixelRatio * imageResolutionX) / (viewResolution * imagePixelRatio);
|
|
167
|
+
const scaleY =
|
|
168
|
+
(pixelRatio * imageResolutionY) / (viewResolution * imagePixelRatio);
|
|
164
169
|
|
|
165
170
|
const extent = frameState.extent;
|
|
166
171
|
const resolution = viewState.resolution;
|
|
@@ -211,20 +216,20 @@ class CanvasImageLayerRenderer extends CanvasLayerRenderer {
|
|
|
211
216
|
}
|
|
212
217
|
}
|
|
213
218
|
|
|
214
|
-
const img =
|
|
219
|
+
const img = image.getImage();
|
|
215
220
|
|
|
216
221
|
const transform = composeTransform(
|
|
217
222
|
this.tempTransform,
|
|
218
223
|
width / 2,
|
|
219
224
|
height / 2,
|
|
220
|
-
|
|
221
|
-
|
|
225
|
+
scaleX,
|
|
226
|
+
scaleY,
|
|
222
227
|
0,
|
|
223
|
-
(imagePixelRatio * (imageExtent[0] - viewCenter[0])) /
|
|
224
|
-
(imagePixelRatio * (viewCenter[1] - imageExtent[3])) /
|
|
228
|
+
(imagePixelRatio * (imageExtent[0] - viewCenter[0])) / imageResolutionX,
|
|
229
|
+
(imagePixelRatio * (viewCenter[1] - imageExtent[3])) / imageResolutionY
|
|
225
230
|
);
|
|
226
231
|
|
|
227
|
-
this.renderedResolution = (
|
|
232
|
+
this.renderedResolution = (imageResolutionY * pixelRatio) / imagePixelRatio;
|
|
228
233
|
|
|
229
234
|
const dw = img.width * transform[0];
|
|
230
235
|
const dh = img.height * transform[3];
|
|
@@ -59,12 +59,12 @@ declare class CanvasLayerRenderer<LayerType extends import("../../layer/Layer.js
|
|
|
59
59
|
*/
|
|
60
60
|
protected frameState: import("../../Map.js").FrameState | null;
|
|
61
61
|
/**
|
|
62
|
-
* @param {
|
|
62
|
+
* @param {import('../../DataTile.js').ImageLike} image Image.
|
|
63
63
|
* @param {number} col The column index.
|
|
64
64
|
* @param {number} row The row index.
|
|
65
65
|
* @return {Uint8ClampedArray|null} The image data.
|
|
66
66
|
*/
|
|
67
|
-
getImageData(image:
|
|
67
|
+
getImageData(image: import('../../DataTile.js').ImageLike, col: number, row: number): Uint8ClampedArray | null;
|
|
68
68
|
/**
|
|
69
69
|
* @param {import('../../Map.js').FrameState} frameState Frame state.
|
|
70
70
|
* @return {string} Background color.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Layer.d.ts","sourceRoot":"","sources":["Layer.js"],"names":[],"mappings":"AAqBA;;GAEG;AACH,yBAFU,MAAM,iBAAiB,CAAC,CAEL;;AAa7B;;;;GAIG;AACH;IAOI;;;OAGG;IACH,qBAFU,WAAW,CAEA;IAErB;;;OAGG;IACH,8BAFU,MAAM,CAEO;IAEvB;;;;;OAKG;IACH,yBAFU,OAAO,oBAAoB,EAAE,SAAS,CAEV;IAEtC;;;;;OAKG;IACH,0BAFU,OAAO,oBAAoB,EAAE,SAA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C;IAED;;;;OAIG;IACH,6BAJW,wBAAwB,cACxB,OAAO,cAAc,EAAE,UAAU,QAM3C;IAED;;;;OAIG;IACH,8BAJW,wBAAwB,cACxB,OAAO,cAAc,EAAE,UAAU,QAK3C;IAED;;;;;;;;;;;OAWG;IACH,qCAVW,OAAO,qBAAqB,EAAE,UAAU,cACxC,MAAM,YACN,MAAM,cACN,MAAM,SACN,MAAM,UACN,MAAM,WACN,MAAM,GAEJ,OAAO,oBAAoB,EAAE,SAAS,CA2BlD;CASF;0BAjUyB,aAAa"}
|
package/renderer/canvas/Layer.js
CHANGED
|
@@ -107,7 +107,7 @@ class CanvasLayerRenderer extends LayerRenderer {
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* @param {
|
|
110
|
+
* @param {import('../../DataTile.js').ImageLike} image Image.
|
|
111
111
|
* @param {number} col The column index.
|
|
112
112
|
* @param {number} row The row index.
|
|
113
113
|
* @return {Uint8ClampedArray|null} The image data.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorImageLayer.d.ts","sourceRoot":"","sources":["VectorImageLayer.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"VectorImageLayer.d.ts","sourceRoot":"","sources":["VectorImageLayer.js"],"names":[],"mappings":";AAcA;;;;GAIG;AACH;IACE;;OAEG;IACH,sEA0BC;IAvBC;;;OAGG;IACH,wBAA2D;IAE3D;;;OAGG;IACH,yBAA6C;IAE7C;;;OAGG;IACH,0CAAiD;IAEjD;;;OAGG;IACH,4CAA+C;IAWjD;;;;OAIG;IACH,mBAHW,OAAO,gBAAgB,EAAE,KAAK,GAC7B,QAAQ,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,CAAC,CAW1D;IAyGD;OACG;IACH,kBAAc;IAEd;OACG;IACH,mBAAe;IAEf;OACG;IACH,wBAAoB;CAmCrB;qCA5NoC,iBAAiB"}
|
|
@@ -9,6 +9,7 @@ import ImageState from '../../ImageState.js';
|
|
|
9
9
|
import RBush from 'rbush';
|
|
10
10
|
import ViewHint from '../../ViewHint.js';
|
|
11
11
|
import {apply, compose, create} from '../../transform.js';
|
|
12
|
+
import {fromResolutionLike} from '../../resolution.js';
|
|
12
13
|
import {getHeight, getWidth, isEmpty, scaleFromCenter} from '../../extent.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
@@ -148,10 +149,10 @@ class CanvasVectorImageLayerRenderer extends CanvasImageLayerRenderer {
|
|
|
148
149
|
return;
|
|
149
150
|
}
|
|
150
151
|
this.image_ = emptyImage ? null : image;
|
|
151
|
-
const imageResolution = image.getResolution();
|
|
152
152
|
const imagePixelRatio = image.getPixelRatio();
|
|
153
153
|
const renderedResolution =
|
|
154
|
-
(
|
|
154
|
+
(fromResolutionLike(image.getResolution()) * pixelRatio) /
|
|
155
|
+
imagePixelRatio;
|
|
155
156
|
this.renderedResolution = renderedResolution;
|
|
156
157
|
this.coordinateToVectorPixelTransform_ = compose(
|
|
157
158
|
this.coordinateToVectorPixelTransform_,
|
|
@@ -2,11 +2,10 @@ export const Uniforms: {
|
|
|
2
2
|
RENDER_EXTENT: string;
|
|
3
3
|
GLOBAL_ALPHA: string;
|
|
4
4
|
PROJECTION_MATRIX: string;
|
|
5
|
-
OFFSET_SCALE_MATRIX: string;
|
|
6
|
-
OFFSET_ROTATION_MATRIX: string;
|
|
7
5
|
TIME: string;
|
|
8
6
|
ZOOM: string;
|
|
9
7
|
RESOLUTION: string;
|
|
8
|
+
ROTATION: string;
|
|
10
9
|
VIEWPORT_SIZE_PX: string;
|
|
11
10
|
PIXEL_RATIO: string;
|
|
12
11
|
HIT_DETECTION: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["VectorLayer.js"],"names":[],"mappings":"AAuBA
|
|
1
|
+
{"version":3,"file":"VectorLayer.d.ts","sourceRoot":"","sources":["VectorLayer.js"],"names":[],"mappings":"AAuBA;;;;;;;;;;;EAIE;;0BAGW,OAAO,2CAA2C,EAAE,WAAW;;;;;;;;;WAM9D,WAAW,GAAC,MAAM,WAAW,CAAC;;;;;;AAP5C;;GAEG;AAEH;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH;IACE;;;OAGG;IACH,mBAHW,OAAO,sBAAsB,EAAE,OAAO,WACtC,OAAO,EAwFjB;IA3EC,wBAAyB;IAEzB,kDAAoC;IAEpC;;;;;;OAMG;IACH,0BAA0C;IAE1C,wBAAsC;IACtC,mBAA4B;IAE5B;;;OAGG;IACH,oCAAoD;IAEpD;;;OAGG;IACH,gBAAiB;IAEjB;;;OAGG;IACH,wBAAyB;IAEzB;;;OAGG;IACH,iBAAkB;IAIlB;;OAEG;IACH,eAAsC;IAItC,yDAyBC;IAGH;;;OAGG;IACH,sBAIC;IAED;;OAEG;IACH,yBAKC;IAED,0BAMC;IAMD;;;OAGG;IACH,kCAGC;IAED;;;OAGG;IACH,oCAGC;IAED;;;OAGG;IACH,mCAGC;IAED;;OAEG;IACH,kCAEC;IAED;;;OAGG;IACH,uBAQC;IAED;;;;OAIG;IACH,wBAHW,OAAO,cAAc,EAAE,UAAU,GAChC,WAAW,CAoDtB;CAkFF;+BAxW8B,YAAY"}
|
package/reproj/Image.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export default ReprojImage;
|
|
2
|
-
export type FunctionType = (arg0: import("../extent.js").Extent, arg1: number, arg2: number) => import("../
|
|
2
|
+
export type FunctionType = (arg0: import("../extent.js").Extent, arg1: number, arg2: number) => import("../Image.js").default;
|
|
3
3
|
/**
|
|
4
|
-
* @typedef {function(import("../extent.js").Extent, number, number) : import("../
|
|
4
|
+
* @typedef {function(import("../extent.js").Extent, number, number) : import("../Image.js").default} FunctionType
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* @classdesc
|
|
8
8
|
* Class encapsulating single reprojected image.
|
|
9
9
|
* See {@link module:ol/source/Image~ImageSource}.
|
|
10
10
|
*/
|
|
11
|
-
declare class ReprojImage extends
|
|
11
|
+
declare class ReprojImage extends ImageWrapper {
|
|
12
12
|
/**
|
|
13
13
|
* @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
|
|
14
14
|
* @param {import("../proj/Projection.js").default} targetProj Target projection.
|
|
@@ -47,7 +47,7 @@ declare class ReprojImage extends ImageBase {
|
|
|
47
47
|
private targetExtent_;
|
|
48
48
|
/**
|
|
49
49
|
* @private
|
|
50
|
-
* @type {import("../
|
|
50
|
+
* @type {import("../Image.js").default}
|
|
51
51
|
*/
|
|
52
52
|
private sourceImage_;
|
|
53
53
|
/**
|
|
@@ -87,5 +87,5 @@ declare class ReprojImage extends ImageBase {
|
|
|
87
87
|
*/
|
|
88
88
|
private unlistenSource_;
|
|
89
89
|
}
|
|
90
|
-
import
|
|
90
|
+
import ImageWrapper from '../Image.js';
|
|
91
91
|
//# sourceMappingURL=Image.d.ts.map
|
package/reproj/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":";kCAwBsB,OAAO,cAAc,EAAE,MAAM,QAAE,MAAM,QAAE,MAAM,KAAI,OAAO,aAAa,EAAE,OAAO;AADpG;;GAEG;AAEH;;;;GAIG;AACH;IACE;;;;;;;;;OASG;IACH,wBATW,OAAO,uBAAuB,EAAE,OAAO,cACvC,OAAO,uBAAuB,EAAE,OAAO,gBACvC,OAAO,cAAc,EAAE,MAAM,oBAC7B,MAAM,cACN,MAAM,oBACN,YAAY,eAEZ,OAAO,EAmHjB;IA3DC;;;OAGG;IACH,oBAA6B;IAE7B;;;OAGG;IACH,yBAAuC;IAEvC;;;OAGG;IACH,uBAAmC;IAEnC;;;OAGG;IACH,0BAAyC;IAEzC;;;OAGG;IACH,sBAAiC;IAEjC;;;OAGG;IACH,qBAA+B;IAE/B;;;OAGG;IACH,0BAAyC;IAEzC;;;OAGG;IACH,qBAA+B;IAE/B;;;OAGG;IACH,gBAAmB;IAEnB;;;OAGG;IACH,2BAA8B;IAahC;;OAEG;IACH,YAFY,iBAAiB,CAI5B;IAED;;OAEG;IACH,iBAFY,OAAO,uBAAuB,EAAE,OAAO,CAIlD;IAED;;OAEG;IACH,mBA2BC;IAkCD;;OAEG;IACH,wBAKC;CACF;yBAxPwB,aAAa"}
|
package/reproj/Image.js
CHANGED
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
import {ERROR_THRESHOLD} from './common.js';
|
|
5
5
|
|
|
6
6
|
import EventType from '../events/EventType.js';
|
|
7
|
-
import ImageBase from '../ImageBase.js';
|
|
8
7
|
import ImageState from '../ImageState.js';
|
|
8
|
+
import ImageWrapper from '../Image.js';
|
|
9
9
|
import Triangulation from './Triangulation.js';
|
|
10
10
|
import {
|
|
11
11
|
calculateSourceResolution,
|
|
12
12
|
render as renderReprojected,
|
|
13
13
|
} from '../reproj.js';
|
|
14
|
+
import {fromResolutionLike} from '../resolution.js';
|
|
14
15
|
import {
|
|
15
16
|
getCenter,
|
|
16
17
|
getHeight,
|
|
@@ -21,7 +22,7 @@ import {
|
|
|
21
22
|
import {listen, unlistenByKey} from '../events.js';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
|
-
* @typedef {function(import("../extent.js").Extent, number, number) : import("../
|
|
25
|
+
* @typedef {function(import("../extent.js").Extent, number, number) : import("../Image.js").default} FunctionType
|
|
25
26
|
*/
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -29,7 +30,7 @@ import {listen, unlistenByKey} from '../events.js';
|
|
|
29
30
|
* Class encapsulating single reprojected image.
|
|
30
31
|
* See {@link module:ol/source/Image~ImageSource}.
|
|
31
32
|
*/
|
|
32
|
-
class ReprojImage extends
|
|
33
|
+
class ReprojImage extends ImageWrapper {
|
|
33
34
|
/**
|
|
34
35
|
* @param {import("../proj/Projection.js").default} sourceProj Source projection (of the data).
|
|
35
36
|
* @param {import("../proj/Projection.js").default} targetProj Target projection.
|
|
@@ -126,7 +127,7 @@ class ReprojImage extends ImageBase {
|
|
|
126
127
|
|
|
127
128
|
/**
|
|
128
129
|
* @private
|
|
129
|
-
* @type {import("../
|
|
130
|
+
* @type {import("../Image.js").default}
|
|
130
131
|
*/
|
|
131
132
|
this.sourceImage_ = sourceImage;
|
|
132
133
|
|
|
@@ -187,12 +188,11 @@ class ReprojImage extends ImageBase {
|
|
|
187
188
|
if (sourceState == ImageState.LOADED) {
|
|
188
189
|
const width = getWidth(this.targetExtent_) / this.targetResolution_;
|
|
189
190
|
const height = getHeight(this.targetExtent_) / this.targetResolution_;
|
|
190
|
-
|
|
191
191
|
this.canvas_ = renderReprojected(
|
|
192
192
|
width,
|
|
193
193
|
height,
|
|
194
194
|
this.sourcePixelRatio_,
|
|
195
|
-
this.sourceImage_.getResolution(),
|
|
195
|
+
fromResolutionLike(this.sourceImage_.getResolution()),
|
|
196
196
|
this.maxSourceExtent_,
|
|
197
197
|
this.targetResolution_,
|
|
198
198
|
this.targetExtent_,
|
package/reproj.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export function calculateSourceExtentResolution(sourceProj: import("./proj/Proje
|
|
|
27
27
|
/**
|
|
28
28
|
* @typedef {Object} ImageExtent
|
|
29
29
|
* @property {import("./extent.js").Extent} extent Extent.
|
|
30
|
-
* @property {
|
|
30
|
+
* @property {import('./DataTile.js').ImageLike} image Image.
|
|
31
31
|
*/
|
|
32
32
|
/**
|
|
33
33
|
* Renders the source data into new canvas based on the triangulation.
|
|
@@ -59,6 +59,6 @@ export type ImageExtent = {
|
|
|
59
59
|
/**
|
|
60
60
|
* Image.
|
|
61
61
|
*/
|
|
62
|
-
image:
|
|
62
|
+
image: import('./DataTile.js').ImageLike;
|
|
63
63
|
};
|
|
64
64
|
//# sourceMappingURL=reproj.d.ts.map
|
package/reproj.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reproj.d.ts","sourceRoot":"","sources":["reproj.js"],"names":[],"mappings":"AA2FA;;;;;;;;;;;GAWG;AACH,sDANW,OAAO,sBAAsB,EAAE,OAAO,cACtC,OAAO,sBAAsB,EAAE,OAAO,gBACtC,OAAO,iBAAiB,EAAE,UAAU,oBACpC,MAAM,GACL,MAAM,CAyCjB;AAED;;;;;;;;;;;GAWG;AACH,4DANW,OAAO,sBAAsB,EAAE,OAAO,cACtC,OAAO,sBAAsB,EAAE,OAAO,gBACtC,OAAO,aAAa,EAAE,MAAM,oBAC5B,MAAM,GACL,MAAM,CA6BjB;AAED;;;;GAIG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,8BAdW,MAAM,UACN,MAAM,cACN,MAAM,oBACN,MAAM,gBACN,OAAO,aAAa,EAAE,MAAM,oBAC5B,MAAM,gBACN,OAAO,aAAa,EAAE,MAAM,iBAC5B,OAAO,2BAA2B,EAAE,OAAO,WAC3C,MAAM,WAAW,CAAC,UAClB,MAAM,yEAGL,iBAAiB,CA0O5B;AAraD;;GAEG;AACH,yBAFU,MAAM,iBAAiB,CAAC,CAEL;;;;;YAqKf,OAAO,aAAa,EAAE,MAAM;;;;WAC5B,
|
|
1
|
+
{"version":3,"file":"reproj.d.ts","sourceRoot":"","sources":["reproj.js"],"names":[],"mappings":"AA2FA;;;;;;;;;;;GAWG;AACH,sDANW,OAAO,sBAAsB,EAAE,OAAO,cACtC,OAAO,sBAAsB,EAAE,OAAO,gBACtC,OAAO,iBAAiB,EAAE,UAAU,oBACpC,MAAM,GACL,MAAM,CAyCjB;AAED;;;;;;;;;;;GAWG;AACH,4DANW,OAAO,sBAAsB,EAAE,OAAO,cACtC,OAAO,sBAAsB,EAAE,OAAO,gBACtC,OAAO,aAAa,EAAE,MAAM,oBAC5B,MAAM,GACL,MAAM,CA6BjB;AAED;;;;GAIG;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,8BAdW,MAAM,UACN,MAAM,cACN,MAAM,oBACN,MAAM,gBACN,OAAO,aAAa,EAAE,MAAM,oBAC5B,MAAM,gBACN,OAAO,aAAa,EAAE,MAAM,iBAC5B,OAAO,2BAA2B,EAAE,OAAO,WAC3C,MAAM,WAAW,CAAC,UAClB,MAAM,yEAGL,iBAAiB,CA0O5B;AAraD;;GAEG;AACH,yBAFU,MAAM,iBAAiB,CAAC,CAEL;;;;;YAqKf,OAAO,aAAa,EAAE,MAAM;;;;WAC5B,OAAO,eAAe,EAAE,SAAS"}
|
package/reproj.js
CHANGED
|
@@ -186,7 +186,7 @@ export function calculateSourceExtentResolution(
|
|
|
186
186
|
/**
|
|
187
187
|
* @typedef {Object} ImageExtent
|
|
188
188
|
* @property {import("./extent.js").Extent} extent Extent.
|
|
189
|
-
* @property {
|
|
189
|
+
* @property {import('./DataTile.js').ImageLike} image Image.
|
|
190
190
|
*/
|
|
191
191
|
|
|
192
192
|
/**
|
package/resolution.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ol/resolution
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {number|Array<number>} ResolutionLike
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* @param {ResolutionLike} resolution Resolution.
|
|
9
|
+
* @return {number} Resolution.
|
|
10
|
+
*/
|
|
11
|
+
export function fromResolutionLike(resolution: ResolutionLike): number;
|
|
12
|
+
export type ResolutionLike = number | Array<number>;
|
|
13
|
+
//# sourceMappingURL=resolution.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolution.d.ts","sourceRoot":"","sources":["resolution.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AAEH;;;GAGG;AACH,+CAHW,cAAc,GACb,MAAM,CAOjB;6BAZY,MAAM,GAAC,MAAM,MAAM,CAAC"}
|
package/resolution.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ol/resolution
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {number|Array<number>} ResolutionLike
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {ResolutionLike} resolution Resolution.
|
|
11
|
+
* @return {number} Resolution.
|
|
12
|
+
*/
|
|
13
|
+
export function fromResolutionLike(resolution) {
|
|
14
|
+
if (Array.isArray(resolution)) {
|
|
15
|
+
return Math.min(...resolution);
|
|
16
|
+
}
|
|
17
|
+
return resolution;
|
|
18
|
+
}
|
package/source/Image.d.ts
CHANGED
|
@@ -5,6 +5,15 @@
|
|
|
5
5
|
* @param {string} src Source.
|
|
6
6
|
*/
|
|
7
7
|
export function defaultImageLoadFunction(image: import("../Image.js").default, src: string): void;
|
|
8
|
+
/**
|
|
9
|
+
* Adjusts the extent so it aligns with pixel boundaries.
|
|
10
|
+
* @param {import("../extent.js").Extent} extent Extent.
|
|
11
|
+
* @param {number} resolution Reolution.
|
|
12
|
+
* @param {number} pixelRatio Pixel ratio.
|
|
13
|
+
* @param {number} ratio Ratio between request size and view size.
|
|
14
|
+
* @return {import("../extent.js").Extent} Request extent.
|
|
15
|
+
*/
|
|
16
|
+
export function getRequestExtent(extent: import("../extent.js").Extent, resolution: number, pixelRatio: number, ratio: number): import("../extent.js").Extent;
|
|
8
17
|
export type ImageSourceEventType = string;
|
|
9
18
|
export namespace ImageSourceEventType {
|
|
10
19
|
let IMAGELOADSTART: string;
|
|
@@ -48,6 +57,13 @@ export type Options = {
|
|
|
48
57
|
* linear interpolation is used when resampling. Set to false to use the nearest neighbor instead.
|
|
49
58
|
*/
|
|
50
59
|
interpolate?: boolean | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Loader. Can either be a custom loader, or one of the
|
|
62
|
+
* loaders created with a `createLoader()` function ({@link module :ol/source/wms.createLoader wms},
|
|
63
|
+
* {@link module :ol/source/arcgisRest.createLoader arcgisRest}, {@link module :ol/source/mapguide.createLoader mapguide},
|
|
64
|
+
* {@link module :ol/source/static.createLoader static}).
|
|
65
|
+
*/
|
|
66
|
+
loader?: import("../Image.js").Loader | undefined;
|
|
51
67
|
/**
|
|
52
68
|
* Projection.
|
|
53
69
|
*/
|
|
@@ -75,16 +91,17 @@ import Event from '../events/Event.js';
|
|
|
75
91
|
* @property {import("./Source.js").AttributionLike} [attributions] Attributions.
|
|
76
92
|
* @property {boolean} [interpolate=true] Use interpolated values when resampling. By default,
|
|
77
93
|
* linear interpolation is used when resampling. Set to false to use the nearest neighbor instead.
|
|
94
|
+
* @property {import("../Image.js").Loader} [loader] Loader. Can either be a custom loader, or one of the
|
|
95
|
+
* loaders created with a `createLoader()` function ({@link module:ol/source/wms.createLoader wms},
|
|
96
|
+
* {@link module:ol/source/arcgisRest.createLoader arcgisRest}, {@link module:ol/source/mapguide.createLoader mapguide},
|
|
97
|
+
* {@link module:ol/source/static.createLoader static}).
|
|
78
98
|
* @property {import("../proj.js").ProjectionLike} [projection] Projection.
|
|
79
99
|
* @property {Array<number>} [resolutions] Resolutions.
|
|
80
100
|
* @property {import("./Source.js").State} [state] State.
|
|
81
101
|
*/
|
|
82
102
|
/**
|
|
83
103
|
* @classdesc
|
|
84
|
-
* Abstract base class; normally only used for creating subclasses and not
|
|
85
|
-
* instantiated in apps.
|
|
86
104
|
* Base class for sources providing a single image.
|
|
87
|
-
* @abstract
|
|
88
105
|
* @fires module:ol/source/Image.ImageSourceEvent
|
|
89
106
|
* @api
|
|
90
107
|
*/
|
|
@@ -105,6 +122,11 @@ declare class ImageSource extends Source {
|
|
|
105
122
|
* @type {ImageSourceOnSignature<void>}
|
|
106
123
|
*/
|
|
107
124
|
un: ImageSourceOnSignature<void>;
|
|
125
|
+
/**
|
|
126
|
+
* @protected
|
|
127
|
+
* @type {import("../Image.js").Loader}
|
|
128
|
+
*/
|
|
129
|
+
protected loader: import("../Image.js").Loader;
|
|
108
130
|
/**
|
|
109
131
|
* @private
|
|
110
132
|
* @type {Array<number>|null}
|
|
@@ -120,6 +142,21 @@ declare class ImageSource extends Source {
|
|
|
120
142
|
* @type {number}
|
|
121
143
|
*/
|
|
122
144
|
private reprojectedRevision_;
|
|
145
|
+
/**
|
|
146
|
+
* @protected
|
|
147
|
+
* @type {import("../Image.js").default}
|
|
148
|
+
*/
|
|
149
|
+
protected image: import("../Image.js").default;
|
|
150
|
+
/**
|
|
151
|
+
* @private
|
|
152
|
+
* @type {import("../extent.js").Extent}
|
|
153
|
+
*/
|
|
154
|
+
private wantedExtent_;
|
|
155
|
+
/**
|
|
156
|
+
* @private
|
|
157
|
+
* @type {number}
|
|
158
|
+
*/
|
|
159
|
+
private wantedResolution_;
|
|
123
160
|
/**
|
|
124
161
|
* @return {Array<number>|null} Resolutions.
|
|
125
162
|
*/
|
|
@@ -139,19 +176,19 @@ declare class ImageSource extends Source {
|
|
|
139
176
|
* @param {number} resolution Resolution.
|
|
140
177
|
* @param {number} pixelRatio Pixel ratio.
|
|
141
178
|
* @param {import("../proj/Projection.js").default} projection Projection.
|
|
142
|
-
* @return {import("../
|
|
179
|
+
* @return {import("../Image.js").default} Single image.
|
|
143
180
|
*/
|
|
144
|
-
getImage(extent: import("../extent.js").Extent, resolution: number, pixelRatio: number, projection: import("../proj/Projection.js").default): import("../
|
|
181
|
+
getImage(extent: import("../extent.js").Extent, resolution: number, pixelRatio: number, projection: import("../proj/Projection.js").default): import("../Image.js").default;
|
|
145
182
|
/**
|
|
146
183
|
* @abstract
|
|
147
184
|
* @param {import("../extent.js").Extent} extent Extent.
|
|
148
185
|
* @param {number} resolution Resolution.
|
|
149
186
|
* @param {number} pixelRatio Pixel ratio.
|
|
150
187
|
* @param {import("../proj/Projection.js").default} projection Projection.
|
|
151
|
-
* @return {import("../
|
|
188
|
+
* @return {import("../Image.js").default} Single image.
|
|
152
189
|
* @protected
|
|
153
190
|
*/
|
|
154
|
-
protected getImageInternal(extent: import("../extent.js").Extent, resolution: number, pixelRatio: number, projection: import("../proj/Projection.js").default): import("../
|
|
191
|
+
protected getImageInternal(extent: import("../extent.js").Extent, resolution: number, pixelRatio: number, projection: import("../proj/Projection.js").default): import("../Image.js").default;
|
|
155
192
|
/**
|
|
156
193
|
* Handle image change events.
|
|
157
194
|
* @param {import("../events/Event.js").default} event Event.
|
package/source/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":"AAoUA;;;;;GAKG;AACH,gDAHW,OAAO,aAAa,EAAE,OAAO,OAC7B,MAAM,QAIhB;AAED;;;;;;;GAOG;AACH,yCANW,OAAO,cAAc,EAAE,MAAM,cAC7B,MAAM,cACN,MAAM,SACN,MAAM,GACL,OAAO,cAAc,EAAE,MAAM,CAexC;mCA3US,MAAM;;;;;;AAyBhB;;GAEG;AAEH;;;;GAIG;AACH;IACE;;;OAGG;IACH,kBAHW,MAAM,SACN,OAAO,aAAa,EAAE,OAAO,EAWvC;IANC;;;;OAIG;IACH,OAHU,OAAO,aAAa,EAAE,OAAO,CAGrB;CAErB;;oCAvBY,cAAc,GAAC,gBAAgB,GAAC,gBAAgB;;;;6CA2BhD,OAAO,eAAe,EAAE,WAAW,CAAC,OAAO,eAAe,EAAE,UAAU,EAAE,OAAO,oBAAoB,EAAE,OAAO,EAAE,MAAM,CAAC,GACjI,OAAW,eAAe,EAAE,WAAW,CAAC,OAAO,oBAAoB,EAAE,KAAK,EAAE,OAAO,WAAW,EAAE,WAAW,EAAE,MAAM,CAAC,GACpH,OAAW,eAAe,EAAE,WAAW,CAAC,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,CAAC,GACxF,OAAW,eAAe,EAAE,mBAAmB,CAAC,OAAO,eAAe,EAAE,UAAU,GAAC,OAAO,oBAAoB,EAAE,KAAK,GAC9G,qBAAqB,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;iBAY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