@carto/ps-react-maps 4.7.1 → 4.7.3

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/dist/index.js CHANGED
@@ -611,16 +611,19 @@ const gA = /* @__PURE__ */ d0(w0), y0 = (t) => {
611
611
  return ((e, r) => ({
612
612
  viewports: A.viewports,
613
613
  initialViewStates: A.initialViewStates,
614
- updateViewPort: (n) => {
615
- const i = r();
616
- if (!i.maps[n]?.isLoaded) return;
617
- const o = i.getViewState(n);
618
- if (!o) return;
619
- const s = new xe(o);
620
- e((a) => ({
614
+ updateViewPort: (n, i) => {
615
+ const o = r();
616
+ if (!o.maps[n]?.isLoaded) return;
617
+ const s = {
618
+ ...o.getViewState(n),
619
+ ...i
620
+ };
621
+ if (!s) return;
622
+ const a = new xe(s);
623
+ e((l) => ({
621
624
  viewports: {
622
- ...a.viewports,
623
- [n]: s
625
+ ...l.viewports,
626
+ [n]: a
624
627
  }
625
628
  }));
626
629
  },
@@ -671,7 +674,7 @@ const gA = /* @__PURE__ */ d0(w0), y0 = (t) => {
671
674
  }, E0 = ((t, A) => ({
672
675
  fitBounds: (e, r, n) => {
673
676
  const i = A(), o = i.getBounds(e, r, n);
674
- o && (i.setViewState(e, o), i.updateViewPort(e));
677
+ o && (i.setViewState(e, o), i.updateViewPort(e, o));
675
678
  },
676
679
  flyTo: (e, r, n = {}) => {
677
680
  const i = A(), o = {
@@ -681,7 +684,7 @@ const gA = /* @__PURE__ */ d0(w0), y0 = (t) => {
681
684
  ...r,
682
685
  ...o
683
686
  };
684
- i.setViewState(e, s), i.updateViewPort(e);
687
+ i.setViewState(e, s), i.updateViewPort(e, s);
685
688
  },
686
689
  loadInitialViewState: (e, r) => {
687
690
  const n = A();