@local-logic/maps 0.0.12 → 0.0.13
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-58w3Qwxr.js +56 -0
- package/dist/index-BGoTpJjt.js +81 -0
- package/dist/index-Bp1bWq9c.js +690 -0
- package/dist/{index-DFdfOz0d.js → index-C36u5N_F.js} +1 -1
- package/dist/{index-B3NH4rqN.js → index-CBp9gCca.js} +8 -8
- package/dist/index-CCtDJ-mV.js +56 -0
- package/dist/index-CFomI3Il.js +98 -0
- package/dist/index-CUpaKIZP.js +105 -0
- package/dist/index-CXTsUiSS.js +57 -0
- package/dist/index-CXUQoF5Q.js +34 -0
- package/dist/{index-B9YXnLOH.js → index-DY5pY-zk.js} +11 -10
- package/dist/index-S5SfktvB.js +79 -0
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +75 -75
- package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts +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 +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 +1 -1
- package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/index.d.ts +1 -1
- package/dist/src/components/Map/Root/BaseMap/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/types.d.ts +10 -1
- package/dist/src/components/Map/Root/BaseMap/types.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/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 +0 -11
- package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Popup/Google/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/Popup/index.d.ts +1 -1
- package/dist/src/components/Map/Root/Popup/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.map +1 -1
- package/package.json +1 -1
- package/dist/index-BcpSqK0X.js +0 -74
- package/dist/index-Bd7meO8V.js +0 -783
- package/dist/index-BhldVNew.js +0 -35
- package/dist/index-Bu4XEiYU.js +0 -74
- package/dist/index-CzBPD5Sw.js +0 -73
- package/dist/index-DsrEcQq0.js +0 -71
- package/dist/index-LKvWHhi6.js +0 -53
- package/dist/index-aDlW4ps0.js +0 -50
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as r, jsxs as c, Fragment as g } from "react/jsx-runtime";
|
|
2
2
|
import * as e from "react";
|
|
3
3
|
import { useMemo as Z } from "react";
|
|
4
|
-
import { u as
|
|
5
|
-
import { p
|
|
4
|
+
import { u as A, M as o } from "./index-Bp1bWq9c.js";
|
|
5
|
+
import { p } from "./IconBase.es-rM5tt24D.js";
|
|
6
6
|
const h = /* @__PURE__ */ new Map([
|
|
7
7
|
[
|
|
8
8
|
"bold",
|
|
@@ -34,7 +34,7 @@ const h = /* @__PURE__ */ new Map([
|
|
|
34
34
|
"thin",
|
|
35
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
36
|
]
|
|
37
|
-
]), d = e.forwardRef((t, a) => /* @__PURE__ */ e.createElement(
|
|
37
|
+
]), d = e.forwardRef((t, a) => /* @__PURE__ */ e.createElement(p, { ref: a, ...t, weights: h }));
|
|
38
38
|
d.displayName = "MapPinIcon";
|
|
39
39
|
const m = `
|
|
40
40
|
group/marker cursor-pointer rounded-full
|
|
@@ -65,21 +65,21 @@ const m = `
|
|
|
65
65
|
function v({ icon: t }) {
|
|
66
66
|
return typeof t < "u" ? /* @__PURE__ */ r(t, { className: u }) : /* @__PURE__ */ r(d, { className: u });
|
|
67
67
|
}
|
|
68
|
-
const
|
|
68
|
+
const M = `
|
|
69
69
|
relative flex
|
|
70
70
|
`, s = `
|
|
71
71
|
-ml-6 -z-10 last:-z-20
|
|
72
72
|
`;
|
|
73
|
-
function
|
|
73
|
+
function N({
|
|
74
74
|
isActive: t = !1,
|
|
75
75
|
colors: a,
|
|
76
76
|
icon: f
|
|
77
77
|
}) {
|
|
78
|
-
const { zoom: n, mapProvider: l } =
|
|
78
|
+
const { zoom: n, mapProvider: l } = A(), i = Z(() => l.name === "google" ? n - 1 < o + 1 : n < o, [n, l]);
|
|
79
79
|
return /* @__PURE__ */ c(
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
|
-
className:
|
|
82
|
+
className: M,
|
|
83
83
|
style: {
|
|
84
84
|
"--background": a == null ? void 0 : a.background,
|
|
85
85
|
"--fill": a == null ? void 0 : a.fill
|
|
@@ -103,7 +103,7 @@ function z({
|
|
|
103
103
|
);
|
|
104
104
|
}
|
|
105
105
|
export {
|
|
106
|
-
|
|
106
|
+
N as C,
|
|
107
107
|
v as M,
|
|
108
108
|
m as c
|
|
109
109
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { jsxs as M, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { a as u } from "./logo-control-NE-LlsRy.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { u as _, M as h } from "./index-Bp1bWq9c.js";
|
|
5
|
+
import { C as I, c as O, M as b } from "./index-CBp9gCca.js";
|
|
6
|
+
function $({
|
|
7
|
+
clusters: e,
|
|
8
|
+
colors: t,
|
|
9
|
+
clusterIcon: m,
|
|
10
|
+
onClick: a,
|
|
11
|
+
doesSuperclusterContainActiveMarker: s
|
|
12
|
+
}) {
|
|
13
|
+
const { activeMarker: r, zoom: f } = _(), g = (i) => (o) => {
|
|
14
|
+
o.originalEvent.stopPropagation(), a == null || a(i);
|
|
15
|
+
};
|
|
16
|
+
return e == null ? void 0 : e.map((i, o) => {
|
|
17
|
+
const p = i.geometry.coordinates[0], d = i.geometry.coordinates[1];
|
|
18
|
+
return /* @__PURE__ */ M(
|
|
19
|
+
u,
|
|
20
|
+
{
|
|
21
|
+
anchor: "bottom",
|
|
22
|
+
longitude: p,
|
|
23
|
+
latitude: d,
|
|
24
|
+
onClick: g(i),
|
|
25
|
+
children: [
|
|
26
|
+
i.properties.cluster && i.properties.cluster_id && /* @__PURE__ */ n(
|
|
27
|
+
I,
|
|
28
|
+
{
|
|
29
|
+
colors: t,
|
|
30
|
+
icon: m,
|
|
31
|
+
isActive: s(i.properties.cluster_id)
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
!i.properties.cluster && /* @__PURE__ */ n(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: O,
|
|
38
|
+
style: {
|
|
39
|
+
"--background": t == null ? void 0 : t.background,
|
|
40
|
+
"--fill": t == null ? void 0 : t.fill
|
|
41
|
+
},
|
|
42
|
+
"data-is-cluster": !!i.properties.cluster,
|
|
43
|
+
"data-is-zoomed-out": f < h,
|
|
44
|
+
"data-is-active": (r == null ? void 0 : r.id) === i.properties.id,
|
|
45
|
+
children: /* @__PURE__ */ n(b, { icon: i.properties.icon })
|
|
46
|
+
}
|
|
47
|
+
)
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
`map-marker-${p}-${d}-${o}`
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
$ as default
|
|
56
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function g(t, o, f) {
|
|
2
|
+
if (t !== null)
|
|
3
|
+
for (var i, n, b, h, p, r, c, u = 0, s = 0, C, v = t.type, M = v === "FeatureCollection", k = v === "Feature", w = M ? t.features.length : 1, e = 0; e < w; e++) {
|
|
4
|
+
c = M ? t.features[e].geometry : k ? t.geometry : t, C = c ? c.type === "GeometryCollection" : !1, p = C ? c.geometries.length : 1;
|
|
5
|
+
for (var P = 0; P < p; P++) {
|
|
6
|
+
var l = 0, a = 0;
|
|
7
|
+
if (h = C ? c.geometries[P] : c, h !== null) {
|
|
8
|
+
r = h.coordinates;
|
|
9
|
+
var y = h.type;
|
|
10
|
+
switch (u = 0, y) {
|
|
11
|
+
case null:
|
|
12
|
+
break;
|
|
13
|
+
case "Point":
|
|
14
|
+
if (o(
|
|
15
|
+
r,
|
|
16
|
+
s,
|
|
17
|
+
e,
|
|
18
|
+
l,
|
|
19
|
+
a
|
|
20
|
+
) === !1)
|
|
21
|
+
return !1;
|
|
22
|
+
s++, l++;
|
|
23
|
+
break;
|
|
24
|
+
case "LineString":
|
|
25
|
+
case "MultiPoint":
|
|
26
|
+
for (i = 0; i < r.length; i++) {
|
|
27
|
+
if (o(
|
|
28
|
+
r[i],
|
|
29
|
+
s,
|
|
30
|
+
e,
|
|
31
|
+
l,
|
|
32
|
+
a
|
|
33
|
+
) === !1)
|
|
34
|
+
return !1;
|
|
35
|
+
s++, y === "MultiPoint" && l++;
|
|
36
|
+
}
|
|
37
|
+
y === "LineString" && l++;
|
|
38
|
+
break;
|
|
39
|
+
case "Polygon":
|
|
40
|
+
case "MultiLineString":
|
|
41
|
+
for (i = 0; i < r.length; i++) {
|
|
42
|
+
for (n = 0; n < r[i].length - u; n++) {
|
|
43
|
+
if (o(
|
|
44
|
+
r[i][n],
|
|
45
|
+
s,
|
|
46
|
+
e,
|
|
47
|
+
l,
|
|
48
|
+
a
|
|
49
|
+
) === !1)
|
|
50
|
+
return !1;
|
|
51
|
+
s++;
|
|
52
|
+
}
|
|
53
|
+
y === "MultiLineString" && l++, y === "Polygon" && a++;
|
|
54
|
+
}
|
|
55
|
+
y === "Polygon" && l++;
|
|
56
|
+
break;
|
|
57
|
+
case "MultiPolygon":
|
|
58
|
+
for (i = 0; i < r.length; i++) {
|
|
59
|
+
for (a = 0, n = 0; n < r[i].length; n++) {
|
|
60
|
+
for (b = 0; b < r[i][n].length - u; b++) {
|
|
61
|
+
if (o(
|
|
62
|
+
r[i][n][b],
|
|
63
|
+
s,
|
|
64
|
+
e,
|
|
65
|
+
l,
|
|
66
|
+
a
|
|
67
|
+
) === !1)
|
|
68
|
+
return !1;
|
|
69
|
+
s++;
|
|
70
|
+
}
|
|
71
|
+
a++;
|
|
72
|
+
}
|
|
73
|
+
l++;
|
|
74
|
+
}
|
|
75
|
+
break;
|
|
76
|
+
case "GeometryCollection":
|
|
77
|
+
for (i = 0; i < h.geometries.length; i++)
|
|
78
|
+
if (g(h.geometries[i], o) === !1)
|
|
79
|
+
return !1;
|
|
80
|
+
break;
|
|
81
|
+
default:
|
|
82
|
+
throw new Error("Unknown Geometry Type");
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function G(t, o = {}) {
|
|
89
|
+
if (t.bbox != null && o.recompute !== !0)
|
|
90
|
+
return t.bbox;
|
|
91
|
+
const f = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
|
|
92
|
+
return g(t, (i) => {
|
|
93
|
+
f[0] > i[0] && (f[0] = i[0]), f[1] > i[1] && (f[1] = i[1]), f[2] < i[0] && (f[2] = i[0]), f[3] < i[1] && (f[3] = i[1]);
|
|
94
|
+
}), f;
|
|
95
|
+
}
|
|
96
|
+
export {
|
|
97
|
+
G as b
|
|
98
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { jsxs as v, jsx as T } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useEffect as M } from "react";
|
|
3
|
+
import { A as y, M as L, C as f, u as P } from "./index.modern-CLRs8JwI.js";
|
|
4
|
+
import { b as x } from "./index-CFomI3Il.js";
|
|
5
|
+
import { u as b, d as p, a as B, m as O } from "./index-Bp1bWq9c.js";
|
|
6
|
+
const Z = {
|
|
7
|
+
"top-left": f.LEFT_TOP,
|
|
8
|
+
"top-right": f.RIGHT_TOP,
|
|
9
|
+
"bottom-left": f.LEFT_BOTTOM,
|
|
10
|
+
"bottom-right": f.RIGHT_BOTTOM
|
|
11
|
+
}, z = ({
|
|
12
|
+
isMapLoaded: c,
|
|
13
|
+
padding: u
|
|
14
|
+
}) => {
|
|
15
|
+
const e = P(), { markerPoints: s, setBounds: r, setZoom: d } = b(), [n, l] = h(void 0), i = () => {
|
|
16
|
+
var t;
|
|
17
|
+
if (!e)
|
|
18
|
+
return;
|
|
19
|
+
const o = (t = e.getBounds()) == null ? void 0 : t.toJSON();
|
|
20
|
+
o && r([o.west, o.south, o.east, o.north]);
|
|
21
|
+
}, m = () => {
|
|
22
|
+
if (!e)
|
|
23
|
+
return;
|
|
24
|
+
const o = e.getZoom();
|
|
25
|
+
typeof o < "u" && d(o + 1);
|
|
26
|
+
};
|
|
27
|
+
return M(() => {
|
|
28
|
+
i(), m();
|
|
29
|
+
const o = e == null ? void 0 : e.addListener("bounds_changed", () => {
|
|
30
|
+
i();
|
|
31
|
+
}), t = e == null ? void 0 : e.addListener("zoom_changed", () => {
|
|
32
|
+
m();
|
|
33
|
+
});
|
|
34
|
+
return () => {
|
|
35
|
+
o == null || o.remove(), t == null || t.remove();
|
|
36
|
+
};
|
|
37
|
+
}, [e]), M(() => {
|
|
38
|
+
if (!e || typeof s > "u" || s.length === 0)
|
|
39
|
+
return;
|
|
40
|
+
const o = x(O(s));
|
|
41
|
+
o.every((t, a) => t === (n == null ? void 0 : n[a])) || l(o);
|
|
42
|
+
}, [e, s]), M(() => {
|
|
43
|
+
if (!e || typeof n > "u")
|
|
44
|
+
return;
|
|
45
|
+
const [o, t, a, g] = n;
|
|
46
|
+
e.fitBounds(
|
|
47
|
+
{
|
|
48
|
+
south: o,
|
|
49
|
+
west: t,
|
|
50
|
+
north: a,
|
|
51
|
+
east: g
|
|
52
|
+
},
|
|
53
|
+
u
|
|
54
|
+
);
|
|
55
|
+
}, [c, e, n, u]), null;
|
|
56
|
+
};
|
|
57
|
+
function E({ padding: c, children: u }) {
|
|
58
|
+
const [e, s] = h(!1), {
|
|
59
|
+
mapProvider: r,
|
|
60
|
+
center: d,
|
|
61
|
+
zoom: n = p.zoom,
|
|
62
|
+
minZoom: l,
|
|
63
|
+
maxZoom: i,
|
|
64
|
+
pitch: m = p.pitch,
|
|
65
|
+
bearing: o = p.bearing,
|
|
66
|
+
cooperativeGestures: t = p.cooperativeGestures,
|
|
67
|
+
zoomPosition: a
|
|
68
|
+
} = b();
|
|
69
|
+
if (r.name !== "google")
|
|
70
|
+
return null;
|
|
71
|
+
const g = () => {
|
|
72
|
+
s(!0);
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ v(y, { apiKey: r.apiKey, children: [
|
|
75
|
+
/* @__PURE__ */ T(z, { isMapLoaded: e, padding: c }),
|
|
76
|
+
/* @__PURE__ */ T(
|
|
77
|
+
L,
|
|
78
|
+
{
|
|
79
|
+
mapId: r.theme || B.google,
|
|
80
|
+
defaultCenter: {
|
|
81
|
+
lat: d.latitude,
|
|
82
|
+
lng: d.longitude
|
|
83
|
+
},
|
|
84
|
+
defaultZoom: n + 1,
|
|
85
|
+
defaultTilt: m,
|
|
86
|
+
defaultHeading: o,
|
|
87
|
+
gestureHandling: t ? "cooperative" : "greedy",
|
|
88
|
+
streetViewControl: !1,
|
|
89
|
+
fullscreenControl: !1,
|
|
90
|
+
clickableIcons: !1,
|
|
91
|
+
mapTypeControl: !1,
|
|
92
|
+
zoomControlOptions: {
|
|
93
|
+
position: a && Z[a]
|
|
94
|
+
},
|
|
95
|
+
minZoom: typeof l == "number" ? l + 1 : void 0,
|
|
96
|
+
maxZoom: typeof i == "number" ? i + 1 : void 0,
|
|
97
|
+
onTilesLoaded: g,
|
|
98
|
+
children: u
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] });
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
E as default
|
|
105
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { u as M, a as I } from "./index.modern-CLRs8JwI.js";
|
|
3
|
+
import { u as O, M as _ } from "./index-Bp1bWq9c.js";
|
|
4
|
+
import { C as h, c as k, M as v } from "./index-CBp9gCca.js";
|
|
5
|
+
function $({
|
|
6
|
+
clusters: i,
|
|
7
|
+
colors: a,
|
|
8
|
+
clusterIcon: d,
|
|
9
|
+
onClick: t,
|
|
10
|
+
doesSuperclusterContainActiveMarker: m
|
|
11
|
+
}) {
|
|
12
|
+
M();
|
|
13
|
+
const { activeMarker: n, zoom: s } = O(), f = (e) => () => {
|
|
14
|
+
t == null || t(e);
|
|
15
|
+
};
|
|
16
|
+
return i == null ? void 0 : i.map((e, g) => {
|
|
17
|
+
const o = e.geometry.coordinates[0], p = e.geometry.coordinates[1];
|
|
18
|
+
return /* @__PURE__ */ u(
|
|
19
|
+
I,
|
|
20
|
+
{
|
|
21
|
+
position: {
|
|
22
|
+
lat: p,
|
|
23
|
+
lng: o
|
|
24
|
+
},
|
|
25
|
+
onClick: f(e),
|
|
26
|
+
children: [
|
|
27
|
+
e.properties.cluster && /* @__PURE__ */ r(
|
|
28
|
+
h,
|
|
29
|
+
{
|
|
30
|
+
colors: a,
|
|
31
|
+
icon: d,
|
|
32
|
+
isActive: m(e.properties.cluster_id)
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
!e.properties.cluster && /* @__PURE__ */ r(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
className: k,
|
|
39
|
+
style: {
|
|
40
|
+
"--background": a == null ? void 0 : a.background,
|
|
41
|
+
"--fill": a == null ? void 0 : a.fill
|
|
42
|
+
},
|
|
43
|
+
"data-is-cluster": !!e.properties.cluster,
|
|
44
|
+
"data-is-zoomed-out": s - 1 < _ + 1,
|
|
45
|
+
"data-is-active": (n == null ? void 0 : n.id) === e.properties.id,
|
|
46
|
+
children: /* @__PURE__ */ r(v, { icon: e.properties.icon })
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
]
|
|
50
|
+
},
|
|
51
|
+
`map-marker-${o}-${p}-${g}`
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export {
|
|
56
|
+
$ as default
|
|
57
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as a } from "react";
|
|
3
|
+
import { P as i } from "./logo-control-NE-LlsRy.js";
|
|
4
|
+
import { u as c } from "./index-Bp1bWq9c.js";
|
|
5
|
+
import { c as n } from "./styles-ChFj97uV.js";
|
|
6
|
+
function y({
|
|
7
|
+
latitude: e,
|
|
8
|
+
longitude: t,
|
|
9
|
+
anchor: f,
|
|
10
|
+
offset: m = [0, -35],
|
|
11
|
+
onClose: r,
|
|
12
|
+
children: o
|
|
13
|
+
}) {
|
|
14
|
+
const { zoom: u } = c();
|
|
15
|
+
return a(() => {
|
|
16
|
+
r == null || r();
|
|
17
|
+
}, [u]), typeof e > "u" || typeof t > "u" ? null : /* @__PURE__ */ p(
|
|
18
|
+
i,
|
|
19
|
+
{
|
|
20
|
+
className: "maplibre-popup",
|
|
21
|
+
focusAfterOpen: !0,
|
|
22
|
+
latitude: e,
|
|
23
|
+
longitude: t,
|
|
24
|
+
anchor: f,
|
|
25
|
+
offset: m,
|
|
26
|
+
onClose: r,
|
|
27
|
+
closeButton: !1,
|
|
28
|
+
children: /* @__PURE__ */ p("div", { className: n, children: o })
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
y as default
|
|
34
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useEffect as
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as a, useMemo as f } from "react";
|
|
3
3
|
import { u as o, I as s } from "./index.modern-CLRs8JwI.js";
|
|
4
|
-
import { u as y } from "./index-
|
|
4
|
+
import { u as y } from "./index-Bp1bWq9c.js";
|
|
5
5
|
import { c as x } from "./styles-ChFj97uV.js";
|
|
6
|
-
function
|
|
6
|
+
function I({
|
|
7
7
|
latitude: u,
|
|
8
8
|
longitude: e,
|
|
9
9
|
offset: t = [0, -25],
|
|
10
10
|
onClose: r,
|
|
11
|
-
children:
|
|
11
|
+
children: m
|
|
12
12
|
}) {
|
|
13
13
|
const i = o(), { zoom: p } = y();
|
|
14
|
-
|
|
14
|
+
a(() => {
|
|
15
15
|
r == null || r();
|
|
16
|
-
}, [p]),
|
|
16
|
+
}, [p]), a(() => {
|
|
17
17
|
if (!i) return;
|
|
18
18
|
const d = i.addListener("click", () => {
|
|
19
19
|
r == null || r();
|
|
@@ -23,20 +23,21 @@ function M({
|
|
|
23
23
|
};
|
|
24
24
|
}, [i]);
|
|
25
25
|
const c = f(() => Array.isArray(t) ? [t[0], t[1]] : [t, t], [t]);
|
|
26
|
-
return typeof u > "u" || typeof e > "u" ? null : /* @__PURE__ */
|
|
26
|
+
return typeof u > "u" || typeof e > "u" ? null : /* @__PURE__ */ n(
|
|
27
27
|
s,
|
|
28
28
|
{
|
|
29
29
|
shouldFocus: !0,
|
|
30
|
+
disableAutoPan: !0,
|
|
30
31
|
position: {
|
|
31
32
|
lat: u,
|
|
32
33
|
lng: e
|
|
33
34
|
},
|
|
34
35
|
pixelOffset: c,
|
|
35
36
|
onClose: r,
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ n("div", { className: x, children: m })
|
|
37
38
|
}
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
export {
|
|
41
|
-
|
|
42
|
+
I as default
|
|
42
43
|
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsxs as x, jsx as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as y, useEffect as c } from "react";
|
|
3
|
+
import { M as g, N as h, u as b } from "./logo-control-NE-LlsRy.js";
|
|
4
|
+
import { b as B } from "./index-CFomI3Il.js";
|
|
5
|
+
import { u as M, d as u, a as Z, m as z } from "./index-Bp1bWq9c.js";
|
|
6
|
+
const L = ({ padding: i }) => {
|
|
7
|
+
const { current: o } = b(), { markerPoints: n, setBounds: m, setZoom: f } = M(), [r, p] = y(void 0), s = () => {
|
|
8
|
+
var e;
|
|
9
|
+
if (!o)
|
|
10
|
+
return;
|
|
11
|
+
const t = (e = o.getBounds()) == null ? void 0 : e.toArray().flat();
|
|
12
|
+
t && m(t);
|
|
13
|
+
}, a = () => {
|
|
14
|
+
o && f(o.getZoom());
|
|
15
|
+
};
|
|
16
|
+
return c(() => (s(), a(), o == null || o.on("move", () => {
|
|
17
|
+
s();
|
|
18
|
+
}), o == null || o.on("zoom", () => {
|
|
19
|
+
a();
|
|
20
|
+
}), () => {
|
|
21
|
+
o == null || o.off("move", s), o == null || o.off("zoom", a);
|
|
22
|
+
}), [o]), c(() => {
|
|
23
|
+
if (!o || typeof n > "u" || n.length === 0)
|
|
24
|
+
return;
|
|
25
|
+
const t = B(z(n));
|
|
26
|
+
t.every((e, l) => e === (r == null ? void 0 : r[l])) || p(t);
|
|
27
|
+
}, [o, n]), c(() => {
|
|
28
|
+
if (!o || typeof r > "u")
|
|
29
|
+
return;
|
|
30
|
+
const [t, e, l, v] = r;
|
|
31
|
+
o.fitBounds(
|
|
32
|
+
[
|
|
33
|
+
[e, t],
|
|
34
|
+
[v, l]
|
|
35
|
+
],
|
|
36
|
+
{
|
|
37
|
+
maxZoom: 17,
|
|
38
|
+
duration: 700,
|
|
39
|
+
padding: i
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}, [o, r, i]), null;
|
|
43
|
+
};
|
|
44
|
+
function C({ padding: i, children: o }) {
|
|
45
|
+
const {
|
|
46
|
+
mapProvider: n,
|
|
47
|
+
center: m,
|
|
48
|
+
zoom: f = u.zoom,
|
|
49
|
+
minZoom: r,
|
|
50
|
+
maxZoom: p,
|
|
51
|
+
pitch: s = u.pitch,
|
|
52
|
+
bearing: a = u.bearing,
|
|
53
|
+
cooperativeGestures: t = u.cooperativeGestures,
|
|
54
|
+
zoomPosition: e
|
|
55
|
+
} = M();
|
|
56
|
+
return n.name !== "maptiler" ? null : /* @__PURE__ */ x(
|
|
57
|
+
g,
|
|
58
|
+
{
|
|
59
|
+
initialViewState: {
|
|
60
|
+
...m,
|
|
61
|
+
zoom: f,
|
|
62
|
+
pitch: s,
|
|
63
|
+
bearing: a
|
|
64
|
+
},
|
|
65
|
+
cooperativeGestures: t,
|
|
66
|
+
minZoom: r,
|
|
67
|
+
maxZoom: p,
|
|
68
|
+
mapStyle: `https://api.maptiler.com/maps/${n.theme || Z.maptiler}/style.json?key=${n.apiKey}`,
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ d(L, { padding: i }),
|
|
71
|
+
e && /* @__PURE__ */ d(h, { position: e }),
|
|
72
|
+
o
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
C as default
|
|
79
|
+
};
|
package/dist/index.es.js
CHANGED