@local-logic/maps 0.0.30 → 0.1.0
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-7WiriOPf.js → index-BDKwzoXR.js} +48 -45
- package/dist/{index--TOrExMa.js → index-BnFfeG7K.js} +2 -2
- package/dist/{index-DRdXfLHP.js → index-CHAIEOV7.js} +1 -1
- package/dist/{index-Bn4XgGCE.js → index-CQ-JcUiN.js} +2 -2
- package/dist/{index-CEDpofgZ.js → index-CscTuMMv.js} +8 -7
- package/dist/{index-CIE9YlvM.js → index-CyFPuX3E.js} +1 -1
- package/dist/{index-DImiFUoC.js → index-DL98jat0.js} +2 -2
- package/dist/{index-B9irDFVS.js → index-DbGw-3H2.js} +51 -48
- package/dist/index-Dsui7RRW.js +109 -0
- package/dist/{index-B1UUkU25.js → index-E5WaU61r.js} +2 -2
- package/dist/{index-D5oT0rvy.js → index-H-u2bXnc.js} +88 -87
- package/dist/{index-GGtrKiJn.js → index-Id4hTpek.js} +1 -1
- package/dist/{index-Cnab0xsb.js → index-tFIqhoKk.js} +2 -2
- package/dist/{index-BCEeluIN.js → index-zSTRJ71g.js} +2 -2
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +5 -5
- 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/Layers/Google/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Layers/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Layers/types.d.ts +12 -1
- package/dist/src/components/Map/Root/Layers/types.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Layers/utils.d.ts +3 -4
- package/dist/src/components/Map/Root/Layers/utils.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/types.d.ts +1 -0
- package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
- package/dist/src/components/Map/Root/context.d.ts +0 -1
- package/dist/src/components/Map/Root/context.d.ts.map +1 -1
- package/dist/src/components/Map/Root/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/types.d.ts +1 -0
- package/dist/src/components/Map/Root/types.d.ts.map +1 -1
- package/dist/src/components/Map/storybook-data.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-mseP7Fna.js → styles-D8bDP2Op.js} +1 -1
- package/dist/utils-CNmTUsO1.js +30 -0
- package/package.json +3 -3
- package/dist/index-5JWsWx8g.js +0 -107
- package/dist/utils-DJ13veBM.js +0 -25
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as v, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useRef as Z, useCallback as h, useEffect as d } from "react";
|
|
3
3
|
import { M as B, N as L, u as T } from "./scale-control-Dsir9fWY.js";
|
|
4
|
-
import { u as
|
|
5
|
-
import { t as
|
|
6
|
-
const
|
|
4
|
+
import { u as M, D as p, a as z, m as A } from "./index-H-u2bXnc.js";
|
|
5
|
+
import { t as E } from "./index-DscDx7HE.js";
|
|
6
|
+
const P = {
|
|
7
7
|
en: {
|
|
8
8
|
"AttributionControl.ToggleAttribution": "Toggle attribution",
|
|
9
9
|
"FullscreenControl.Enter": "Enter fullscreen",
|
|
@@ -34,25 +34,28 @@ const A = {
|
|
|
34
34
|
"ScrollZoomBlocker.CmdMessage": "Utilisez ⌘ + défilement pour zoomer sur la carte",
|
|
35
35
|
"TouchPanBlocker.Message": "Utilisez deux doigts pour déplacer la carte"
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
const { current: o } = T(), { markerPoints:
|
|
37
|
+
}, y = () => {
|
|
38
|
+
const { current: o } = T(), { markerPoints: n, locationBoundary: l, setZoom: s, mapPadding: c } = M(), [a, f] = x(void 0), i = Z(void 0), r = h(() => {
|
|
39
39
|
o && s(o.getZoom());
|
|
40
40
|
}, [o, s]);
|
|
41
|
-
return
|
|
42
|
-
o?.off("zoom",
|
|
43
|
-
}), [o,
|
|
44
|
-
if (!o
|
|
41
|
+
return d(() => (r(), o?.on("zoom", r), () => {
|
|
42
|
+
o?.off("zoom", r);
|
|
43
|
+
}), [o, r]), d(() => {
|
|
44
|
+
if (!o)
|
|
45
45
|
return;
|
|
46
|
-
const
|
|
47
|
-
(
|
|
48
|
-
}, [o, e]), p(() => {
|
|
49
|
-
if (!o || typeof i > "u")
|
|
46
|
+
const e = [];
|
|
47
|
+
if (typeof n < "u" && n.length > 0 ? e.push(...n) : e.push(...l || []), e.length === 0)
|
|
50
48
|
return;
|
|
51
|
-
const
|
|
49
|
+
const t = E(A(e));
|
|
50
|
+
(!i.current || !t.every((u, m) => u === i.current?.[m])) && (i.current = t, f(t));
|
|
51
|
+
}, [o, n, l]), d(() => {
|
|
52
|
+
if (!o || typeof a > "u")
|
|
53
|
+
return;
|
|
54
|
+
const [e, t, u, m] = a, g = (u - e) * 0.05 || 1e-3, b = (m - t) * 0.05 || 1e-3;
|
|
52
55
|
o.fitBounds(
|
|
53
56
|
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
57
|
+
[e - g, t - b],
|
|
58
|
+
[u + g, m + b]
|
|
56
59
|
],
|
|
57
60
|
{
|
|
58
61
|
// Mapbox seems to retain padding, thus further calls
|
|
@@ -64,45 +67,45 @@ const A = {
|
|
|
64
67
|
duration: 700
|
|
65
68
|
}
|
|
66
69
|
);
|
|
67
|
-
}, [o,
|
|
70
|
+
}, [o, a, c]), null;
|
|
68
71
|
};
|
|
69
|
-
function
|
|
72
|
+
function R({ children: o }) {
|
|
70
73
|
const {
|
|
71
|
-
mapProvider:
|
|
72
|
-
locale:
|
|
73
|
-
center:
|
|
74
|
-
zoom:
|
|
75
|
-
minZoom:
|
|
76
|
-
maxZoom:
|
|
77
|
-
pitch:
|
|
78
|
-
bearing:
|
|
79
|
-
cooperativeGestures:
|
|
80
|
-
zoomPosition:
|
|
81
|
-
} =
|
|
82
|
-
return
|
|
74
|
+
mapProvider: n,
|
|
75
|
+
locale: l,
|
|
76
|
+
center: s,
|
|
77
|
+
zoom: c = p.zoom,
|
|
78
|
+
minZoom: a,
|
|
79
|
+
maxZoom: f,
|
|
80
|
+
pitch: i = p.pitch,
|
|
81
|
+
bearing: r = p.bearing,
|
|
82
|
+
cooperativeGestures: e = p.cooperativeGestures,
|
|
83
|
+
zoomPosition: t
|
|
84
|
+
} = M();
|
|
85
|
+
return n.name !== "mapbox" ? null : /* @__PURE__ */ v(
|
|
83
86
|
B,
|
|
84
87
|
{
|
|
85
|
-
mapboxAccessToken:
|
|
88
|
+
mapboxAccessToken: n.apiKey,
|
|
86
89
|
initialViewState: {
|
|
87
|
-
...
|
|
88
|
-
zoom:
|
|
89
|
-
pitch:
|
|
90
|
-
bearing:
|
|
90
|
+
...s,
|
|
91
|
+
zoom: c,
|
|
92
|
+
pitch: i,
|
|
93
|
+
bearing: r
|
|
91
94
|
},
|
|
92
|
-
cooperativeGestures:
|
|
93
|
-
minZoom:
|
|
94
|
-
maxZoom:
|
|
95
|
-
mapStyle: `mapbox://styles/${
|
|
95
|
+
cooperativeGestures: e,
|
|
96
|
+
minZoom: a,
|
|
97
|
+
maxZoom: f,
|
|
98
|
+
mapStyle: `mapbox://styles/${n.theme || z.mapbox}`,
|
|
96
99
|
interactiveLayerIds: ["road-label", "waterway-label"],
|
|
97
|
-
locale:
|
|
100
|
+
locale: P[l],
|
|
98
101
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
102
|
+
/* @__PURE__ */ C(y, {}),
|
|
103
|
+
t && /* @__PURE__ */ C(L, { position: t }),
|
|
101
104
|
o
|
|
102
105
|
]
|
|
103
106
|
}
|
|
104
107
|
);
|
|
105
108
|
}
|
|
106
109
|
export {
|
|
107
|
-
|
|
110
|
+
R as default
|
|
108
111
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { a as k } from "./scale-control-Dsir9fWY.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { u, M } from "./index-
|
|
5
|
-
import { C as g, c as C, M as b } from "./index-
|
|
4
|
+
import { u, M } from "./index-H-u2bXnc.js";
|
|
5
|
+
import { C as g, c as C, M as b } from "./index-CHAIEOV7.js";
|
|
6
6
|
function _({
|
|
7
7
|
clusters: n,
|
|
8
8
|
colors: r,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as r, jsxs as l, Fragment as d } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo as f } from "react";
|
|
3
|
-
import { u as h, M as n } from "./index-
|
|
3
|
+
import { u as h, M as n } from "./index-H-u2bXnc.js";
|
|
4
4
|
import { MapPinIcon as g } from "@phosphor-icons/react";
|
|
5
5
|
const a = `
|
|
6
6
|
group/marker cursor-pointer rounded-full
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import { useMap as k, AdvancedMarker as u } from "@vis.gl/react-google-maps";
|
|
3
|
-
import { u as M, M as g } from "./index-
|
|
4
|
-
import { C, c as v, M as I } from "./index-
|
|
3
|
+
import { u as M, M as g } from "./index-H-u2bXnc.js";
|
|
4
|
+
import { C, c as v, M as I } from "./index-CHAIEOV7.js";
|
|
5
5
|
function x({
|
|
6
6
|
clusters: a,
|
|
7
7
|
colors: o,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as P, Fragment as u } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
2
|
+
import { useState as s, useContext as M, useEffect as g } from "react";
|
|
3
3
|
import { GoogleMapsContext as L } from "@vis.gl/react-google-maps";
|
|
4
|
-
import { a as
|
|
4
|
+
import { a as k } from "./utils-CNmTUsO1.js";
|
|
5
5
|
function f(o, e, r) {
|
|
6
6
|
switch (o) {
|
|
7
7
|
case "fill":
|
|
@@ -18,8 +18,8 @@ function f(o, e, r) {
|
|
|
18
18
|
return {};
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
const [e, r] =
|
|
21
|
+
function O({ sources: o }) {
|
|
22
|
+
const [e, r] = s(null), [m, c] = s(
|
|
23
23
|
[]
|
|
24
24
|
), i = M(L);
|
|
25
25
|
return g(() => {
|
|
@@ -44,18 +44,19 @@ function E({ sources: o }) {
|
|
|
44
44
|
Object.assign(n, a);
|
|
45
45
|
}
|
|
46
46
|
let l;
|
|
47
|
+
const y = k(t.geometry, n.type);
|
|
47
48
|
return t.type === "LineString" ? l = new google.maps.Polyline({
|
|
48
49
|
// Set default options otherwise the polyline remains visible (even if eg: we only want the outline)
|
|
49
50
|
// We then overrider the default options with the layer options
|
|
50
51
|
strokeWeight: 6,
|
|
51
|
-
path:
|
|
52
|
+
path: y,
|
|
52
53
|
...n
|
|
53
54
|
}) : l = new google.maps.Polygon({
|
|
54
55
|
// Set default options otherwise the polygon remains visible (even if eg: we only want the outline)
|
|
55
56
|
// We then overrider the default options with the layer options
|
|
56
57
|
strokeWeight: 0,
|
|
57
58
|
fillOpacity: 0,
|
|
58
|
-
paths:
|
|
59
|
+
paths: y,
|
|
59
60
|
...n
|
|
60
61
|
}), l.setMap(e), l;
|
|
61
62
|
});
|
|
@@ -69,5 +70,5 @@ function E({ sources: o }) {
|
|
|
69
70
|
}, [e, o]), /* @__PURE__ */ P(u, {});
|
|
70
71
|
}
|
|
71
72
|
export {
|
|
72
|
-
|
|
73
|
+
O as default
|
|
73
74
|
};
|
|
@@ -2,7 +2,7 @@ import { jsx as c, Fragment as b } from "react/jsx-runtime";
|
|
|
2
2
|
import * as $ from "react";
|
|
3
3
|
import { useContext as S, useRef as k, useState as C, useMemo as g, useEffect as w, cloneElement as j } from "react";
|
|
4
4
|
import { b as x, d as u } from "./scale-control-Dsir9fWY.js";
|
|
5
|
-
import { g as I } from "./utils-
|
|
5
|
+
import { g as I } from "./utils-CNmTUsO1.js";
|
|
6
6
|
function s(t, e) {
|
|
7
7
|
if (!t)
|
|
8
8
|
throw new Error(e);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { a as k } from "./logo-control-CHapR1Dt.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { u, M } from "./index-
|
|
5
|
-
import { C as g, c as C, M as v } from "./index-
|
|
4
|
+
import { u, M } from "./index-H-u2bXnc.js";
|
|
5
|
+
import { C as g, c as C, M as v } from "./index-CHAIEOV7.js";
|
|
6
6
|
function x({
|
|
7
7
|
clusters: n,
|
|
8
8
|
colors: o,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { M as
|
|
4
|
-
import { u as M, D as
|
|
5
|
-
import { t as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as v, jsx as g } from "react/jsx-runtime";
|
|
2
|
+
import { useState as T, useRef as E, useCallback as x, useEffect as b } from "react";
|
|
3
|
+
import { M as L, N as A, u as G } from "./logo-control-CHapR1Dt.js";
|
|
4
|
+
import { u as M, D as m, a as F, m as S } from "./index-H-u2bXnc.js";
|
|
5
|
+
import { t as h } from "./index-DscDx7HE.js";
|
|
6
|
+
const z = {
|
|
7
7
|
en: {
|
|
8
8
|
"AttributionControl.ToggleAttribution": "Toggle attribution",
|
|
9
9
|
"AttributionControl.MapFeedback": "Map feedback",
|
|
@@ -58,25 +58,28 @@ const F = {
|
|
|
58
58
|
"CooperativeGesturesHandler.MacHelpText": "Utilisez ⌘ + défilement pour zoomer sur la carte",
|
|
59
59
|
"CooperativeGesturesHandler.MobileHelpText": "Utilisez deux doigts pour déplacer la carte"
|
|
60
60
|
}
|
|
61
|
-
},
|
|
62
|
-
const { current:
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
}), [
|
|
68
|
-
if (!
|
|
61
|
+
}, H = () => {
|
|
62
|
+
const { current: o } = G(), { markerPoints: r, locationBoundary: i, setZoom: s, mapPadding: u } = M(), [l, C] = T(void 0), a = E(void 0), n = x(() => {
|
|
63
|
+
o && s(o.getZoom());
|
|
64
|
+
}, [o, s]);
|
|
65
|
+
return b(() => (n(), o?.on("zoom", n), () => {
|
|
66
|
+
o?.off("zoom", n);
|
|
67
|
+
}), [o, n]), b(() => {
|
|
68
|
+
if (!o)
|
|
69
69
|
return;
|
|
70
|
-
const
|
|
71
|
-
(
|
|
72
|
-
}, [e, o]), p(() => {
|
|
73
|
-
if (!e || typeof a > "u")
|
|
70
|
+
const e = [];
|
|
71
|
+
if (typeof r < "u" && r.length > 0 ? e.push(...r) : e.push(...i || []), e.length === 0)
|
|
74
72
|
return;
|
|
75
|
-
const
|
|
76
|
-
|
|
73
|
+
const t = h(S(e));
|
|
74
|
+
(!a.current || !t.every((c, p) => c === a.current?.[p])) && (a.current = t, C(t));
|
|
75
|
+
}, [o, r, i]), b(() => {
|
|
76
|
+
if (!o || typeof l > "u")
|
|
77
|
+
return;
|
|
78
|
+
const [e, t, c, p] = l, d = (c - e) * 0.05 || 1e-3, f = (p - t) * 0.05 || 1e-3;
|
|
79
|
+
o.fitBounds(
|
|
77
80
|
[
|
|
78
|
-
[
|
|
79
|
-
[
|
|
81
|
+
[e - d, t - f],
|
|
82
|
+
[c + d, p + f]
|
|
80
83
|
],
|
|
81
84
|
{
|
|
82
85
|
padding: u,
|
|
@@ -84,39 +87,39 @@ const F = {
|
|
|
84
87
|
duration: 700
|
|
85
88
|
}
|
|
86
89
|
);
|
|
87
|
-
}, [
|
|
90
|
+
}, [o, l, u]), null;
|
|
88
91
|
};
|
|
89
|
-
function P({ children:
|
|
92
|
+
function P({ children: o }) {
|
|
90
93
|
const {
|
|
91
|
-
mapProvider:
|
|
92
|
-
locale:
|
|
93
|
-
center:
|
|
94
|
-
zoom:
|
|
95
|
-
minZoom:
|
|
96
|
-
maxZoom:
|
|
97
|
-
pitch:
|
|
98
|
-
bearing:
|
|
99
|
-
cooperativeGestures:
|
|
100
|
-
zoomPosition:
|
|
94
|
+
mapProvider: r,
|
|
95
|
+
locale: i,
|
|
96
|
+
center: s,
|
|
97
|
+
zoom: u = m.zoom,
|
|
98
|
+
minZoom: l,
|
|
99
|
+
maxZoom: C,
|
|
100
|
+
pitch: a = m.pitch,
|
|
101
|
+
bearing: n = m.bearing,
|
|
102
|
+
cooperativeGestures: e = m.cooperativeGestures,
|
|
103
|
+
zoomPosition: t
|
|
101
104
|
} = M();
|
|
102
|
-
return
|
|
103
|
-
|
|
105
|
+
return r.name !== "maptiler" ? null : /* @__PURE__ */ v(
|
|
106
|
+
L,
|
|
104
107
|
{
|
|
105
108
|
initialViewState: {
|
|
106
|
-
...
|
|
107
|
-
zoom:
|
|
108
|
-
pitch:
|
|
109
|
-
bearing:
|
|
109
|
+
...s,
|
|
110
|
+
zoom: u,
|
|
111
|
+
pitch: a,
|
|
112
|
+
bearing: n
|
|
110
113
|
},
|
|
111
|
-
cooperativeGestures:
|
|
112
|
-
minZoom:
|
|
113
|
-
maxZoom:
|
|
114
|
-
mapStyle: `https://api.maptiler.com/maps/${
|
|
115
|
-
locale:
|
|
114
|
+
cooperativeGestures: e,
|
|
115
|
+
minZoom: l,
|
|
116
|
+
maxZoom: C,
|
|
117
|
+
mapStyle: `https://api.maptiler.com/maps/${r.theme || F.maptiler}/style.json?key=${r.apiKey}`,
|
|
118
|
+
locale: z[i],
|
|
116
119
|
children: [
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
/* @__PURE__ */ g(H, {}),
|
|
121
|
+
t && /* @__PURE__ */ g(A, { position: t }),
|
|
122
|
+
o
|
|
120
123
|
]
|
|
121
124
|
}
|
|
122
125
|
);
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as P, jsxs as x, Fragment as A } from "react/jsx-runtime";
|
|
2
|
+
import { useState as v, useEffect as L, useRef as C, useCallback as E } from "react";
|
|
3
|
+
import { APIProvider as O, Map as z, ControlPosition as g, useMap as G } from "@vis.gl/react-google-maps";
|
|
4
|
+
import { u as B, D as h, W as f, a as Z, m as I } from "./index-H-u2bXnc.js";
|
|
5
|
+
import { t as R } from "./index-DscDx7HE.js";
|
|
6
|
+
const F = {
|
|
7
|
+
"top-left": g.LEFT_TOP,
|
|
8
|
+
"top-right": g.RIGHT_TOP,
|
|
9
|
+
"bottom-left": g.LEFT_BOTTOM,
|
|
10
|
+
"bottom-right": g.RIGHT_BOTTOM
|
|
11
|
+
}, D = ({ isMapLoaded: T }) => {
|
|
12
|
+
const e = G(), { markerPoints: s, locationBoundary: a, setZoom: p, mapPadding: r } = B(), [t, y] = v(void 0), i = C(void 0), u = E(() => {
|
|
13
|
+
if (!e)
|
|
14
|
+
return;
|
|
15
|
+
const o = e.getZoom();
|
|
16
|
+
typeof o < "u" && p(o + 1);
|
|
17
|
+
}, [e, p]);
|
|
18
|
+
return L(() => {
|
|
19
|
+
u();
|
|
20
|
+
const o = e?.addListener("zoom_changed", u);
|
|
21
|
+
return () => {
|
|
22
|
+
o?.remove();
|
|
23
|
+
};
|
|
24
|
+
}, [e, u]), L(() => {
|
|
25
|
+
if (!e)
|
|
26
|
+
return;
|
|
27
|
+
const o = [];
|
|
28
|
+
typeof s < "u" && s.length > 0 ? o.push(...s) : o.push(...a || []);
|
|
29
|
+
const n = o.length === 0 ? f : R(I(o));
|
|
30
|
+
(!i.current || !n.every((d, l) => d === i.current?.[l])) && (i.current = n, y(n));
|
|
31
|
+
}, [e, s, a]), L(() => {
|
|
32
|
+
if (!e || typeof t > "u")
|
|
33
|
+
return;
|
|
34
|
+
const [o, n, d, l] = t, c = (d - o) * 0.05 || 1e-3, m = (l - n) * 0.05 || 1e-3;
|
|
35
|
+
e.fitBounds(
|
|
36
|
+
{
|
|
37
|
+
south: n - m,
|
|
38
|
+
west: o - c,
|
|
39
|
+
north: l + m,
|
|
40
|
+
east: d + c
|
|
41
|
+
},
|
|
42
|
+
r
|
|
43
|
+
);
|
|
44
|
+
}, [T, e, t, r]), null;
|
|
45
|
+
};
|
|
46
|
+
function j({ children: T }) {
|
|
47
|
+
const [e, s] = v(!1), [a, p] = v(!1), {
|
|
48
|
+
mapProvider: r,
|
|
49
|
+
mapPadding: t,
|
|
50
|
+
locale: y,
|
|
51
|
+
center: i,
|
|
52
|
+
zoom: u = h.zoom,
|
|
53
|
+
minZoom: o,
|
|
54
|
+
maxZoom: n,
|
|
55
|
+
pitch: d = h.pitch,
|
|
56
|
+
bearing: l = h.bearing,
|
|
57
|
+
cooperativeGestures: c = h.cooperativeGestures,
|
|
58
|
+
zoomPosition: m
|
|
59
|
+
} = B();
|
|
60
|
+
if (L(() => {
|
|
61
|
+
if (!a)
|
|
62
|
+
return;
|
|
63
|
+
const M = document.querySelector(".gm-style-moc");
|
|
64
|
+
M && t && (M.style.paddingLeft = `${t.left}px`, M.style.paddingRight = `${t.right}px`);
|
|
65
|
+
}, [a, t?.left, t?.right]), r.name !== "google")
|
|
66
|
+
return null;
|
|
67
|
+
const _ = () => {
|
|
68
|
+
s(!0);
|
|
69
|
+
}, b = () => {
|
|
70
|
+
p(!0);
|
|
71
|
+
};
|
|
72
|
+
return /* @__PURE__ */ P(O, { apiKey: r.apiKey, language: y, onLoad: _, children: e && /* @__PURE__ */ x(A, { children: [
|
|
73
|
+
/* @__PURE__ */ P(D, { isMapLoaded: a }),
|
|
74
|
+
/* @__PURE__ */ P(
|
|
75
|
+
z,
|
|
76
|
+
{
|
|
77
|
+
mapId: r.theme || Z.google,
|
|
78
|
+
defaultCenter: {
|
|
79
|
+
lat: i.latitude,
|
|
80
|
+
lng: i.longitude
|
|
81
|
+
},
|
|
82
|
+
defaultBounds: {
|
|
83
|
+
north: f[3],
|
|
84
|
+
south: f[1],
|
|
85
|
+
east: f[2],
|
|
86
|
+
west: f[0]
|
|
87
|
+
},
|
|
88
|
+
defaultZoom: u + 1,
|
|
89
|
+
defaultTilt: d,
|
|
90
|
+
defaultHeading: l,
|
|
91
|
+
gestureHandling: c ? "cooperative" : "greedy",
|
|
92
|
+
streetViewControl: !1,
|
|
93
|
+
fullscreenControl: !1,
|
|
94
|
+
clickableIcons: !1,
|
|
95
|
+
mapTypeControl: !1,
|
|
96
|
+
zoomControlOptions: {
|
|
97
|
+
position: m && F[m]
|
|
98
|
+
},
|
|
99
|
+
minZoom: typeof o == "number" ? o + 1 : void 0,
|
|
100
|
+
maxZoom: typeof n == "number" ? n + 1 : void 0,
|
|
101
|
+
onTilesLoaded: b,
|
|
102
|
+
children: T
|
|
103
|
+
}
|
|
104
|
+
)
|
|
105
|
+
] }) });
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
j as default
|
|
109
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as E } from "react/jsx-runtime";
|
|
2
2
|
import { useRef as d, useEffect as M } from "react";
|
|
3
3
|
import { u as D, P as H } from "./logo-control-CHapR1Dt.js";
|
|
4
|
-
import { u as j, P as T } from "./index-
|
|
5
|
-
import { c as x, m as A } from "./styles-
|
|
4
|
+
import { u as j, P as T } from "./index-H-u2bXnc.js";
|
|
5
|
+
import { c as x, m as A } from "./styles-D8bDP2Op.js";
|
|
6
6
|
function Z({
|
|
7
7
|
latitude: l,
|
|
8
8
|
longitude: h,
|