@local-logic/maps 0.0.14 → 0.0.15

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 (41) hide show
  1. package/dist/{index-CTk5bvm9.js → index-3kRdcdZh.js} +41 -39
  2. package/dist/{index-DY5pY-zk.js → index-BiSKh6cm.js} +1 -1
  3. package/dist/index-BsV7l4S5.js +57 -0
  4. package/dist/{index-C36u5N_F.js → index-CJL604iU.js} +1 -1
  5. package/dist/{index-Bp1bWq9c.js → index-D4zzctTs.js} +4 -4
  6. package/dist/{index-S5SfktvB.js → index-DAov3leT.js} +1 -1
  7. package/dist/index-DLKjaFD7.js +56 -0
  8. package/dist/{index-CXUQoF5Q.js → index-DQ-QUYzC.js} +1 -1
  9. package/dist/{index-BGoTpJjt.js → index-DcbaLZSy.js} +1 -1
  10. package/dist/{index-CUpaKIZP.js → index-DgzwPaj5.js} +1 -1
  11. package/dist/index-Dxhpxh8s.js +56 -0
  12. package/dist/{index-DVitM43i.js → index-Yh7bUURu.js} +41 -39
  13. package/dist/{index-CBp9gCca.js → index-pGewpik1.js} +29 -29
  14. package/dist/index-x3wrHsPD.js +73 -0
  15. package/dist/index.es.js +1 -1
  16. package/dist/index.umd.js +25 -25
  17. package/dist/src/components/Map/Root/Layers/Google/index.d.ts.map +1 -1
  18. package/dist/src/components/Map/Root/Layers/Mapbox/index.d.ts.map +1 -1
  19. package/dist/src/components/Map/Root/Layers/Maptiler/index.d.ts.map +1 -1
  20. package/dist/src/components/Map/Root/Layers/types.d.ts +1 -0
  21. package/dist/src/components/Map/Root/Layers/types.d.ts.map +1 -1
  22. package/dist/src/components/Map/Root/Layers/utils.d.ts +2 -2
  23. package/dist/src/components/Map/Root/Layers/utils.d.ts.map +1 -1
  24. package/dist/src/components/Map/Root/Markers/Google/index.d.ts.map +1 -1
  25. package/dist/src/components/Map/Root/Markers/Mapbox/index.d.ts.map +1 -1
  26. package/dist/src/components/Map/Root/Markers/Maptiler/index.d.ts.map +1 -1
  27. package/dist/src/components/Map/Root/Markers/styles.d.ts +2 -2
  28. package/dist/src/components/Map/Root/Markers/styles.d.ts.map +1 -1
  29. package/dist/src/components/Map/Root/types.d.ts +2 -0
  30. package/dist/src/components/Map/Root/types.d.ts.map +1 -1
  31. package/dist/src/components/Map/index.stories.d.ts.map +1 -1
  32. package/dist/src/components/Map/storybook-data.d.ts +1 -0
  33. package/dist/src/components/Map/storybook-data.d.ts.map +1 -1
  34. package/dist/style.css +1 -24
  35. package/dist/utils-DJ13veBM.js +25 -0
  36. package/package.json +1 -1
  37. package/dist/index-58w3Qwxr.js +0 -56
  38. package/dist/index-CCtDJ-mV.js +0 -56
  39. package/dist/index-CXTsUiSS.js +0 -57
  40. package/dist/index-UEadmVww.js +0 -64
  41. package/dist/utils-YqJg0vBb.js +0 -25
@@ -0,0 +1,25 @@
1
+ function c(r = [], t = "MultiPolygon") {
2
+ const n = (s) => Object.values(s).map((o) => Array.isArray(o[0]) ? n(o) : [o[1], o[0]]), a = n(r);
3
+ return {
4
+ type: "FeatureCollection",
5
+ features: [
6
+ {
7
+ type: "Feature",
8
+ geometry: {
9
+ type: t,
10
+ coordinates: a
11
+ }
12
+ }
13
+ ]
14
+ };
15
+ }
16
+ function i(r = []) {
17
+ const t = (a) => Object.values(a).map((e) => Array.isArray(e[0]) ? t(e.flat()) : { lat: e[0], lng: e[1] });
18
+ return t(
19
+ r
20
+ );
21
+ }
22
+ export {
23
+ i as a,
24
+ c as g
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@local-logic/maps",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
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",
@@ -1,56 +0,0 @@
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
- };
@@ -1,56 +0,0 @@
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
- };
@@ -1,57 +0,0 @@
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
- };
@@ -1,64 +0,0 @@
1
- import { jsx as u, Fragment as h } from "react/jsx-runtime";
2
- import { useState as i, useContext as P, useEffect as c } from "react";
3
- import { G as M } from "./index.modern-CLRs8JwI.js";
4
- import { a as x } from "./utils-YqJg0vBb.js";
5
- function f(a, e) {
6
- switch (a) {
7
- case "fill":
8
- return {
9
- fillColor: e,
10
- fillOpacity: 0.25
11
- };
12
- case "line":
13
- return {
14
- strokeColor: e,
15
- strokeWeight: 2
16
- };
17
- default:
18
- return {};
19
- }
20
- }
21
- function d({ sources: a }) {
22
- const [e, m] = i(null), [p, y] = i([]), o = P(M);
23
- return c(() => {
24
- o && m(o.map);
25
- }, [o]), c(() => {
26
- if (p.forEach((t) => {
27
- t == null || t.setMap(null);
28
- }), !e || typeof a > "u" || a.length === 0)
29
- return;
30
- const n = a.map((t) => {
31
- const l = {
32
- paths: x(t.geometry),
33
- clickable: !1
34
- };
35
- if (Array.isArray(t.layer))
36
- t.layer.forEach((r) => {
37
- const g = f(r.type, r.color);
38
- Object.assign(l, g);
39
- });
40
- else {
41
- const r = f(t.layer.type, t.layer.color);
42
- Object.assign(l, r);
43
- }
44
- const s = new google.maps.Polygon({
45
- // Set default options otherwise the polygon remains visible (even if eg: we only want the outline)
46
- // We then overrider the default options with the layer options
47
- strokeWeight: 0,
48
- fillOpacity: 0,
49
- ...l
50
- });
51
- return s.setMap(e), s;
52
- });
53
- return y(n), n.forEach((t) => {
54
- t.setMap(e);
55
- }), () => {
56
- n.forEach((t) => {
57
- t == null || t.setMap(null);
58
- });
59
- };
60
- }, [e, a]), /* @__PURE__ */ u(h, {});
61
- }
62
- export {
63
- d as default
64
- };
@@ -1,25 +0,0 @@
1
- function s(r = []) {
2
- const t = (e) => Object.values(e).map((o) => Array.isArray(o[0]) ? t(o) : [o[1], o[0]]);
3
- return {
4
- type: "FeatureCollection",
5
- features: [
6
- {
7
- type: "Feature",
8
- geometry: {
9
- type: "MultiPolygon",
10
- coordinates: t(r)
11
- }
12
- }
13
- ]
14
- };
15
- }
16
- function i(r = []) {
17
- const t = (n) => Object.values(n).map((e) => Array.isArray(e[0]) ? t(e.flat()) : { lat: e[0], lng: e[1] });
18
- return t(
19
- r
20
- );
21
- }
22
- export {
23
- i as a,
24
- s as g
25
- };