ol 9.0.0-dev.1700808582895 → 9.0.0-dev.1700871410133

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ol",
3
- "version": "9.0.0-dev.1700808582895",
3
+ "version": "9.0.0-dev.1700871410133",
4
4
  "description": "OpenLayers mapping library",
5
5
  "keywords": [
6
6
  "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;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAfW,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,2GAIL,iBAAiB,CA2P5B;AAvbD;;GAEG;AACH,yBAFU,MAAM,iBAAiB,CAAC,CAEL;;;;;YAqKf,OAAO,aAAa,EAAE,MAAM;;;;WAC5B,OAAO,eAAe,EAAE,SAAS"}
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;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAfW,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,2GAIL,iBAAiB,CA4P5B;AAxbD;;GAEG;AACH,yBAFU,MAAM,iBAAiB,CAAC,CAEL;;;;;YAqKf,OAAO,aAAa,EAAE,MAAM;;;;WAC5B,OAAO,eAAe,EAAE,SAAS"}
package/reproj.js CHANGED
@@ -250,12 +250,14 @@ export function render(
250
250
  });
251
251
 
252
252
  let stitchContext;
253
+ const stitchScale = pixelRatio / sourceResolution;
254
+ // Round up Float32 scale values to prevent interpolation in Firefox.
255
+ const inverseScale = (interpolate ? 1 : 1 + Math.pow(2, -24)) / stitchScale;
256
+
253
257
  if (!drawSingle || sources.length !== 1 || gutter !== 0) {
254
- const canvasWidthInUnits = getWidth(sourceDataExtent);
255
- const canvasHeightInUnits = getHeight(sourceDataExtent);
256
258
  stitchContext = createCanvasContext2D(
257
- Math.round((pixelRatio * canvasWidthInUnits) / sourceResolution),
258
- Math.round((pixelRatio * canvasHeightInUnits) / sourceResolution),
259
+ Math.round(getWidth(sourceDataExtent) * stitchScale),
260
+ Math.round(getHeight(sourceDataExtent) * stitchScale),
259
261
  canvasPool
260
262
  );
261
263
 
@@ -263,13 +265,11 @@ export function render(
263
265
  stitchContext.imageSmoothingEnabled = false;
264
266
  }
265
267
 
266
- const stitchScale = pixelRatio / sourceResolution;
267
-
268
268
  sources.forEach(function (src, i, arr) {
269
- const xPos = src.extent[0] - sourceDataExtent[0];
270
- const yPos = -(src.extent[3] - sourceDataExtent[3]);
271
- const srcWidth = getWidth(src.extent);
272
- const srcHeight = getHeight(src.extent);
269
+ const xPos = (src.extent[0] - sourceDataExtent[0]) * stitchScale;
270
+ const yPos = -(src.extent[3] - sourceDataExtent[3]) * stitchScale;
271
+ const srcWidth = getWidth(src.extent) * stitchScale;
272
+ const srcHeight = getHeight(src.extent) * stitchScale;
273
273
 
274
274
  // This test should never fail -- but it does. Need to find a fix the upstream condition
275
275
  if (src.image.width > 0 && src.image.height > 0) {
@@ -279,10 +279,14 @@ export function render(
279
279
  gutter,
280
280
  src.image.width - 2 * gutter,
281
281
  src.image.height - 2 * gutter,
282
- xPos * stitchScale,
283
- yPos * stitchScale,
284
- srcWidth * stitchScale,
285
- srcHeight * stitchScale
282
+ interpolate ? xPos : Math.round(xPos),
283
+ interpolate ? yPos : Math.round(yPos),
284
+ interpolate
285
+ ? srcWidth
286
+ : Math.round(xPos + srcWidth) - Math.round(xPos),
287
+ interpolate
288
+ ? srcHeight
289
+ : Math.round(yPos + srcHeight) - Math.round(yPos)
286
290
  );
287
291
  }
288
292
  });
@@ -406,10 +410,7 @@ export function render(
406
410
  let image;
407
411
  if (stitchContext) {
408
412
  image = stitchContext.canvas;
409
- context.scale(
410
- sourceResolution / pixelRatio,
411
- -sourceResolution / pixelRatio
412
- );
413
+ context.scale(inverseScale, -inverseScale);
413
414
  } else {
414
415
  const source = sources[0];
415
416
  const extent = source.extent;
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.0.0-dev.1700808582895';
36
+ export const VERSION = '9.0.0-dev.1700871410133';