@local-logic/maps 0.0.9 → 0.0.10
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/IconBase.es-rM5tt24D.js +48 -0
- package/dist/{index-BZ2605rA.js → index-9RZYMoMG.js} +1 -1
- package/dist/index-BCa658u4.js +24 -0
- package/dist/index-BOuko7CL.js +32 -0
- package/dist/index-BYlamtEc.js +96 -0
- package/dist/{index-CPq7k7F4.js → index-BsnsAUt5.js} +1 -1
- package/dist/index-BtwgeEEU.js +53 -0
- package/dist/index-CNxLnZ8O.js +23 -0
- package/dist/index-CR8t37Oz.js +73 -0
- package/dist/index-CRQ5kxRL.js +65 -0
- package/dist/{index-B43MtiHH.js → index-D5uhfwEH.js} +10 -9
- package/dist/index-DNKXUpkv.js +65 -0
- package/dist/index-DgHrPgsK.js +772 -0
- package/dist/index-DnsF5I7I.js +62 -0
- package/dist/index-Do_dW76Q.js +23 -0
- package/dist/index-JQfyhSrg.js +50 -0
- package/dist/index.es.js +1 -1
- package/dist/{index.modern-EsUgbhzI.js → index.modern-CLRs8JwI.js} +7 -7
- package/dist/index.umd.js +134 -146
- 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/CenterPin/Google/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/index.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/index.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/styles.d.ts +4 -0
- package/dist/src/components/Map/Root/CenterPin/styles.d.ts.map +1 -0
- package/dist/src/components/Map/Root/CenterPin/types.d.ts +6 -0
- package/dist/src/components/Map/Root/CenterPin/types.d.ts.map +1 -0
- package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts +4 -3
- package/dist/src/components/Map/Root/Markers/Cluster/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts +2 -1
- package/dist/src/components/Map/Root/Markers/Cluster/styles.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Google/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/MarkerIcon/index.d.ts +6 -0
- package/dist/src/components/Map/Root/Markers/MarkerIcon/index.d.ts.map +1 -0
- 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/styles.d.ts +2 -4
- package/dist/src/components/Map/Root/Markers/styles.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Markers/types.d.ts +18 -9
- package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Popup/Mapbox/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/constants.d.ts +3 -0
- package/dist/src/components/Map/Root/constants.d.ts.map +1 -1
- package/dist/src/components/Map/Root/context.d.ts +2 -0
- package/dist/src/components/Map/Root/context.d.ts.map +1 -1
- package/dist/src/components/Map/Root/index.d.ts +1 -0
- package/dist/src/components/Map/Root/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/types.d.ts +10 -0
- package/dist/src/components/Map/Root/types.d.ts.map +1 -1
- package/dist/src/components/Map/index.d.ts +2 -2
- package/dist/src/components/Map/index.d.ts.map +1 -1
- package/dist/src/components/Map/index.stories.d.ts.map +1 -1
- package/dist/src/components/Map/storybook-data.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +24 -1
- package/dist/styles-D2MYaLhP.js +47 -0
- package/package.json +5 -3
- package/dist/index-92HhWupr.js +0 -29
- package/dist/index-BF2kb4Y-.js +0 -42
- package/dist/index-C5-_i-6M.js +0 -64
- package/dist/index-CXjxZmYt.js +0 -144
- package/dist/index-CY0to_1B.js +0 -676
- package/dist/index-ChwN5abO.js +0 -29
- package/dist/index-CrIFr9oc.js +0 -47
- package/dist/index-D5-2anzJ.js +0 -29
- package/dist/index-J1MKzGEM.js +0 -31
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { createContext as h } from "react";
|
|
3
|
+
const p = h({
|
|
4
|
+
color: "currentColor",
|
|
5
|
+
size: "1em",
|
|
6
|
+
weight: "regular",
|
|
7
|
+
mirrored: !1
|
|
8
|
+
}), x = r.forwardRef(
|
|
9
|
+
(n, s) => {
|
|
10
|
+
const {
|
|
11
|
+
alt: t,
|
|
12
|
+
color: o,
|
|
13
|
+
size: e,
|
|
14
|
+
weight: l,
|
|
15
|
+
mirrored: a,
|
|
16
|
+
children: c,
|
|
17
|
+
weights: m,
|
|
18
|
+
...g
|
|
19
|
+
} = n, {
|
|
20
|
+
color: w = "currentColor",
|
|
21
|
+
size: i,
|
|
22
|
+
weight: u = "regular",
|
|
23
|
+
mirrored: f = !1,
|
|
24
|
+
...d
|
|
25
|
+
} = r.useContext(p);
|
|
26
|
+
return /* @__PURE__ */ r.createElement(
|
|
27
|
+
"svg",
|
|
28
|
+
{
|
|
29
|
+
ref: s,
|
|
30
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
31
|
+
width: e ?? i,
|
|
32
|
+
height: e ?? i,
|
|
33
|
+
fill: o ?? w,
|
|
34
|
+
viewBox: "0 0 256 256",
|
|
35
|
+
transform: a || f ? "scale(-1, 1)" : void 0,
|
|
36
|
+
...d,
|
|
37
|
+
...g
|
|
38
|
+
},
|
|
39
|
+
!!t && /* @__PURE__ */ r.createElement("title", null, t),
|
|
40
|
+
c,
|
|
41
|
+
m.get(l ?? u)
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
x.displayName = "IconBase";
|
|
46
|
+
export {
|
|
47
|
+
x as p
|
|
48
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect as m, useMemo as o } from "react";
|
|
3
|
-
import { u as s, I as d } from "./index.modern-
|
|
3
|
+
import { u as s, I as d } from "./index.modern-CLRs8JwI.js";
|
|
4
4
|
import { c as f } from "./styles-uPzJnzVS.js";
|
|
5
5
|
function v({
|
|
6
6
|
latitude: n,
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs as n, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { a as e } from "./index.modern-CLRs8JwI.js";
|
|
3
|
+
import { c as o, S as a, o as s, i as r } from "./styles-D2MYaLhP.js";
|
|
4
|
+
function m({ marker: t }) {
|
|
5
|
+
return /* @__PURE__ */ n(
|
|
6
|
+
e,
|
|
7
|
+
{
|
|
8
|
+
position: {
|
|
9
|
+
lat: t.latitude,
|
|
10
|
+
lng: t.longitude
|
|
11
|
+
},
|
|
12
|
+
className: o.trim(),
|
|
13
|
+
zIndex: 10,
|
|
14
|
+
children: [
|
|
15
|
+
/* @__PURE__ */ i(a, {}),
|
|
16
|
+
/* @__PURE__ */ i(s, { className: r })
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
`center-pin-marker-${t.longitude}-${t.latitude}`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
m as default
|
|
24
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { P as u } from "./logo-control-NE-LlsRy.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { c as a } from "./styles-uPzJnzVS.js";
|
|
5
|
+
function c({
|
|
6
|
+
latitude: e,
|
|
7
|
+
longitude: p,
|
|
8
|
+
anchor: r,
|
|
9
|
+
offset: t = [0, -35],
|
|
10
|
+
onClose: n,
|
|
11
|
+
children: f
|
|
12
|
+
}) {
|
|
13
|
+
return typeof e > "u" || typeof p > "u" ? null : /* @__PURE__ */ o(
|
|
14
|
+
u,
|
|
15
|
+
{
|
|
16
|
+
className: "maplibre-popup",
|
|
17
|
+
focusAfterOpen: !0,
|
|
18
|
+
latitude: e,
|
|
19
|
+
longitude: p,
|
|
20
|
+
anchor: r,
|
|
21
|
+
offset: t,
|
|
22
|
+
onClose: n,
|
|
23
|
+
closeButton: !1,
|
|
24
|
+
closeOnMove: !0,
|
|
25
|
+
children: /* @__PURE__ */ o("div", { className: a, children: f })
|
|
26
|
+
},
|
|
27
|
+
"maplibre-popup"
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
c as default
|
|
32
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as t, jsxs as o, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import * as e from "react";
|
|
3
|
+
import { useMemo as g } from "react";
|
|
4
|
+
import { u as Z, M as c } from "./index-DgHrPgsK.js";
|
|
5
|
+
import { p as A } from "./IconBase.es-rM5tt24D.js";
|
|
6
|
+
const p = /* @__PURE__ */ new Map([
|
|
7
|
+
[
|
|
8
|
+
"bold",
|
|
9
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,60a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,60Zm0,64a20,20,0,1,1,20-20A20,20,0,0,1,128,124Zm0-112a92.1,92.1,0,0,0-92,92c0,77.36,81.64,135.4,85.12,137.83a12,12,0,0,0,13.76,0,259,259,0,0,0,42.18-39C205.15,170.57,220,136.37,220,104A92.1,92.1,0,0,0,128,12Zm31.3,174.71A249.35,249.35,0,0,1,128,216.89a249.35,249.35,0,0,1-31.3-30.18C80,167.37,60,137.31,60,104a68,68,0,0,1,136,0C196,137.31,176,167.37,159.3,186.71Z" }))
|
|
10
|
+
],
|
|
11
|
+
[
|
|
12
|
+
"duotone",
|
|
13
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
14
|
+
"path",
|
|
15
|
+
{
|
|
16
|
+
d: "M128,24a80,80,0,0,0-80,80c0,72,80,128,80,128s80-56,80-128A80,80,0,0,0,128,24Zm0,112a32,32,0,1,1,32-32A32,32,0,0,1,128,136Z",
|
|
17
|
+
opacity: "0.2"
|
|
18
|
+
}
|
|
19
|
+
), /* @__PURE__ */ e.createElement("path", { d: "M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z" }))
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
"fill",
|
|
23
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,16a88.1,88.1,0,0,0-88,88c0,75.3,80,132.17,83.41,134.55a8,8,0,0,0,9.18,0C136,236.17,216,179.3,216,104A88.1,88.1,0,0,0,128,16Zm0,56a32,32,0,1,1-32,32A32,32,0,0,1,128,72Z" }))
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
"light",
|
|
27
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,66a38,38,0,1,0,38,38A38,38,0,0,0,128,66Zm0,64a26,26,0,1,1,26-26A26,26,0,0,1,128,130Zm0-112a86.1,86.1,0,0,0-86,86c0,30.91,14.34,63.74,41.47,94.94a252.32,252.32,0,0,0,41.09,38,6,6,0,0,0,6.88,0,252.32,252.32,0,0,0,41.09-38c27.13-31.2,41.47-64,41.47-94.94A86.1,86.1,0,0,0,128,18Zm0,206.51C113,212.93,54,163.62,54,104a74,74,0,0,1,148,0C202,163.62,143,212.93,128,224.51Z" }))
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
"regular",
|
|
31
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z" }))
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
"thin",
|
|
35
|
+
/* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement("path", { d: "M128,68a36,36,0,1,0,36,36A36,36,0,0,0,128,68Zm0,64a28,28,0,1,1,28-28A28,28,0,0,1,128,132Zm0-112a84.09,84.09,0,0,0-84,84c0,30.42,14.17,62.79,41,93.62a250,250,0,0,0,40.73,37.66,4,4,0,0,0,4.58,0A250,250,0,0,0,171,197.62c26.81-30.83,41-63.2,41-93.62A84.09,84.09,0,0,0,128,20Zm37.1,172.23A254.62,254.62,0,0,1,128,227a254.62,254.62,0,0,1-37.1-34.81C73.15,171.8,52,139.9,52,104a76,76,0,0,1,152,0C204,139.9,182.85,171.8,165.1,192.23Z" }))
|
|
36
|
+
]
|
|
37
|
+
]), d = e.forwardRef((a, r) => /* @__PURE__ */ e.createElement(A, { ref: r, ...a, weights: p }));
|
|
38
|
+
d.displayName = "MapPinIcon";
|
|
39
|
+
const m = `
|
|
40
|
+
group/marker cursor-pointer rounded-full
|
|
41
|
+
relative h-7 w-7 flex items-center justify-center
|
|
42
|
+
text-base-white ring-1 ring-inset
|
|
43
|
+
transition-colors
|
|
44
|
+
|
|
45
|
+
bg-[var(--background)]
|
|
46
|
+
ring-[var(--fill)]
|
|
47
|
+
|
|
48
|
+
hover:bg-[var(--fill)]
|
|
49
|
+
|
|
50
|
+
data-[is-zoomed-out=true]:bg-[var(--fill)]
|
|
51
|
+
data-[is-zoomed-out=true]:h-4
|
|
52
|
+
data-[is-zoomed-out=true]:w-4
|
|
53
|
+
`, u = `
|
|
54
|
+
m-auto transition-all w-4 h-4
|
|
55
|
+
|
|
56
|
+
fill-[var(--fill)]
|
|
57
|
+
group-hover/marker:fill-[var(--background)]
|
|
58
|
+
|
|
59
|
+
group-data-[is-zoomed-out=true]/marker:hidden
|
|
60
|
+
`;
|
|
61
|
+
function h({ icon: a }) {
|
|
62
|
+
return typeof a < "u" ? /* @__PURE__ */ t(a, { className: u }) : /* @__PURE__ */ t(d, { className: u });
|
|
63
|
+
}
|
|
64
|
+
const E = `
|
|
65
|
+
relative flex
|
|
66
|
+
`, s = `
|
|
67
|
+
-ml-6 -z-10 last:-z-20
|
|
68
|
+
`;
|
|
69
|
+
function k({
|
|
70
|
+
colors: a,
|
|
71
|
+
icon: r
|
|
72
|
+
}) {
|
|
73
|
+
const { zoom: n, mapProvider: l } = Z(), i = g(() => l.name === "google" ? n - 1 < c + 1 : n < c, [n, l]);
|
|
74
|
+
return /* @__PURE__ */ o(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
className: E,
|
|
78
|
+
style: {
|
|
79
|
+
"--background": a == null ? void 0 : a.background,
|
|
80
|
+
"--fill": a == null ? void 0 : a.fill
|
|
81
|
+
},
|
|
82
|
+
children: [
|
|
83
|
+
/* @__PURE__ */ t("div", { className: m, "data-is-zoomed-out": i, children: /* @__PURE__ */ t(h, { icon: r }) }),
|
|
84
|
+
!i && /* @__PURE__ */ o(f, { children: [
|
|
85
|
+
/* @__PURE__ */ t("div", { className: `${m} ${s}` }),
|
|
86
|
+
/* @__PURE__ */ t("div", { className: `${m} ${s}` })
|
|
87
|
+
] })
|
|
88
|
+
]
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
export {
|
|
93
|
+
k as C,
|
|
94
|
+
h as M,
|
|
95
|
+
m as c
|
|
96
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as u, Fragment as h } from "react/jsx-runtime";
|
|
2
2
|
import { useState as i, useContext as P, useEffect as c } from "react";
|
|
3
|
-
import { G as M } from "./index.modern-
|
|
3
|
+
import { G as M } from "./index.modern-CLRs8JwI.js";
|
|
4
4
|
import { a as x } from "./utils-YqJg0vBb.js";
|
|
5
5
|
function f(a, e) {
|
|
6
6
|
switch (a) {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs as f, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as d } from "react";
|
|
3
|
+
import { M as b, N as x, u as M } from "./scale-control-CyJd4u6j.js";
|
|
4
|
+
import { u as m, d as r, a as v } from "./index-DgHrPgsK.js";
|
|
5
|
+
const y = () => {
|
|
6
|
+
const { current: e } = M(), { setBounds: o, setZoom: s } = m(), t = () => {
|
|
7
|
+
var a;
|
|
8
|
+
e && (o((a = e.getBounds()) == null ? void 0 : a.toArray().flat()), s(e.getZoom()));
|
|
9
|
+
};
|
|
10
|
+
return d(() => {
|
|
11
|
+
e && (t(), e.on("move", () => {
|
|
12
|
+
t();
|
|
13
|
+
}));
|
|
14
|
+
}, [e]), null;
|
|
15
|
+
};
|
|
16
|
+
function z({ children: e }) {
|
|
17
|
+
const {
|
|
18
|
+
mapProvider: o,
|
|
19
|
+
center: s,
|
|
20
|
+
zoom: t = r.zoom,
|
|
21
|
+
minZoom: a,
|
|
22
|
+
maxZoom: p,
|
|
23
|
+
pitch: u = r.pitch,
|
|
24
|
+
bearing: l = r.bearing,
|
|
25
|
+
cooperativeGestures: c = r.cooperativeGestures,
|
|
26
|
+
zoomPosition: n
|
|
27
|
+
} = m();
|
|
28
|
+
return o.name !== "mapbox" ? null : /* @__PURE__ */ f(
|
|
29
|
+
b,
|
|
30
|
+
{
|
|
31
|
+
mapboxAccessToken: o.apiKey,
|
|
32
|
+
initialViewState: {
|
|
33
|
+
...s,
|
|
34
|
+
zoom: t,
|
|
35
|
+
pitch: u,
|
|
36
|
+
bearing: l
|
|
37
|
+
},
|
|
38
|
+
cooperativeGestures: c,
|
|
39
|
+
minZoom: a,
|
|
40
|
+
maxZoom: p,
|
|
41
|
+
mapStyle: `mapbox://styles/${o.theme || v.mapbox}`,
|
|
42
|
+
interactiveLayerIds: ["road-label", "waterway-label"],
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ i(y, {}),
|
|
45
|
+
n && /* @__PURE__ */ i(x, { position: n }),
|
|
46
|
+
e
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
z as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as o, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { a } from "./scale-control-CyJd4u6j.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { c as e, S as n, o as r, i as s } from "./styles-D2MYaLhP.js";
|
|
5
|
+
function d({ marker: t }) {
|
|
6
|
+
return /* @__PURE__ */ o(
|
|
7
|
+
a,
|
|
8
|
+
{
|
|
9
|
+
anchor: "bottom",
|
|
10
|
+
longitude: t.longitude,
|
|
11
|
+
latitude: t.latitude,
|
|
12
|
+
className: e.trim(),
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ i(n, {}),
|
|
15
|
+
/* @__PURE__ */ i(r, { className: s })
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
`center-pin-marker-${t.longitude}-${t.latitude}`
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
d as default
|
|
23
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsxs as M, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as b } from "react";
|
|
3
|
+
import { A as C, M as O, C as i, u as P } from "./index.modern-CLRs8JwI.js";
|
|
4
|
+
import { u as p, d as l, a as v } from "./index-DgHrPgsK.js";
|
|
5
|
+
const y = {
|
|
6
|
+
"top-left": i.LEFT_TOP,
|
|
7
|
+
"top-right": i.RIGHT_TOP,
|
|
8
|
+
"bottom-left": i.LEFT_BOTTOM,
|
|
9
|
+
"bottom-right": i.RIGHT_BOTTOM
|
|
10
|
+
}, Z = ({ isMapLoaded: r }) => {
|
|
11
|
+
const o = P(), { setBounds: u, setZoom: t } = p(), a = () => {
|
|
12
|
+
var s;
|
|
13
|
+
if (!o)
|
|
14
|
+
return;
|
|
15
|
+
const e = (s = o.getBounds()) == null ? void 0 : s.toJSON(), n = o.getZoom();
|
|
16
|
+
e && u([e.west, e.south, e.east, e.north]), typeof n < "u" && t(n + 1);
|
|
17
|
+
};
|
|
18
|
+
return b(() => {
|
|
19
|
+
!r || !o || (a(), o.addListener("bounds_changed", () => {
|
|
20
|
+
a();
|
|
21
|
+
}));
|
|
22
|
+
}, [r, o]), null;
|
|
23
|
+
};
|
|
24
|
+
function B({ children: r }) {
|
|
25
|
+
const [o, u] = h(!1), {
|
|
26
|
+
mapProvider: t,
|
|
27
|
+
center: a,
|
|
28
|
+
// Google Maps zoom level starts at 0, so we add 1 to match our defaultMapValues
|
|
29
|
+
zoom: e = l.zoom + 1,
|
|
30
|
+
minZoom: n,
|
|
31
|
+
maxZoom: s,
|
|
32
|
+
pitch: f = l.pitch,
|
|
33
|
+
bearing: c = l.bearing,
|
|
34
|
+
cooperativeGestures: g = l.cooperativeGestures,
|
|
35
|
+
zoomPosition: m
|
|
36
|
+
} = p();
|
|
37
|
+
if (t.name !== "google")
|
|
38
|
+
return null;
|
|
39
|
+
const T = () => {
|
|
40
|
+
u(!0);
|
|
41
|
+
};
|
|
42
|
+
return /* @__PURE__ */ M(C, { apiKey: t.apiKey, children: [
|
|
43
|
+
/* @__PURE__ */ d(Z, { isMapLoaded: o }),
|
|
44
|
+
/* @__PURE__ */ d(
|
|
45
|
+
O,
|
|
46
|
+
{
|
|
47
|
+
mapId: t.theme || v.google,
|
|
48
|
+
defaultCenter: {
|
|
49
|
+
lat: a.latitude,
|
|
50
|
+
lng: a.longitude
|
|
51
|
+
},
|
|
52
|
+
defaultZoom: e,
|
|
53
|
+
defaultTilt: f,
|
|
54
|
+
defaultHeading: c,
|
|
55
|
+
gestureHandling: g ? "cooperative" : "greedy",
|
|
56
|
+
streetViewControl: !1,
|
|
57
|
+
fullscreenControl: !1,
|
|
58
|
+
clickableIcons: !1,
|
|
59
|
+
mapTypeControl: !1,
|
|
60
|
+
zoomControlOptions: {
|
|
61
|
+
position: m && y[m]
|
|
62
|
+
},
|
|
63
|
+
minZoom: typeof n == "number" ? n + 1 : void 0,
|
|
64
|
+
maxZoom: typeof s == "number" ? s + 1 : void 0,
|
|
65
|
+
onTilesLoaded: T,
|
|
66
|
+
children: r
|
|
67
|
+
}
|
|
68
|
+
)
|
|
69
|
+
] });
|
|
70
|
+
}
|
|
71
|
+
export {
|
|
72
|
+
B as default
|
|
73
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as x, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as c } from "react";
|
|
3
|
+
import { u as h, a as L } from "./logo-control-NE-LlsRy.js";
|
|
4
|
+
import { u as b, M as E } from "./index-DgHrPgsK.js";
|
|
5
|
+
import { C as y, c as O, M as $ } from "./index-BYlamtEc.js";
|
|
6
|
+
function N({
|
|
7
|
+
clusters: r,
|
|
8
|
+
colors: a,
|
|
9
|
+
clusterIcon: M,
|
|
10
|
+
markerBounds: m,
|
|
11
|
+
markerBoundsPadding: e,
|
|
12
|
+
onClick: p
|
|
13
|
+
}) {
|
|
14
|
+
const { current: f } = h(), { zoom: u } = b();
|
|
15
|
+
c(() => {
|
|
16
|
+
if (f && m) {
|
|
17
|
+
const [t, i, o, n] = m;
|
|
18
|
+
f.fitBounds(
|
|
19
|
+
[
|
|
20
|
+
[i - e.left, t - e.bottom],
|
|
21
|
+
[n + e.right, o + e.top]
|
|
22
|
+
],
|
|
23
|
+
{
|
|
24
|
+
maxZoom: 17,
|
|
25
|
+
duration: 1e3
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}, [f, m, e]);
|
|
30
|
+
const g = (t) => (i) => {
|
|
31
|
+
i.originalEvent.stopPropagation(), p == null || p(t);
|
|
32
|
+
};
|
|
33
|
+
return r == null ? void 0 : r.map((t, i) => {
|
|
34
|
+
const o = t.geometry.coordinates[0], n = t.geometry.coordinates[1];
|
|
35
|
+
return /* @__PURE__ */ x(
|
|
36
|
+
L,
|
|
37
|
+
{
|
|
38
|
+
anchor: "bottom",
|
|
39
|
+
longitude: o,
|
|
40
|
+
latitude: n,
|
|
41
|
+
onClick: g(t),
|
|
42
|
+
children: [
|
|
43
|
+
t.properties.cluster && /* @__PURE__ */ s(y, { colors: a, icon: M }),
|
|
44
|
+
!t.properties.cluster && /* @__PURE__ */ s(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: O,
|
|
48
|
+
style: {
|
|
49
|
+
"--background": a == null ? void 0 : a.background,
|
|
50
|
+
"--fill": a == null ? void 0 : a.fill
|
|
51
|
+
},
|
|
52
|
+
"data-is-cluster": !!t.properties.cluster,
|
|
53
|
+
"data-is-zoomed-out": u < E,
|
|
54
|
+
children: /* @__PURE__ */ s($, { icon: t.properties.icon })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
`map-marker-${o}-${n}-${i}`
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
N as default
|
|
65
|
+
};
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { P as
|
|
2
|
+
import { P as s } from "./scale-control-CyJd4u6j.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as u } from "./styles-uPzJnzVS.js";
|
|
5
5
|
function l({
|
|
6
6
|
latitude: o,
|
|
7
7
|
longitude: e,
|
|
8
8
|
anchor: r,
|
|
9
|
-
offset:
|
|
10
|
-
onClose:
|
|
11
|
-
children:
|
|
9
|
+
offset: n = [0, -35],
|
|
10
|
+
onClose: t,
|
|
11
|
+
children: f
|
|
12
12
|
}) {
|
|
13
13
|
return typeof o > "u" || typeof e > "u" ? null : /* @__PURE__ */ p(
|
|
14
|
-
|
|
14
|
+
s,
|
|
15
15
|
{
|
|
16
16
|
className: "mapbox-popup",
|
|
17
17
|
focusAfterOpen: !0,
|
|
18
18
|
latitude: o,
|
|
19
19
|
longitude: e,
|
|
20
20
|
anchor: r,
|
|
21
|
-
offset:
|
|
22
|
-
onClose:
|
|
21
|
+
offset: n,
|
|
22
|
+
onClose: t,
|
|
23
23
|
closeButton: !1,
|
|
24
|
-
|
|
24
|
+
closeOnMove: !0,
|
|
25
|
+
children: /* @__PURE__ */ p("div", { className: u, children: f })
|
|
25
26
|
}
|
|
26
27
|
);
|
|
27
28
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsxs as g, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as b } from "react";
|
|
3
|
+
import { u as c, a as h } from "./scale-control-CyJd4u6j.js";
|
|
4
|
+
import { u as L, M as E } from "./index-DgHrPgsK.js";
|
|
5
|
+
import { C as y, c as O, M as $ } from "./index-BYlamtEc.js";
|
|
6
|
+
function N({
|
|
7
|
+
clusters: m,
|
|
8
|
+
colors: a,
|
|
9
|
+
clusterIcon: M,
|
|
10
|
+
markerBoundsPadding: e,
|
|
11
|
+
markerBounds: p,
|
|
12
|
+
onClick: r
|
|
13
|
+
}) {
|
|
14
|
+
const { current: f } = c(), { zoom: u } = L();
|
|
15
|
+
b(() => {
|
|
16
|
+
if (f && p) {
|
|
17
|
+
const [t, i, o, n] = p;
|
|
18
|
+
f.fitBounds(
|
|
19
|
+
[
|
|
20
|
+
[i - e.left, t - e.bottom],
|
|
21
|
+
[n + e.right, o + e.top]
|
|
22
|
+
],
|
|
23
|
+
{
|
|
24
|
+
maxZoom: 17,
|
|
25
|
+
duration: 1e3
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}, [f, p, e]);
|
|
30
|
+
const x = (t) => (i) => {
|
|
31
|
+
i.originalEvent.stopPropagation(), r == null || r(t);
|
|
32
|
+
};
|
|
33
|
+
return m == null ? void 0 : m.map((t, i) => {
|
|
34
|
+
const o = t.geometry.coordinates[0], n = t.geometry.coordinates[1];
|
|
35
|
+
return /* @__PURE__ */ g(
|
|
36
|
+
h,
|
|
37
|
+
{
|
|
38
|
+
anchor: "bottom",
|
|
39
|
+
longitude: o,
|
|
40
|
+
latitude: n,
|
|
41
|
+
onClick: x(t),
|
|
42
|
+
children: [
|
|
43
|
+
t.properties.cluster && /* @__PURE__ */ s(y, { colors: a, icon: M }),
|
|
44
|
+
!t.properties.cluster && /* @__PURE__ */ s(
|
|
45
|
+
"div",
|
|
46
|
+
{
|
|
47
|
+
className: O,
|
|
48
|
+
style: {
|
|
49
|
+
"--background": a == null ? void 0 : a.background,
|
|
50
|
+
"--fill": a == null ? void 0 : a.fill
|
|
51
|
+
},
|
|
52
|
+
"data-is-cluster": !!t.properties.cluster,
|
|
53
|
+
"data-is-zoomed-out": u < E,
|
|
54
|
+
children: /* @__PURE__ */ s($, { icon: t.properties.icon })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
`map-marker-${o}-${n}-${i}`
|
|
60
|
+
);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export {
|
|
64
|
+
N as default
|
|
65
|
+
};
|