@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 +14 -11
- package/dist/index.js.map +1 -1
- package/dist/types/providers/map/types.d.ts +3 -3
- package/package.json +1 -1
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
|
|
616
|
-
if (!
|
|
617
|
-
const
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
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
|
-
...
|
|
623
|
-
[n]:
|
|
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();
|