@local-logic/maps 0.1.9 → 0.1.11
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-2-7bXVdw.js +109 -0
- package/dist/{index-BrJk0fvu.js → index-5KsGujTK.js} +2 -2
- package/dist/{index-D06VjH1r.js → index-8AZECG4p.js} +2 -2
- package/dist/{index-CSsNIeGf.js → index-BCfZMtQL.js} +2 -2
- package/dist/{index-DEk1iNZG.js → index-BJa715Dk.js} +1 -1
- package/dist/{index-BIEyexab.js → index-BZQ1oWSp.js} +2 -2
- package/dist/{index-B-7FSpFA.js → index-Bm3Y5tYu.js} +72 -72
- package/dist/{index-CGULF4ex.js → index-CNCGWBR2.js} +2 -2
- package/dist/{index-BjiM48Gd.js → index-CV3FlwtS.js} +28 -28
- package/dist/{index-B9geAgZc.js → index-DJemWGRP.js} +28 -28
- package/dist/{index-BDolTDJO.js → index-HiFwRrPn.js} +1 -1
- package/dist/{index-DI5zCndd.js → index-g1-fRXga.js} +2 -2
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/index.d.ts.map +1 -1
- package/dist/{styles-C3ghTFwc.js → styles-C7XlxM5D.js} +1 -1
- package/package.json +2 -2
- package/dist/index-BKCGWHuo.js +0 -109
package/dist/index-BKCGWHuo.js
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { jsx as v, jsxs as x, Fragment as A } from "react/jsx-runtime";
|
|
2
|
-
import { useState as B, useEffect as P, useRef as C, useCallback as E } from "react";
|
|
3
|
-
import { APIProvider as O, Map as z, ControlPosition as L, useMap as G } from "@vis.gl/react-google-maps";
|
|
4
|
-
import { u as _, D as T, W as p, a as Z, m as I } from "./index-B-7FSpFA.js";
|
|
5
|
-
import { t as R } from "./index-DscDx7HE.js";
|
|
6
|
-
const F = {
|
|
7
|
-
"top-left": L.LEFT_TOP,
|
|
8
|
-
"top-right": L.RIGHT_TOP,
|
|
9
|
-
"bottom-left": L.LEFT_BOTTOM,
|
|
10
|
-
"bottom-right": L.RIGHT_BOTTOM
|
|
11
|
-
}, D = ({ isMapLoaded: y }) => {
|
|
12
|
-
const e = G(), { centerPinMarkerPoints: l, markerPoints: t, locationBoundary: c, setZoom: a, mapPadding: n } = _(), [u, g] = B(void 0), m = C(void 0), r = E(() => {
|
|
13
|
-
if (!e)
|
|
14
|
-
return;
|
|
15
|
-
const o = e.getZoom();
|
|
16
|
-
typeof o < "u" && a(o + 1);
|
|
17
|
-
}, [e, a]);
|
|
18
|
-
return P(() => {
|
|
19
|
-
r();
|
|
20
|
-
const o = e?.addListener("zoom_changed", r);
|
|
21
|
-
return () => {
|
|
22
|
-
o?.remove();
|
|
23
|
-
};
|
|
24
|
-
}, [e, r]), P(() => {
|
|
25
|
-
if (!e)
|
|
26
|
-
return;
|
|
27
|
-
const o = [];
|
|
28
|
-
typeof t < "u" && t.length > 0 ? (o.push(...t), l && o.push(l)) : o.push(...c || []);
|
|
29
|
-
const s = o.length === 0 ? p : R(I(o));
|
|
30
|
-
(!m.current || !s.every((i, d) => i === m.current?.[d])) && (m.current = s, g(s));
|
|
31
|
-
}, [e, t, c, l]), P(() => {
|
|
32
|
-
if (!e || typeof u > "u")
|
|
33
|
-
return;
|
|
34
|
-
const [o, s, i, d] = u, f = (i - o) * 0.05 || 1e-3, h = (d - s) * 0.05 || 1e-3;
|
|
35
|
-
e.fitBounds(
|
|
36
|
-
{
|
|
37
|
-
south: s - h,
|
|
38
|
-
west: o - f,
|
|
39
|
-
north: d + h,
|
|
40
|
-
east: i + f
|
|
41
|
-
},
|
|
42
|
-
n
|
|
43
|
-
);
|
|
44
|
-
}, [y, e, u, n]), null;
|
|
45
|
-
};
|
|
46
|
-
function j({ children: y }) {
|
|
47
|
-
const [e, l] = B(!1), [t, c] = B(!1), {
|
|
48
|
-
mapProvider: a,
|
|
49
|
-
mapPadding: n,
|
|
50
|
-
locale: u,
|
|
51
|
-
center: g,
|
|
52
|
-
zoom: m = T.zoom,
|
|
53
|
-
minZoom: r,
|
|
54
|
-
maxZoom: o,
|
|
55
|
-
pitch: s = T.pitch,
|
|
56
|
-
bearing: i = T.bearing,
|
|
57
|
-
cooperativeGestures: d = T.cooperativeGestures,
|
|
58
|
-
zoomPosition: f
|
|
59
|
-
} = _();
|
|
60
|
-
if (P(() => {
|
|
61
|
-
if (!t)
|
|
62
|
-
return;
|
|
63
|
-
const M = document.querySelector(".gm-style-moc");
|
|
64
|
-
M && n && (M.style.paddingLeft = `${n.left}px`, M.style.paddingRight = `${n.right}px`);
|
|
65
|
-
}, [t, n?.left, n?.right]), a.name !== "google")
|
|
66
|
-
return null;
|
|
67
|
-
const h = () => {
|
|
68
|
-
l(!0);
|
|
69
|
-
}, b = () => {
|
|
70
|
-
c(!0);
|
|
71
|
-
};
|
|
72
|
-
return /* @__PURE__ */ v(O, { apiKey: a.apiKey, language: u, onLoad: h, children: e && /* @__PURE__ */ x(A, { children: [
|
|
73
|
-
/* @__PURE__ */ v(D, { isMapLoaded: t }),
|
|
74
|
-
/* @__PURE__ */ v(
|
|
75
|
-
z,
|
|
76
|
-
{
|
|
77
|
-
mapId: a.theme || Z.google,
|
|
78
|
-
defaultCenter: {
|
|
79
|
-
lat: g.latitude,
|
|
80
|
-
lng: g.longitude
|
|
81
|
-
},
|
|
82
|
-
defaultBounds: {
|
|
83
|
-
north: p[3],
|
|
84
|
-
south: p[1],
|
|
85
|
-
east: p[2],
|
|
86
|
-
west: p[0]
|
|
87
|
-
},
|
|
88
|
-
defaultZoom: m + 1,
|
|
89
|
-
defaultTilt: s,
|
|
90
|
-
defaultHeading: i,
|
|
91
|
-
gestureHandling: d ? "cooperative" : "greedy",
|
|
92
|
-
streetViewControl: !1,
|
|
93
|
-
fullscreenControl: !1,
|
|
94
|
-
clickableIcons: !1,
|
|
95
|
-
mapTypeControl: !1,
|
|
96
|
-
zoomControlOptions: {
|
|
97
|
-
position: f && F[f]
|
|
98
|
-
},
|
|
99
|
-
minZoom: typeof r == "number" ? r + 1 : void 0,
|
|
100
|
-
maxZoom: typeof o == "number" ? o + 1 : void 0,
|
|
101
|
-
onTilesLoaded: b,
|
|
102
|
-
children: y
|
|
103
|
-
}
|
|
104
|
-
)
|
|
105
|
-
] }) });
|
|
106
|
-
}
|
|
107
|
-
export {
|
|
108
|
-
j as default
|
|
109
|
-
};
|