@local-logic/maps 0.0.20 → 0.0.22

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.
Files changed (50) hide show
  1. package/dist/index-B85VZGVP.js +56 -0
  2. package/dist/index-BRD3rjLE.js +138 -0
  3. package/dist/index-BpFpg_5A.js +78 -0
  4. package/dist/index-BrxP9NHZ.js +56 -0
  5. package/dist/{index-DiCaFCSI.js → index-CN_dNOir.js} +168 -172
  6. package/dist/index-CRdDPWou.js +34 -0
  7. package/dist/{index-Dz1XJJEv.js → index-CSVsF1EQ.js} +28 -28
  8. package/dist/index-CceEGv05.js +104 -0
  9. package/dist/index-CiWKwaC4.js +23 -0
  10. package/dist/{index-h41HdBg1.js → index-CmajMf1d.js} +21 -21
  11. package/dist/index-D5kHxP9H.js +43 -0
  12. package/dist/index-DNNz78Rc.js +24 -0
  13. package/dist/index-Db33Ugg9.js +34 -0
  14. package/dist/index-DfhwDiOS.js +155 -0
  15. package/dist/index-arkRlpaR.js +80 -0
  16. package/dist/index-ufLC1PLO.js +57 -0
  17. package/dist/index-vHMPqmOL.js +23 -0
  18. package/dist/index.es.js +1 -1
  19. package/dist/{index.modern-fpUBOYPT.js → index.modern-B-ChKejQ.js} +9 -9
  20. package/dist/index.umd.js +148 -148
  21. package/dist/{logo-control-C5ZdRec5.js → logo-control-VgN6MEKI.js} +186 -206
  22. package/dist/{mapbox-gl-D6JObe4m.js → mapbox-gl-C6frO4Gl.js} +1877 -1877
  23. package/dist/{maplibre-gl-DDfJU6SR.js → maplibre-gl-DkDrZ6rP.js} +1230 -1228
  24. package/dist/{scale-control-Cflgzbvb.js → scale-control-jBKptTbw.js} +234 -252
  25. package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts +1 -1
  26. package/dist/src/components/Map/Root/CenterPin/Google/index.d.ts.map +1 -1
  27. package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts +1 -1
  28. package/dist/src/components/Map/Root/CenterPin/Mapbox/index.d.ts.map +1 -1
  29. package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts +1 -1
  30. package/dist/src/components/Map/Root/CenterPin/Maptiler/index.d.ts.map +1 -1
  31. package/dist/src/components/Map/Root/CenterPin/types.d.ts +1 -0
  32. package/dist/src/components/Map/Root/CenterPin/types.d.ts.map +1 -1
  33. package/dist/style.css +1 -1
  34. package/dist/styles-BR85tnqI.js +2771 -0
  35. package/package.json +3 -2
  36. package/dist/index-B8fs8nrA.js +0 -79
  37. package/dist/index-B8yUQ1_f.js +0 -23
  38. package/dist/index-BG_F5Dkz.js +0 -23
  39. package/dist/index-BQ20UVWH.js +0 -34
  40. package/dist/index-C-sxmk7l.js +0 -81
  41. package/dist/index-C7cTTXxY.js +0 -24
  42. package/dist/index-CHSsiFtN.js +0 -139
  43. package/dist/index-CSNuLBAd.js +0 -105
  44. package/dist/index-D0-MIbts.js +0 -43
  45. package/dist/index-D8HDei0S.js +0 -34
  46. package/dist/index-DD3i8r0F.js +0 -56
  47. package/dist/index-DHHG0vNa.js +0 -157
  48. package/dist/index-LU2s85nk.js +0 -57
  49. package/dist/index-oYRVzSxJ.js +0 -56
  50. package/dist/styles-Do-o-qNU.js +0 -48
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@local-logic/maps",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "description": "This is a maps implementation allowing for the display of Local Logic data on a map.",
5
5
  "author": "Local Logic",
6
6
  "license": "ISC",
@@ -72,7 +72,7 @@
72
72
  "tailwindcss": "^3.4.17",
73
73
  "tsconfig": "*",
74
74
  "typescript": "^5.9.2",
75
- "vite": "^6.3.6",
75
+ "vite": "^7.0.7",
76
76
  "vite-plugin-dts": "^4.5.4",
77
77
  "vite-plugin-svgr": "^4.3.0",
78
78
  "vitest": "^3.2.4"
@@ -86,6 +86,7 @@
86
86
  "maplibre-gl": "^5.9.0",
87
87
  "react-map-gl": "^8.1.0",
88
88
  "supercluster": "^8.0.1",
89
+ "tailwind-merge": "^3.3.1",
89
90
  "use-supercluster": "^1.2.0"
90
91
  }
91
92
  }
@@ -1,79 +0,0 @@
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-C5ZdRec5.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-DiCaFCSI.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
- };
@@ -1,23 +0,0 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { a as o } from "./scale-control-Cflgzbvb.js";
3
- import "react";
4
- import { c as n, b as e, S as r, o as s, i as c } from "./styles-Do-o-qNU.js";
5
- function p({ marker: t }) {
6
- return /* @__PURE__ */ i(
7
- o,
8
- {
9
- anchor: "bottom",
10
- longitude: t.longitude,
11
- latitude: t.latitude,
12
- className: n.trim(),
13
- children: [
14
- /* @__PURE__ */ a("span", { className: e, children: /* @__PURE__ */ a(r, {}) }),
15
- /* @__PURE__ */ a(s, { className: c })
16
- ]
17
- },
18
- `center-pin-marker-${t.longitude}-${t.latitude}`
19
- );
20
- }
21
- export {
22
- p as default
23
- };
@@ -1,23 +0,0 @@
1
- import { jsxs as i, jsx as a } from "react/jsx-runtime";
2
- import { a as e } from "./logo-control-C5ZdRec5.js";
3
- import "react";
4
- import { c as n, b as o, S as r, o as s, i as l } from "./styles-Do-o-qNU.js";
5
- function p({ marker: t }) {
6
- return /* @__PURE__ */ i(
7
- e,
8
- {
9
- anchor: "bottom",
10
- longitude: t.longitude,
11
- latitude: t.latitude,
12
- className: n.trim(),
13
- children: [
14
- /* @__PURE__ */ a("span", { className: o, children: /* @__PURE__ */ a(r, {}) }),
15
- /* @__PURE__ */ a(s, { className: l })
16
- ]
17
- },
18
- `center-pin-marker-${t.longitude}-${t.latitude}`
19
- );
20
- }
21
- export {
22
- p as default
23
- };
@@ -1,34 +0,0 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import { useEffect as a } from "react";
3
- import { P as i } from "./logo-control-C5ZdRec5.js";
4
- import { u as c } from "./index-DiCaFCSI.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,81 +0,0 @@
1
- import { jsxs as M, jsx as d } from "react/jsx-runtime";
2
- import { useState as v, useEffect as l } from "react";
3
- import { M as y, N as g, u as h } from "./scale-control-Cflgzbvb.js";
4
- import { b as B } from "./index-CFomI3Il.js";
5
- import { u as b, d as u, a as Z, m as z } from "./index-DiCaFCSI.js";
6
- const L = ({ padding: i }) => {
7
- const { current: o } = h(), { markerPoints: n, setBounds: m, setZoom: f } = b(), [r, p] = v(void 0), a = () => {
8
- var t;
9
- if (!o)
10
- return;
11
- const e = (t = o.getBounds()) == null ? void 0 : t.toArray().flat();
12
- e && m(e);
13
- }, s = () => {
14
- o && f(o.getZoom());
15
- };
16
- return l(() => (a(), s(), o == null || o.on("move", () => {
17
- a();
18
- }), o == null || o.on("zoom", () => {
19
- s();
20
- }), () => {
21
- o == null || o.off("move", a), o == null || o.off("zoom", s);
22
- }), [o]), l(() => {
23
- if (!o || typeof n > "u" || n.length === 0)
24
- return;
25
- const e = B(z(n));
26
- e.every((t, c) => t === (r == null ? void 0 : r[c])) || p(e);
27
- }, [o, n]), l(() => {
28
- if (!o || typeof r > "u")
29
- return;
30
- const [e, t, c, x] = r;
31
- o.fitBounds(
32
- [
33
- [t, e],
34
- [x, c]
35
- ],
36
- {
37
- maxZoom: 17,
38
- duration: 700,
39
- padding: i
40
- }
41
- );
42
- }, [o, r, i]), null;
43
- };
44
- function A({ 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: a = u.pitch,
52
- bearing: s = u.bearing,
53
- cooperativeGestures: e = u.cooperativeGestures,
54
- zoomPosition: t
55
- } = b();
56
- return n.name !== "mapbox" ? null : /* @__PURE__ */ M(
57
- y,
58
- {
59
- mapboxAccessToken: n.apiKey,
60
- initialViewState: {
61
- ...m,
62
- zoom: f,
63
- pitch: a,
64
- bearing: s
65
- },
66
- cooperativeGestures: e,
67
- minZoom: r,
68
- maxZoom: p,
69
- mapStyle: `mapbox://styles/${n.theme || Z.mapbox}`,
70
- interactiveLayerIds: ["road-label", "waterway-label"],
71
- children: [
72
- /* @__PURE__ */ d(L, { padding: i }),
73
- t && /* @__PURE__ */ d(g, { position: t }),
74
- o
75
- ]
76
- }
77
- );
78
- }
79
- export {
80
- A as default
81
- };
@@ -1,24 +0,0 @@
1
- import { jsxs as e, jsx as a } from "react/jsx-runtime";
2
- import { a as i } from "./index.modern-fpUBOYPT.js";
3
- import { c as t, b as o, S as s, o as r, i as l } from "./styles-Do-o-qNU.js";
4
- function u({ marker: n }) {
5
- return /* @__PURE__ */ e(
6
- i,
7
- {
8
- position: {
9
- lat: n.latitude,
10
- lng: n.longitude
11
- },
12
- className: t.trim(),
13
- zIndex: 10,
14
- children: [
15
- /* @__PURE__ */ a("span", { className: o, children: /* @__PURE__ */ a(s, {}) }),
16
- /* @__PURE__ */ a(r, { className: l })
17
- ]
18
- },
19
- `center-pin-marker-${n.longitude}-${n.latitude}`
20
- );
21
- }
22
- export {
23
- u as default
24
- };
@@ -1,139 +0,0 @@
1
- import { jsx as u, Fragment as b } from "react/jsx-runtime";
2
- import * as $ from "react";
3
- import { useContext as S, useRef as k, useState as C, useMemo as m, useEffect as w, cloneElement as j } from "react";
4
- import { b as x, d as s } from "./scale-control-Cflgzbvb.js";
5
- import { g as I } from "./utils-DJ13veBM.js";
6
- function g(t, e) {
7
- if (!t)
8
- throw new Error(e);
9
- }
10
- let M = 0;
11
- function U(t, e, n) {
12
- if (t.style && t.style._loaded) {
13
- const a = { ...n };
14
- return delete a.id, delete a.children, t.addSource(e, a), t.getSource(e);
15
- }
16
- return null;
17
- }
18
- function z(t, e, n) {
19
- g(e.id === n.id, "source id changed"), g(e.type === n.type, "source type changed");
20
- let a = "", i = 0;
21
- for (const l in e)
22
- l !== "children" && l !== "id" && !s(n[l], e[l]) && (a = l, i++);
23
- if (!i)
24
- return;
25
- const r = e.type;
26
- r === "geojson" ? t.setData(e.data) : r === "image" ? t.updateImage({
27
- url: e.url,
28
- coordinates: e.coordinates
29
- }) : "setCoordinates" in t && i === 1 && a === "coordinates" ? t.setCoordinates(e.coordinates) : "setUrl" in t && a === "url" ? t.setUrl(e.url) : "setTiles" in t && a === "tiles" ? t.setTiles(e.tiles) : console.warn(`Unable to update <Source> prop: ${a}`);
30
- }
31
- function A(t) {
32
- const e = S(x).map.getMap(), n = k(t), [, a] = C(0), i = m(() => t.id || `jsx-source-${M++}`, []);
33
- w(() => {
34
- if (e) {
35
- const l = () => setTimeout(() => a((y) => y + 1), 0);
36
- return e.on("styledata", l), l(), () => {
37
- var y;
38
- if (e.off("styledata", l), e.style && e.style._loaded && e.getSource(i)) {
39
- const f = (y = e.getStyle()) == null ? void 0 : y.layers;
40
- if (f)
41
- for (const d of f)
42
- d.source === i && e.removeLayer(d.id);
43
- e.removeSource(i);
44
- }
45
- };
46
- }
47
- }, [e]);
48
- let r = e && e.style && e.getSource(i);
49
- return r ? z(r, t, n.current) : r = U(e, i, t), n.current = t, r && $.Children.map(t.children, (l) => l && j(l, {
50
- source: i
51
- })) || null;
52
- }
53
- function E(t, e, n, a) {
54
- if (g(n.id === a.id, "layer id changed"), g(n.type === a.type, "layer type changed"), n.type === "custom" || a.type === "custom")
55
- return;
56
- const { layout: i = {}, paint: r = {}, filter: l, minzoom: y, maxzoom: f, beforeId: d } = n;
57
- if (d !== a.beforeId && t.moveLayer(e, d), i !== a.layout) {
58
- const c = a.layout || {};
59
- for (const o in i)
60
- s(i[o], c[o]) || t.setLayoutProperty(e, o, i[o]);
61
- for (const o in c)
62
- i.hasOwnProperty(o) || t.setLayoutProperty(e, o, void 0);
63
- }
64
- if (r !== a.paint) {
65
- const c = a.paint || {};
66
- for (const o in r)
67
- s(r[o], c[o]) || t.setPaintProperty(e, o, r[o]);
68
- for (const o in c)
69
- r.hasOwnProperty(o) || t.setPaintProperty(e, o, void 0);
70
- }
71
- s(l, a.filter) || t.setFilter(e, l), (y !== a.minzoom || f !== a.maxzoom) && t.setLayerZoomRange(e, y, f);
72
- }
73
- function F(t, e, n) {
74
- if (t.style && t.style._loaded && (!("source" in n) || t.getSource(n.source))) {
75
- const a = { ...n, id: e };
76
- delete a.beforeId, t.addLayer(a, n.beforeId);
77
- }
78
- }
79
- let R = 0;
80
- function L(t) {
81
- const e = S(x).map.getMap(), n = k(t), [, a] = C(0), i = m(() => t.id || `jsx-layer-${R++}`, []);
82
- if (w(() => {
83
- if (e) {
84
- const l = () => a((y) => y + 1);
85
- return e.on("styledata", l), l(), () => {
86
- e.off("styledata", l), e.style && e.style._loaded && e.getLayer(i) && e.removeLayer(i);
87
- };
88
- }
89
- }, [e]), e && e.style && e.getLayer(i))
90
- try {
91
- E(e, i, t, n.current);
92
- } catch (l) {
93
- console.warn(l);
94
- }
95
- else
96
- F(e, i, t);
97
- return n.current = t, null;
98
- }
99
- function h(t, e, n) {
100
- switch (t) {
101
- case "fill":
102
- return {
103
- "fill-color": e,
104
- "fill-opacity": 0.25
105
- };
106
- case "line":
107
- return {
108
- "line-color": e,
109
- "line-width": n === "LineString" ? 6 : 2
110
- };
111
- default:
112
- return {};
113
- }
114
- }
115
- function O({ sources: t }) {
116
- const e = m(() => !Array.isArray(t) || t.length === 0 ? [] : t.map((n) => ({
117
- ...n,
118
- geoJson: n.geometry ? I(n.geometry, n.type) : null
119
- })), [t]);
120
- return (e == null ? void 0 : e.length) === 0 ? null : /* @__PURE__ */ u(b, { children: e == null ? void 0 : e.map((n) => /* @__PURE__ */ u("div", { children: n.geoJson && /* @__PURE__ */ u(A, { id: n.key, type: "geojson", data: n.geoJson, children: n.layer && (Array.isArray(n.layer) ? n.layer.map((a, i) => /* @__PURE__ */ u(
121
- L,
122
- {
123
- id: `${n.key}-${i}`,
124
- type: a.type,
125
- paint: h(a.type, a.color, n.type)
126
- },
127
- `${n.key}-${i}`
128
- )) : /* @__PURE__ */ u(
129
- L,
130
- {
131
- id: n.key,
132
- type: n.layer.type,
133
- paint: h(n.layer.type, n.layer.color, n.type)
134
- }
135
- )) }, n.key) }, n.key)) });
136
- }
137
- export {
138
- O as default
139
- };
@@ -1,105 +0,0 @@
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-fpUBOYPT.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-DiCaFCSI.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
- };
@@ -1,43 +0,0 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useEffect as a, useMemo as f } from "react";
3
- import { u as o, I as s } from "./index.modern-fpUBOYPT.js";
4
- import { u as y } from "./index-DiCaFCSI.js";
5
- import { c as x } from "./styles-ChFj97uV.js";
6
- function I({
7
- latitude: u,
8
- longitude: e,
9
- offset: t = [0, -25],
10
- onClose: r,
11
- children: m
12
- }) {
13
- const i = o(), { zoom: p } = y();
14
- a(() => {
15
- r == null || r();
16
- }, [p]), a(() => {
17
- if (!i) return;
18
- const d = i.addListener("click", () => {
19
- r == null || r();
20
- });
21
- return () => {
22
- d.remove();
23
- };
24
- }, [i]);
25
- const c = f(() => Array.isArray(t) ? [t[0], t[1]] : [t, t], [t]);
26
- return typeof u > "u" || typeof e > "u" ? null : /* @__PURE__ */ n(
27
- s,
28
- {
29
- shouldFocus: !0,
30
- disableAutoPan: !0,
31
- position: {
32
- lat: u,
33
- lng: e
34
- },
35
- pixelOffset: c,
36
- onClose: r,
37
- children: /* @__PURE__ */ n("div", { className: x, children: m })
38
- }
39
- );
40
- }
41
- export {
42
- I as default
43
- };
@@ -1,34 +0,0 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { useEffect as a } from "react";
3
- import { P as c } from "./scale-control-Cflgzbvb.js";
4
- import { u as i } from "./index-DiCaFCSI.js";
5
- import { c as n } from "./styles-ChFj97uV.js";
6
- function l({
7
- latitude: p,
8
- longitude: t,
9
- anchor: f,
10
- offset: o = [0, -35],
11
- onClose: r,
12
- children: m
13
- }) {
14
- const { zoom: u } = i();
15
- return a(() => {
16
- r == null || r();
17
- }, [u]), typeof p > "u" || typeof t > "u" ? null : /* @__PURE__ */ e(
18
- c,
19
- {
20
- className: "mapbox-popup",
21
- focusAfterOpen: !0,
22
- latitude: p,
23
- longitude: t,
24
- anchor: f,
25
- offset: o,
26
- onClose: r,
27
- closeButton: !1,
28
- children: /* @__PURE__ */ e("div", { className: n, children: m })
29
- }
30
- );
31
- }
32
- export {
33
- l as default
34
- };
@@ -1,56 +0,0 @@
1
- import { jsxs as M, jsx as p } from "react/jsx-runtime";
2
- import { a as u } from "./logo-control-C5ZdRec5.js";
3
- import "react";
4
- import { u as _, M as b } from "./index-DiCaFCSI.js";
5
- import { C as h, c as k, M as I } from "./index-h41HdBg1.js";
6
- function N({
7
- clusters: t,
8
- colors: e,
9
- clusterIcon: m,
10
- onClick: a,
11
- doesSuperclusterContainActiveMarker: s
12
- }) {
13
- const { activeMarker: r, zoom: f } = _(), g = (i) => (o) => {
14
- o.originalEvent.stopPropagation(), !i.properties.disableClick && (a == null || a(i));
15
- };
16
- return t == null ? void 0 : t.map((i, o) => {
17
- const n = i.geometry.coordinates[0], d = i.geometry.coordinates[1];
18
- return /* @__PURE__ */ M(
19
- u,
20
- {
21
- anchor: "bottom",
22
- longitude: n,
23
- latitude: d,
24
- onClick: g(i),
25
- children: [
26
- i.properties.cluster && i.properties.cluster_id && /* @__PURE__ */ p(
27
- h,
28
- {
29
- colors: e,
30
- icon: m,
31
- isActive: s(i.properties.cluster_id)
32
- }
33
- ),
34
- !i.properties.cluster && /* @__PURE__ */ p(
35
- "div",
36
- {
37
- className: k,
38
- style: i.properties.defaultColor ? {} : {
39
- "--background": e == null ? void 0 : e.background,
40
- "--fill": e == null ? void 0 : e.fill
41
- },
42
- "data-is-cluster": !!i.properties.cluster,
43
- "data-is-zoomed-out": f < b,
44
- "data-is-active": (r == null ? void 0 : r.id) === i.properties.id,
45
- children: /* @__PURE__ */ p(I, { icon: i.properties.icon })
46
- }
47
- )
48
- ]
49
- },
50
- `map-marker-${n}-${d}-${o}`
51
- );
52
- });
53
- }
54
- export {
55
- N as default
56
- };