@local-logic/maps 0.0.27 → 0.0.29

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 (31) hide show
  1. package/dist/{index-DWhC5cZK.js → index--TOrExMa.js} +2 -2
  2. package/dist/index-5JWsWx8g.js +107 -0
  3. package/dist/index-7WiriOPf.js +108 -0
  4. package/dist/{index-DqtKFLcm.js → index-B1UUkU25.js} +2 -2
  5. package/dist/index-B9irDFVS.js +126 -0
  6. package/dist/{index-B1pyYX8E.js → index-BCEeluIN.js} +2 -2
  7. package/dist/{index-DZDCWEAt.js → index-Bn4XgGCE.js} +2 -2
  8. package/dist/{index-C9omoY_W.js → index-Cnab0xsb.js} +2 -2
  9. package/dist/{index-DoUM-dTH.js → index-D5oT0rvy.js} +4 -3
  10. package/dist/{index-C6dKnCta.js → index-DImiFUoC.js} +2 -2
  11. package/dist/{index-DBpXJh_8.js → index-DRdXfLHP.js} +1 -1
  12. package/dist/index.es.js +1 -1
  13. package/dist/index.umd.js +5 -5
  14. package/dist/src/components/Map/Root/BaseMap/Google/index.d.ts.map +1 -1
  15. package/dist/src/components/Map/Root/BaseMap/Mapbox/index.d.ts.map +1 -1
  16. package/dist/src/components/Map/Root/BaseMap/Mapbox/translations.d.ts +33 -0
  17. package/dist/src/components/Map/Root/BaseMap/Mapbox/translations.d.ts.map +1 -0
  18. package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
  19. package/dist/src/components/Map/Root/BaseMap/Maptiler/translations.d.ts +57 -0
  20. package/dist/src/components/Map/Root/BaseMap/Maptiler/translations.d.ts.map +1 -0
  21. package/dist/src/components/Map/Root/context.d.ts +1 -0
  22. package/dist/src/components/Map/Root/context.d.ts.map +1 -1
  23. package/dist/src/components/Map/Root/index.d.ts.map +1 -1
  24. package/dist/src/components/Map/Root/types.d.ts +1 -0
  25. package/dist/src/components/Map/Root/types.d.ts.map +1 -1
  26. package/dist/style.css +1 -1
  27. package/dist/{styles-Lnv5-v_D.js → styles-mseP7Fna.js} +1 -1
  28. package/package.json +1 -1
  29. package/dist/index-BfcWqVMc.js +0 -98
  30. package/dist/index-D-wKsZtO.js +0 -69
  31. package/dist/index-k7gr6NRM.js +0 -75
@@ -1,98 +0,0 @@
1
- import { jsxs as B, jsx as h } from "react/jsx-runtime";
2
- import { useState as P, useRef as _, useCallback as b, useEffect as M } from "react";
3
- import { APIProvider as y, Map as C, ControlPosition as f, useMap as E } from "@vis.gl/react-google-maps";
4
- import { u as v, D as p, W as c, a as O, m as x } from "./index-DoUM-dTH.js";
5
- import { t as z } from "./index-DscDx7HE.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
- }, k = ({ isMapLoaded: g }) => {
12
- const e = E(), { markerPoints: n, setZoom: r, mapPadding: i } = v(), [u, d] = P(void 0), a = _(void 0), m = b(() => {
13
- if (!e)
14
- return;
15
- const o = e.getZoom();
16
- typeof o < "u" && r(o + 1);
17
- }, [e, r]);
18
- return M(() => {
19
- m();
20
- const o = e?.addListener("zoom_changed", m);
21
- return () => {
22
- o?.remove();
23
- };
24
- }, [e, m]), M(() => {
25
- if (!e || typeof n > "u" || n.length === 0)
26
- return;
27
- const o = z(x(n));
28
- (!a.current || !o.every((s, t) => s === a.current?.[t])) && (a.current = o, d(o));
29
- }, [e, n]), M(() => {
30
- if (!e || typeof u > "u")
31
- return;
32
- const [o, s, t, l] = u, L = (t - o) * 0.05 || 1e-3, T = (l - s) * 0.05 || 1e-3;
33
- e.fitBounds(
34
- {
35
- south: s - T,
36
- west: o - L,
37
- north: l + T,
38
- east: t + L
39
- },
40
- i
41
- );
42
- }, [g, e, u, i]), null;
43
- };
44
- function H({ children: g }) {
45
- const [e, n] = P(!1), {
46
- mapProvider: r,
47
- center: i,
48
- zoom: u = p.zoom,
49
- minZoom: d,
50
- maxZoom: a,
51
- pitch: m = p.pitch,
52
- bearing: o = p.bearing,
53
- cooperativeGestures: s = p.cooperativeGestures,
54
- zoomPosition: t
55
- } = v();
56
- if (r.name !== "google")
57
- return null;
58
- const l = () => {
59
- n(!0);
60
- };
61
- return /* @__PURE__ */ B(y, { apiKey: r.apiKey, children: [
62
- /* @__PURE__ */ h(k, { isMapLoaded: e }),
63
- /* @__PURE__ */ h(
64
- C,
65
- {
66
- mapId: r.theme || O.google,
67
- defaultCenter: {
68
- lat: i.latitude,
69
- lng: i.longitude
70
- },
71
- defaultBounds: {
72
- north: c[3],
73
- south: c[1],
74
- east: c[2],
75
- west: c[0]
76
- },
77
- defaultZoom: u + 1,
78
- defaultTilt: m,
79
- defaultHeading: o,
80
- gestureHandling: s ? "cooperative" : "greedy",
81
- streetViewControl: !1,
82
- fullscreenControl: !1,
83
- clickableIcons: !1,
84
- mapTypeControl: !1,
85
- zoomControlOptions: {
86
- position: t && Z[t]
87
- },
88
- minZoom: typeof d == "number" ? d + 1 : void 0,
89
- maxZoom: typeof a == "number" ? a + 1 : void 0,
90
- onTilesLoaded: l,
91
- children: g
92
- }
93
- )
94
- ] });
95
- }
96
- export {
97
- H as default
98
- };
@@ -1,69 +0,0 @@
1
- import { jsxs as x, jsx as g } from "react/jsx-runtime";
2
- import { useState as B, useRef as k, useCallback as y, useEffect as c } from "react";
3
- import { M as E, N as L, u as P } from "./logo-control-CHapR1Dt.js";
4
- import { u as v, D as p, a as h, m as Z } from "./index-DoUM-dTH.js";
5
- import { t as _ } from "./index-DscDx7HE.js";
6
- const b = () => {
7
- const { current: e } = P(), { markerPoints: o, setZoom: s, mapPadding: m } = v(), [a, f] = B(void 0), i = k(void 0), n = y(() => {
8
- e && s(e.getZoom());
9
- }, [e, s]);
10
- return c(() => (n(), e?.on("zoom", n), () => {
11
- e?.off("zoom", n);
12
- }), [e, n]), c(() => {
13
- if (!e || typeof o > "u" || o.length === 0)
14
- return;
15
- const t = _(Z(o));
16
- (!i.current || !t.every((r, u) => r === i.current?.[u])) && (i.current = t, f(t));
17
- }, [e, o]), c(() => {
18
- if (!e || typeof a > "u")
19
- return;
20
- const [t, r, u, l] = a, d = (u - t) * 0.05 || 1e-3, M = (l - r) * 0.05 || 1e-3;
21
- e.fitBounds(
22
- [
23
- [t - d, r - M],
24
- [u + d, l + M]
25
- ],
26
- {
27
- padding: m,
28
- maxZoom: 17,
29
- duration: 700
30
- }
31
- );
32
- }, [e, a, m]), null;
33
- };
34
- function D({ children: e }) {
35
- const {
36
- mapProvider: o,
37
- center: s,
38
- zoom: m = p.zoom,
39
- minZoom: a,
40
- maxZoom: f,
41
- pitch: i = p.pitch,
42
- bearing: n = p.bearing,
43
- cooperativeGestures: t = p.cooperativeGestures,
44
- zoomPosition: r
45
- } = v();
46
- return o.name !== "maptiler" ? null : /* @__PURE__ */ x(
47
- E,
48
- {
49
- initialViewState: {
50
- ...s,
51
- zoom: m,
52
- pitch: i,
53
- bearing: n
54
- },
55
- cooperativeGestures: t,
56
- minZoom: a,
57
- maxZoom: f,
58
- mapStyle: `https://api.maptiler.com/maps/${o.theme || h.maptiler}/style.json?key=${o.apiKey}`,
59
- children: [
60
- /* @__PURE__ */ g(b, {}),
61
- r && /* @__PURE__ */ g(L, { position: r }),
62
- e
63
- ]
64
- }
65
- );
66
- }
67
- export {
68
- D as default
69
- };
@@ -1,75 +0,0 @@
1
- import { jsxs as g, jsx as M } from "react/jsx-runtime";
2
- import { useState as v, useRef as y, useCallback as B, useEffect as c } from "react";
3
- import { M as L, N as P, u as k } from "./scale-control-Dsir9fWY.js";
4
- import { u as b, D as p, a as E, m as A } from "./index-DoUM-dTH.js";
5
- import { t as Z } from "./index-DscDx7HE.js";
6
- const _ = () => {
7
- const { current: e } = k(), { markerPoints: o, setZoom: i, mapPadding: m } = b(), [n, f] = v(void 0), s = y(void 0), r = B(() => {
8
- e && i(e.getZoom());
9
- }, [e, i]);
10
- return c(() => (r(), e?.on("zoom", r), () => {
11
- e?.off("zoom", r);
12
- }), [e, r]), c(() => {
13
- if (!e || typeof o > "u" || o.length === 0)
14
- return;
15
- const t = Z(A(o));
16
- (!s.current || !t.every((a, u) => a === s.current?.[u])) && (s.current = t, f(t));
17
- }, [e, o]), c(() => {
18
- if (!e || typeof n > "u")
19
- return;
20
- const [t, a, u, d] = n, l = (u - t) * 0.05 || 1e-3, x = (d - a) * 0.05 || 1e-3;
21
- e.fitBounds(
22
- [
23
- [t - l, a - x],
24
- [u + l, d + x]
25
- ],
26
- {
27
- // Mapbox seems to retain padding, thus further calls
28
- // to map.getBounds() include the padding and make calculations
29
- // harder. Explicitly turning this off.
30
- retainPadding: !1,
31
- padding: m,
32
- maxZoom: 17,
33
- duration: 700
34
- }
35
- );
36
- }, [e, n, m]), null;
37
- };
38
- function C({ children: e }) {
39
- const {
40
- mapProvider: o,
41
- center: i,
42
- zoom: m = p.zoom,
43
- minZoom: n,
44
- maxZoom: f,
45
- pitch: s = p.pitch,
46
- bearing: r = p.bearing,
47
- cooperativeGestures: t = p.cooperativeGestures,
48
- zoomPosition: a
49
- } = b();
50
- return o.name !== "mapbox" ? null : /* @__PURE__ */ g(
51
- L,
52
- {
53
- mapboxAccessToken: o.apiKey,
54
- initialViewState: {
55
- ...i,
56
- zoom: m,
57
- pitch: s,
58
- bearing: r
59
- },
60
- cooperativeGestures: t,
61
- minZoom: n,
62
- maxZoom: f,
63
- mapStyle: `mapbox://styles/${o.theme || E.mapbox}`,
64
- interactiveLayerIds: ["road-label", "waterway-label"],
65
- children: [
66
- /* @__PURE__ */ M(_, {}),
67
- a && /* @__PURE__ */ M(P, { position: a }),
68
- e
69
- ]
70
- }
71
- );
72
- }
73
- export {
74
- C as default
75
- };