@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.
Files changed (52) hide show
  1. package/dist/index-58w3Qwxr.js +56 -0
  2. package/dist/index-BGoTpJjt.js +81 -0
  3. package/dist/index-Bp1bWq9c.js +690 -0
  4. package/dist/{index-DFdfOz0d.js → index-C36u5N_F.js} +1 -1
  5. package/dist/{index-B3NH4rqN.js → index-CBp9gCca.js} +8 -8
  6. package/dist/index-CCtDJ-mV.js +56 -0
  7. package/dist/index-CFomI3Il.js +98 -0
  8. package/dist/index-CUpaKIZP.js +105 -0
  9. package/dist/index-CXTsUiSS.js +57 -0
  10. package/dist/index-CXUQoF5Q.js +34 -0
  11. package/dist/{index-B9YXnLOH.js → index-DY5pY-zk.js} +11 -10
  12. package/dist/index-S5SfktvB.js +79 -0
  13. package/dist/index.es.js +1 -1
  14. package/dist/index.umd.js +75 -75
  15. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts +1 -1
  16. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -1
  17. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts +1 -1
  18. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -1
  19. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts +1 -1
  20. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
  21. package/dist/src/components/Map/Root/BaseMap/index.d.ts +1 -1
  22. package/dist/src/components/Map/Root/BaseMap/index.d.ts.map +1 -1
  23. package/dist/src/components/Map/Root/BaseMap/types.d.ts +10 -1
  24. package/dist/src/components/Map/Root/BaseMap/types.d.ts.map +1 -1
  25. package/dist/src/components/Map/Root/Markers/Google/index.d.ts +1 -1
  26. package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -1
  27. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts +1 -1
  28. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -1
  29. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts +1 -1
  30. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -1
  31. package/dist/src/components/Map/Root/Markers/index.d.ts +1 -1
  32. package/dist/src/components/Map/Root/Markers/index.d.ts.map +1 -1
  33. package/dist/src/components/Map/Root/Markers/types.d.ts +0 -11
  34. package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
  35. package/dist/src/components/Map/Root/Popup/Google/index.d.ts.map +1 -1
  36. package/dist/src/components/Map/Root/Popup/Maptiler/index.d.ts.map +1 -1
  37. package/dist/src/components/Map/Root/Popup/index.d.ts +1 -1
  38. package/dist/src/components/Map/Root/Popup/index.d.ts.map +1 -1
  39. package/dist/src/components/Map/Root/constants.d.ts +3 -0
  40. package/dist/src/components/Map/Root/constants.d.ts.map +1 -1
  41. package/dist/src/components/Map/Root/context.d.ts +2 -0
  42. package/dist/src/components/Map/Root/context.d.ts.map +1 -1
  43. package/dist/src/components/Map/Root/index.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/dist/index-BcpSqK0X.js +0 -74
  46. package/dist/index-Bd7meO8V.js +0 -783
  47. package/dist/index-BhldVNew.js +0 -35
  48. package/dist/index-Bu4XEiYU.js +0 -74
  49. package/dist/index-CzBPD5Sw.js +0 -73
  50. package/dist/index-DsrEcQq0.js +0 -71
  51. package/dist/index-LKvWHhi6.js +0 -53
  52. package/dist/index-aDlW4ps0.js +0 -50
@@ -0,0 +1,56 @@
1
+ import { jsxs as M, jsx as n } from "react/jsx-runtime";
2
+ import { a as u } from "./scale-control-CyJd4u6j.js";
3
+ import "react";
4
+ import { u as b, M as h } from "./index-Bp1bWq9c.js";
5
+ import { C as x, c as I, M as O } from "./index-CBp9gCca.js";
6
+ function $({
7
+ clusters: i,
8
+ colors: a,
9
+ clusterIcon: d,
10
+ onClick: e,
11
+ doesSuperclusterContainActiveMarker: s
12
+ }) {
13
+ const { activeMarker: r, zoom: f } = b(), g = (t) => (o) => {
14
+ o.originalEvent.stopPropagation(), e == null || e(t);
15
+ };
16
+ return i == null ? void 0 : i.map((t, o) => {
17
+ const p = t.geometry.coordinates[0], m = t.geometry.coordinates[1];
18
+ return /* @__PURE__ */ M(
19
+ u,
20
+ {
21
+ anchor: "bottom",
22
+ longitude: p,
23
+ latitude: m,
24
+ onClick: g(t),
25
+ children: [
26
+ t.properties.cluster && /* @__PURE__ */ n(
27
+ x,
28
+ {
29
+ colors: a,
30
+ icon: d,
31
+ isActive: s(t.properties.cluster_id)
32
+ }
33
+ ),
34
+ !t.properties.cluster && /* @__PURE__ */ n(
35
+ "div",
36
+ {
37
+ className: I,
38
+ style: {
39
+ "--background": a == null ? void 0 : a.background,
40
+ "--fill": a == null ? void 0 : a.fill
41
+ },
42
+ "data-is-cluster": !!t.properties.cluster,
43
+ "data-is-zoomed-out": f < h,
44
+ "data-is-active": (r == null ? void 0 : r.id) === t.properties.id,
45
+ children: /* @__PURE__ */ n(O, { icon: t.properties.icon })
46
+ }
47
+ )
48
+ ]
49
+ },
50
+ `map-marker-${p}-${m}-${o}`
51
+ );
52
+ });
53
+ }
54
+ export {
55
+ $ as default
56
+ };
@@ -0,0 +1,81 @@
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-CyJd4u6j.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-Bp1bWq9c.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
+ };