mobility-toolbox-js 3.1.0-beta.0 → 3.1.0-beta.2

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.
@@ -28,7 +28,10 @@ const renderTrajectories = (canvas, trajectories, style, viewState, options) =>
28
28
  const context = canvas.getContext('2d');
29
29
  context === null || context === void 0 ? void 0 : context.clearRect(0, 0, canvas.width, canvas.height);
30
30
  const [width, height] = size;
31
- if (width && height && (canvas.width !== width || canvas.height !== height)) {
31
+ if (width &&
32
+ height &&
33
+ (canvas.width !== width * pixelRatio ||
34
+ canvas.height !== height * pixelRatio)) {
32
35
  [canvas.width, canvas.height] = [width * pixelRatio, height * pixelRatio];
33
36
  }
34
37
  const coordinateToPixelTransform = compose(create(), size[0] / 2, size[1] / 2, 1 / resolution, -1 / resolution, -rotation, -center[0], -center[1]);
package/mbt.js CHANGED
@@ -25318,7 +25318,7 @@ uniform ${i3} ${a3} u_${s3};
25318
25318
  const context = canvas2.getContext("2d");
25319
25319
  context?.clearRect(0, 0, canvas2.width, canvas2.height);
25320
25320
  const [width, height] = size;
25321
- if (width && height && (canvas2.width !== width || canvas2.height !== height)) {
25321
+ if (width && height && (canvas2.width !== width * pixelRatio || canvas2.height !== height * pixelRatio)) {
25322
25322
  [canvas2.width, canvas2.height] = [width * pixelRatio, height * pixelRatio];
25323
25323
  }
25324
25324
  const coordinateToPixelTransform = compose(
@@ -45633,15 +45633,16 @@ uniform ${i3} ${a3} u_${s3};
45633
45633
  const layer = this.getLayer();
45634
45634
  const { mapLibreMap } = layer;
45635
45635
  const map = layer.getMapInternal();
45636
- this.getLayer()?.mapLibreMap?.off("idle", this.setIsReady);
45637
45636
  if (!layer || !map || !mapLibreMap) {
45638
45637
  return null;
45639
45638
  }
45640
- if (this.ignoreNextRender) {
45639
+ if (this.ready && this.ignoreNextRender) {
45641
45640
  this.ignoreNextRender = false;
45642
45641
  return mapLibreMap?.getContainer();
45643
45642
  }
45644
45643
  this.ready = false;
45644
+ this.ignoreNextRender = false;
45645
+ this.updateReadyState();
45645
45646
  const container = super.renderFrame(frameState);
45646
45647
  mapLibreMap?.once("idle", this.setIsReady);
45647
45648
  return container;
@@ -45653,6 +45654,10 @@ uniform ${i3} ${a3} u_${s3};
45653
45654
  this.getLayer().changed();
45654
45655
  }
45655
45656
  }
45657
+ updateReadyState() {
45658
+ this.getLayer()?.mapLibreMap?.off("idle", this.setIsReady);
45659
+ this.getLayer()?.mapLibreMap?.once("idle", this.setIsReady);
45660
+ }
45656
45661
  };
45657
45662
 
45658
45663
  // src/ol/utils/defineDeprecatedProperties.ts