@local-logic/maps 0.0.30 → 0.1.1
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-Bn4XgGCE.js → index-BOJCRr60.js} +2 -2
- package/dist/{index-DRdXfLHP.js → index-BUZonjTY.js} +1 -1
- package/dist/index-BabQioiH.js +109 -0
- package/dist/{index-B9irDFVS.js → index-CTWLtI5f.js} +51 -48
- package/dist/{index-BCEeluIN.js → index-CWXZA3V3.js} +2 -2
- package/dist/{index-B1UUkU25.js → index-Ci9PQ3VM.js} +2 -2
- package/dist/{index-D5oT0rvy.js → index-D37STE_k.js} +88 -87
- package/dist/{index-CIE9YlvM.js → index-D8-yY6UK.js} +1 -1
- package/dist/{index-Cnab0xsb.js → index-DHOxmHER.js} +2 -2
- package/dist/{index-GGtrKiJn.js → index-DKy2opdk.js} +1 -1
- package/dist/{index-DImiFUoC.js → index-Dy0j33aN.js} +2 -2
- package/dist/{index-CEDpofgZ.js → index-k9UFzKZZ.js} +8 -7
- package/dist/{index--TOrExMa.js → index-vIYPnHrB.js} +2 -2
- package/dist/{index-7WiriOPf.js → index-xDS1OfMB.js} +48 -45
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +5 -5
- 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.map +1 -1
- package/dist/src/components/Map/Root/BaseMap/Maptiler/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Layers/Google/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Layers/index.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Layers/types.d.ts +12 -1
- package/dist/src/components/Map/Root/Layers/types.d.ts.map +1 -1
- package/dist/src/components/Map/Root/Layers/utils.d.ts +3 -4
- package/dist/src/components/Map/Root/Layers/utils.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 +1 -0
- package/dist/src/components/Map/Root/Markers/types.d.ts.map +1 -1
- package/dist/src/components/Map/Root/context.d.ts +0 -1
- 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/dist/src/components/Map/Root/types.d.ts +1 -0
- package/dist/src/components/Map/Root/types.d.ts.map +1 -1
- package/dist/src/components/Map/storybook-data.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-mseP7Fna.js → styles-B3ZaR0wz.js} +1 -1
- package/dist/utils-IAXGPK5I.js +33 -0
- package/package.json +3 -3
- package/dist/index-5JWsWx8g.js +0 -107
- package/dist/utils-DJ13veBM.js +0 -25
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as v, jsx as C } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useRef as Z, useCallback as h, useEffect as d } from "react";
|
|
3
3
|
import { M as B, N as L, u as T } from "./scale-control-Dsir9fWY.js";
|
|
4
|
-
import { u as
|
|
5
|
-
import { t as
|
|
6
|
-
const
|
|
4
|
+
import { u as M, D as p, a as z, m as A } from "./index-D37STE_k.js";
|
|
5
|
+
import { t as E } from "./index-DscDx7HE.js";
|
|
6
|
+
const P = {
|
|
7
7
|
en: {
|
|
8
8
|
"AttributionControl.ToggleAttribution": "Toggle attribution",
|
|
9
9
|
"FullscreenControl.Enter": "Enter fullscreen",
|
|
@@ -34,25 +34,28 @@ const A = {
|
|
|
34
34
|
"ScrollZoomBlocker.CmdMessage": "Utilisez ⌘ + défilement pour zoomer sur la carte",
|
|
35
35
|
"TouchPanBlocker.Message": "Utilisez deux doigts pour déplacer la carte"
|
|
36
36
|
}
|
|
37
|
-
},
|
|
38
|
-
const { current: o } = T(), { markerPoints:
|
|
37
|
+
}, y = () => {
|
|
38
|
+
const { current: o } = T(), { markerPoints: n, locationBoundary: l, setZoom: s, mapPadding: c } = M(), [a, f] = x(void 0), i = Z(void 0), r = h(() => {
|
|
39
39
|
o && s(o.getZoom());
|
|
40
40
|
}, [o, s]);
|
|
41
|
-
return
|
|
42
|
-
o?.off("zoom",
|
|
43
|
-
}), [o,
|
|
44
|
-
if (!o
|
|
41
|
+
return d(() => (r(), o?.on("zoom", r), () => {
|
|
42
|
+
o?.off("zoom", r);
|
|
43
|
+
}), [o, r]), d(() => {
|
|
44
|
+
if (!o)
|
|
45
45
|
return;
|
|
46
|
-
const
|
|
47
|
-
(
|
|
48
|
-
}, [o, e]), p(() => {
|
|
49
|
-
if (!o || typeof i > "u")
|
|
46
|
+
const e = [];
|
|
47
|
+
if (typeof n < "u" && n.length > 0 ? e.push(...n) : e.push(...l || []), e.length === 0)
|
|
50
48
|
return;
|
|
51
|
-
const
|
|
49
|
+
const t = E(A(e));
|
|
50
|
+
(!i.current || !t.every((u, m) => u === i.current?.[m])) && (i.current = t, f(t));
|
|
51
|
+
}, [o, n, l]), d(() => {
|
|
52
|
+
if (!o || typeof a > "u")
|
|
53
|
+
return;
|
|
54
|
+
const [e, t, u, m] = a, g = (u - e) * 0.05 || 1e-3, b = (m - t) * 0.05 || 1e-3;
|
|
52
55
|
o.fitBounds(
|
|
53
56
|
[
|
|
54
|
-
[
|
|
55
|
-
[
|
|
57
|
+
[e - g, t - b],
|
|
58
|
+
[u + g, m + b]
|
|
56
59
|
],
|
|
57
60
|
{
|
|
58
61
|
// Mapbox seems to retain padding, thus further calls
|
|
@@ -64,45 +67,45 @@ const A = {
|
|
|
64
67
|
duration: 700
|
|
65
68
|
}
|
|
66
69
|
);
|
|
67
|
-
}, [o,
|
|
70
|
+
}, [o, a, c]), null;
|
|
68
71
|
};
|
|
69
|
-
function
|
|
72
|
+
function R({ children: o }) {
|
|
70
73
|
const {
|
|
71
|
-
mapProvider:
|
|
72
|
-
locale:
|
|
73
|
-
center:
|
|
74
|
-
zoom:
|
|
75
|
-
minZoom:
|
|
76
|
-
maxZoom:
|
|
77
|
-
pitch:
|
|
78
|
-
bearing:
|
|
79
|
-
cooperativeGestures:
|
|
80
|
-
zoomPosition:
|
|
81
|
-
} =
|
|
82
|
-
return
|
|
74
|
+
mapProvider: n,
|
|
75
|
+
locale: l,
|
|
76
|
+
center: s,
|
|
77
|
+
zoom: c = p.zoom,
|
|
78
|
+
minZoom: a,
|
|
79
|
+
maxZoom: f,
|
|
80
|
+
pitch: i = p.pitch,
|
|
81
|
+
bearing: r = p.bearing,
|
|
82
|
+
cooperativeGestures: e = p.cooperativeGestures,
|
|
83
|
+
zoomPosition: t
|
|
84
|
+
} = M();
|
|
85
|
+
return n.name !== "mapbox" ? null : /* @__PURE__ */ v(
|
|
83
86
|
B,
|
|
84
87
|
{
|
|
85
|
-
mapboxAccessToken:
|
|
88
|
+
mapboxAccessToken: n.apiKey,
|
|
86
89
|
initialViewState: {
|
|
87
|
-
...
|
|
88
|
-
zoom:
|
|
89
|
-
pitch:
|
|
90
|
-
bearing:
|
|
90
|
+
...s,
|
|
91
|
+
zoom: c,
|
|
92
|
+
pitch: i,
|
|
93
|
+
bearing: r
|
|
91
94
|
},
|
|
92
|
-
cooperativeGestures:
|
|
93
|
-
minZoom:
|
|
94
|
-
maxZoom:
|
|
95
|
-
mapStyle: `mapbox://styles/${
|
|
95
|
+
cooperativeGestures: e,
|
|
96
|
+
minZoom: a,
|
|
97
|
+
maxZoom: f,
|
|
98
|
+
mapStyle: `mapbox://styles/${n.theme || z.mapbox}`,
|
|
96
99
|
interactiveLayerIds: ["road-label", "waterway-label"],
|
|
97
|
-
locale:
|
|
100
|
+
locale: P[l],
|
|
98
101
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
-
|
|
102
|
+
/* @__PURE__ */ C(y, {}),
|
|
103
|
+
t && /* @__PURE__ */ C(L, { position: t }),
|
|
101
104
|
o
|
|
102
105
|
]
|
|
103
106
|
}
|
|
104
107
|
);
|
|
105
108
|
}
|
|
106
109
|
export {
|
|
107
|
-
|
|
110
|
+
R as default
|
|
108
111
|
};
|
package/dist/index.es.js
CHANGED