@dxos/react-ui-geo 0.8.4-main.b97322e → 0.8.4-main.bd9b33e6c8
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/lib/browser/index.mjs +399 -446
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +399 -446
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts +10 -4
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +31 -9
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.d.ts +38 -18
- package/dist/types/src/components/Map/Map.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.stories.d.ts +14 -8
- package/dist/types/src/components/Map/Map.stories.d.ts.map +1 -1
- package/dist/types/src/components/Toolbar/Controls.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/hooks/context.d.ts +6 -8
- package/dist/types/src/hooks/context.d.ts.map +1 -1
- package/dist/types/src/hooks/useGlobeZoomHandler.d.ts +1 -1
- package/dist/types/src/hooks/useGlobeZoomHandler.d.ts.map +1 -1
- package/dist/types/src/hooks/useMapZoomHandler.d.ts +1 -1
- package/dist/types/src/hooks/useMapZoomHandler.d.ts.map +1 -1
- package/dist/types/src/hooks/useSpinner.d.ts +1 -1
- package/dist/types/src/hooks/useSpinner.d.ts.map +1 -1
- package/dist/types/src/hooks/useTour.d.ts +4 -3
- package/dist/types/src/hooks/useTour.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +12 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +2 -1
- package/dist/types/src/types.d.ts.map +1 -1
- package/dist/types/src/util/path.d.ts +5 -8
- package/dist/types/src/util/path.d.ts.map +1 -1
- package/dist/types/src/util/render.d.ts +4 -4
- package/dist/types/src/util/render.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +30 -23
- package/src/components/Globe/Globe.stories.tsx +83 -35
- package/src/components/Globe/Globe.tsx +101 -54
- package/src/components/Map/Map.stories.tsx +28 -15
- package/src/components/Map/Map.tsx +220 -94
- package/src/components/Toolbar/Controls.tsx +14 -20
- package/src/components/index.ts +0 -2
- package/src/hooks/context.tsx +11 -34
- package/src/hooks/useGlobeZoomHandler.ts +9 -3
- package/src/hooks/useMapZoomHandler.ts +1 -1
- package/src/hooks/useSpinner.ts +2 -1
- package/src/hooks/useTour.ts +10 -8
- package/src/index.ts +1 -0
- package/src/translations.ts +20 -0
- package/src/types.ts +3 -1
- package/src/util/inertia.ts +1 -1
- package/src/util/path.ts +5 -6
- package/src/util/render.ts +5 -3
- package/dist/types/src/components/types.d.ts +0 -15
- package/dist/types/src/components/types.d.ts.map +0 -1
- package/src/components/types.ts +0 -19
|
@@ -4,43 +4,16 @@ import {
|
|
|
4
4
|
} from "./chunk-JODBF4CC.mjs";
|
|
5
5
|
|
|
6
6
|
// src/components/Globe/Globe.tsx
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import React3, { forwardRef, useEffect as useEffect4, useImperativeHandle, useMemo as useMemo2, useRef, useState as useState3 } from "react";
|
|
7
|
+
import { easeLinear, easeSinOut, geoMercator, geoOrthographic, geoPath as geoPath2, geoTransverseMercator, interpolateNumber, transition } from "d3";
|
|
8
|
+
import React2, { forwardRef, useEffect as useEffect4, useImperativeHandle, useMemo as useMemo2, useRef, useState as useState3 } from "react";
|
|
10
9
|
import { useResizeDetector } from "react-resize-detector";
|
|
11
|
-
import { useDynamicRef, useThemeContext } from "@dxos/react-ui";
|
|
12
|
-
import { mx } from "@dxos/
|
|
10
|
+
import { useComposedRefs, useControlledState, useDynamicRef, useThemeContext } from "@dxos/react-ui";
|
|
11
|
+
import { composable, composableProps, mx } from "@dxos/ui-theme";
|
|
13
12
|
|
|
14
13
|
// src/hooks/context.tsx
|
|
15
|
-
import {
|
|
16
|
-
import React, { createContext, useContext } from "react";
|
|
14
|
+
import { createContext, useContext } from "react";
|
|
17
15
|
import { raise } from "@dxos/debug";
|
|
18
|
-
import { useControlledState } from "@dxos/react-ui";
|
|
19
16
|
var GlobeContext = /* @__PURE__ */ createContext(void 0);
|
|
20
|
-
var GlobeContextProvider = ({ children, size, center: _center, scale: _scale, translation: _translation, rotation: _rotation }) => {
|
|
21
|
-
var _effect = _useSignals();
|
|
22
|
-
try {
|
|
23
|
-
const [center, setCenter] = useControlledState(_center);
|
|
24
|
-
const [scale, setScale] = useControlledState(_scale);
|
|
25
|
-
const [translation, setTranslation] = useControlledState(_translation);
|
|
26
|
-
const [rotation, setRotation] = useControlledState(_rotation);
|
|
27
|
-
return /* @__PURE__ */ React.createElement(GlobeContext.Provider, {
|
|
28
|
-
value: {
|
|
29
|
-
size,
|
|
30
|
-
center,
|
|
31
|
-
scale,
|
|
32
|
-
translation,
|
|
33
|
-
rotation,
|
|
34
|
-
setCenter,
|
|
35
|
-
setScale,
|
|
36
|
-
setTranslation,
|
|
37
|
-
setRotation
|
|
38
|
-
}
|
|
39
|
-
}, children);
|
|
40
|
-
} finally {
|
|
41
|
-
_effect.f();
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
17
|
var useGlobeContext = () => {
|
|
45
18
|
return useContext(GlobeContext) ?? raise(new Error("Missing GlobeContext"));
|
|
46
19
|
};
|
|
@@ -65,7 +38,7 @@ var timer = (cb) => {
|
|
|
65
38
|
};
|
|
66
39
|
|
|
67
40
|
// src/util/inertia.ts
|
|
68
|
-
import {
|
|
41
|
+
import { drag, select, timer as timer2 } from "d3";
|
|
69
42
|
import versor from "versor";
|
|
70
43
|
var restrictAxis = (axis) => (original, current) => current.map((d, i) => axis[i] ? d : original[i]);
|
|
71
44
|
var geoInertiaDrag = (target, render, projection, options) => {
|
|
@@ -428,6 +401,7 @@ var cancelDrag = (node) => node.on(".drag", null);
|
|
|
428
401
|
|
|
429
402
|
// src/hooks/useGlobeZoomHandler.ts
|
|
430
403
|
import { useCallback } from "react";
|
|
404
|
+
var ZOOM_FACTOR = 0.1;
|
|
431
405
|
var useGlobeZoomHandler = (controller) => {
|
|
432
406
|
return useCallback((event) => {
|
|
433
407
|
if (!controller) {
|
|
@@ -435,11 +409,15 @@ var useGlobeZoomHandler = (controller) => {
|
|
|
435
409
|
}
|
|
436
410
|
switch (event) {
|
|
437
411
|
case "zoom-in": {
|
|
438
|
-
controller.
|
|
412
|
+
controller.setZoom((zoom) => {
|
|
413
|
+
return zoom * (1 + ZOOM_FACTOR);
|
|
414
|
+
});
|
|
439
415
|
break;
|
|
440
416
|
}
|
|
441
417
|
case "zoom-out": {
|
|
442
|
-
controller.
|
|
418
|
+
controller.setZoom((zoom) => {
|
|
419
|
+
return zoom * (1 - ZOOM_FACTOR);
|
|
420
|
+
});
|
|
443
421
|
break;
|
|
444
422
|
}
|
|
445
423
|
}
|
|
@@ -524,8 +502,8 @@ var useSpinner = (controller, options = {}) => {
|
|
|
524
502
|
};
|
|
525
503
|
|
|
526
504
|
// src/hooks/useTour.ts
|
|
527
|
-
import {
|
|
528
|
-
import { useEffect as useEffect3, useState as useState2
|
|
505
|
+
import { selection as d3Selection, geoDistance, geoInterpolate, geoPath } from "d3";
|
|
506
|
+
import { useEffect as useEffect3, useMemo, useState as useState2 } from "react";
|
|
529
507
|
import versor2 from "versor";
|
|
530
508
|
var TRANSITION_NAME = "globe-tour";
|
|
531
509
|
var defaultDuration = 1500;
|
|
@@ -572,7 +550,7 @@ var useTour = (controller, points, options = {}) => {
|
|
|
572
550
|
{
|
|
573
551
|
context.beginPath();
|
|
574
552
|
context.strokeStyle = options?.styles?.arc?.strokeStyle ?? "yellow";
|
|
575
|
-
context.lineWidth = (options?.styles?.arc?.lineWidth ?? 1.5) * (controller?.
|
|
553
|
+
context.lineWidth = (options?.styles?.arc?.lineWidth ?? 1.5) * (controller?.zoom ?? 1);
|
|
576
554
|
context.setLineDash(options?.styles?.arc?.lineDash ?? []);
|
|
577
555
|
path({
|
|
578
556
|
type: "LineString",
|
|
@@ -584,7 +562,7 @@ var useTour = (controller, points, options = {}) => {
|
|
|
584
562
|
context.stroke();
|
|
585
563
|
context.beginPath();
|
|
586
564
|
context.fillStyle = options?.styles?.cursor?.fillStyle ?? "orange";
|
|
587
|
-
path.pointRadius((options?.styles?.cursor?.pointRadius ?? 2) * (controller?.
|
|
565
|
+
path.pointRadius((options?.styles?.cursor?.pointRadius ?? 2) * (controller?.zoom ?? 1));
|
|
588
566
|
path({
|
|
589
567
|
type: "Point",
|
|
590
568
|
coordinates: ip(t22)
|
|
@@ -598,7 +576,7 @@ var useTour = (controller, points, options = {}) => {
|
|
|
598
576
|
await transition2.end();
|
|
599
577
|
last = next;
|
|
600
578
|
}
|
|
601
|
-
} catch
|
|
579
|
+
} catch {
|
|
602
580
|
} finally {
|
|
603
581
|
setRunning(false);
|
|
604
582
|
}
|
|
@@ -620,9 +598,25 @@ var useTour = (controller, points, options = {}) => {
|
|
|
620
598
|
};
|
|
621
599
|
|
|
622
600
|
// src/components/Toolbar/Controls.tsx
|
|
623
|
-
import
|
|
624
|
-
import
|
|
625
|
-
|
|
601
|
+
import React from "react";
|
|
602
|
+
import { IconButton, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
603
|
+
|
|
604
|
+
// src/translations.ts
|
|
605
|
+
var translationKey = "@dxos/react-ui-geo";
|
|
606
|
+
var translations = [
|
|
607
|
+
{
|
|
608
|
+
"en-US": {
|
|
609
|
+
[translationKey]: {
|
|
610
|
+
"zoom in icon button": "Zoom in",
|
|
611
|
+
"zoom out icon button": "Zoom out",
|
|
612
|
+
"start icon button": "Start",
|
|
613
|
+
"toggle icon button": "Toggle"
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
];
|
|
618
|
+
|
|
619
|
+
// src/components/Toolbar/Controls.tsx
|
|
626
620
|
var controlPositions = {
|
|
627
621
|
topleft: "top-2 left-2",
|
|
628
622
|
topright: "top-2 right-2",
|
|
@@ -630,62 +624,42 @@ var controlPositions = {
|
|
|
630
624
|
bottomright: "bottom-2 right-2"
|
|
631
625
|
};
|
|
632
626
|
var ZoomControls = ({ classNames, onAction }) => {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
icon: "ph--minus--regular",
|
|
651
|
-
label: "zoom out",
|
|
652
|
-
iconOnly: true,
|
|
653
|
-
size: 5,
|
|
654
|
-
classNames: "px-0 aspect-square",
|
|
655
|
-
onClick: () => onAction?.("zoom-out")
|
|
656
|
-
}));
|
|
657
|
-
} finally {
|
|
658
|
-
_effect.f();
|
|
659
|
-
}
|
|
627
|
+
const { t } = useTranslation(translationKey);
|
|
628
|
+
return /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
629
|
+
classNames: [
|
|
630
|
+
"gap-2",
|
|
631
|
+
classNames
|
|
632
|
+
]
|
|
633
|
+
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
634
|
+
icon: "ph--plus--regular",
|
|
635
|
+
iconOnly: true,
|
|
636
|
+
label: t("zoom in icon button"),
|
|
637
|
+
onClick: () => onAction?.("zoom-in")
|
|
638
|
+
}), /* @__PURE__ */ React.createElement(IconButton, {
|
|
639
|
+
icon: "ph--minus--regular",
|
|
640
|
+
iconOnly: true,
|
|
641
|
+
label: t("zoom out icon button"),
|
|
642
|
+
onClick: () => onAction?.("zoom-out")
|
|
643
|
+
}));
|
|
660
644
|
};
|
|
661
645
|
var ActionControls = ({ classNames, onAction }) => {
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
icon: "ph--globe-hemisphere-west--regular",
|
|
680
|
-
label: "toggle",
|
|
681
|
-
iconOnly: true,
|
|
682
|
-
size: 5,
|
|
683
|
-
classNames: "px-0 aspect-square",
|
|
684
|
-
onClick: () => onAction?.("toggle")
|
|
685
|
-
}));
|
|
686
|
-
} finally {
|
|
687
|
-
_effect.f();
|
|
688
|
-
}
|
|
646
|
+
const { t } = useTranslation(translationKey);
|
|
647
|
+
return /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
648
|
+
classNames: [
|
|
649
|
+
"gap-2",
|
|
650
|
+
classNames
|
|
651
|
+
]
|
|
652
|
+
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
653
|
+
icon: "ph--path--regular",
|
|
654
|
+
iconOnly: true,
|
|
655
|
+
label: t("start icon button"),
|
|
656
|
+
onClick: () => onAction?.("start")
|
|
657
|
+
}), /* @__PURE__ */ React.createElement(IconButton, {
|
|
658
|
+
icon: "ph--globe-hemisphere-west--regular",
|
|
659
|
+
iconOnly: true,
|
|
660
|
+
label: t("toggle icon button"),
|
|
661
|
+
onClick: () => onAction?.("toggle")
|
|
662
|
+
}));
|
|
689
663
|
};
|
|
690
664
|
|
|
691
665
|
// src/components/Globe/Globe.tsx
|
|
@@ -743,400 +717,377 @@ var getProjection = (type = "orthographic") => {
|
|
|
743
717
|
}
|
|
744
718
|
return type ?? geoOrthographic();
|
|
745
719
|
};
|
|
746
|
-
var GlobeRoot = ({
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
720
|
+
var GlobeRoot = composable(({ children, center: centerProp, zoom: zoomProp, translation: translationProp, rotation: rotationProp, ...props }, forwardedRef) => {
|
|
721
|
+
const localRef = useRef(null);
|
|
722
|
+
const composedRef = useComposedRefs(localRef, forwardedRef);
|
|
723
|
+
const { width, height } = useResizeDetector({
|
|
724
|
+
targetRef: localRef
|
|
725
|
+
});
|
|
726
|
+
const [center, setCenter] = useControlledState(centerProp);
|
|
727
|
+
const [zoom, setZoom] = useControlledState(zoomProp ?? 4);
|
|
728
|
+
const [translation, setTranslation] = useControlledState(translationProp);
|
|
729
|
+
const [rotation, setRotation] = useControlledState(rotationProp);
|
|
730
|
+
return /* @__PURE__ */ React2.createElement(GlobeContext.Provider, {
|
|
731
|
+
value: {
|
|
754
732
|
size: {
|
|
755
733
|
width,
|
|
756
734
|
height
|
|
757
735
|
},
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
setCenter,
|
|
806
|
-
setScale: (s) => {
|
|
807
|
-
if (typeof s === "function") {
|
|
808
|
-
const is = interpolateNumber(scaleRef.current, s(scaleRef.current));
|
|
809
|
-
transition().ease(zooming.current ? easeLinear : easeSinOut).duration(200).tween("scale", () => (t) => setScale(is(t))).on("end", () => {
|
|
810
|
-
zooming.current = false;
|
|
811
|
-
});
|
|
812
|
-
} else {
|
|
813
|
-
setScale(s);
|
|
814
|
-
}
|
|
815
|
-
},
|
|
816
|
-
setTranslation,
|
|
817
|
-
setRotation
|
|
818
|
-
};
|
|
819
|
-
}, [
|
|
820
|
-
canvas
|
|
821
|
-
]);
|
|
822
|
-
const generator = useMemo2(() => canvas && projection && geoPath2(projection, canvas.getContext("2d", {
|
|
823
|
-
alpha: false
|
|
824
|
-
})), [
|
|
736
|
+
center,
|
|
737
|
+
zoom,
|
|
738
|
+
translation,
|
|
739
|
+
rotation,
|
|
740
|
+
setCenter,
|
|
741
|
+
setZoom,
|
|
742
|
+
setTranslation,
|
|
743
|
+
setRotation
|
|
744
|
+
}
|
|
745
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
746
|
+
...composableProps(props, {
|
|
747
|
+
classNames: "relative dx-container"
|
|
748
|
+
}),
|
|
749
|
+
ref: composedRef
|
|
750
|
+
}, children));
|
|
751
|
+
});
|
|
752
|
+
var GlobeCanvas = /* @__PURE__ */ forwardRef(({ projection: projectionProp, topology, features, styles: stylesProp }, forwardRef3) => {
|
|
753
|
+
const { themeMode } = useThemeContext();
|
|
754
|
+
const styles = useMemo2(() => stylesProp ?? defaultStyles[themeMode], [
|
|
755
|
+
stylesProp,
|
|
756
|
+
themeMode
|
|
757
|
+
]);
|
|
758
|
+
const [canvas, setCanvas] = useState3(null);
|
|
759
|
+
const canvasRef = (canvas2) => setCanvas(canvas2);
|
|
760
|
+
const projection = useMemo2(() => getProjection(projectionProp), [
|
|
761
|
+
projectionProp
|
|
762
|
+
]);
|
|
763
|
+
const layers = useMemo2(() => {
|
|
764
|
+
return timer(() => createLayers(topology, features, styles));
|
|
765
|
+
}, [
|
|
766
|
+
topology,
|
|
767
|
+
features,
|
|
768
|
+
styles
|
|
769
|
+
]);
|
|
770
|
+
const { size, center, zoom, translation, rotation, setCenter, setZoom, setTranslation, setRotation } = useGlobeContext();
|
|
771
|
+
const zoomRef = useDynamicRef(zoom);
|
|
772
|
+
useEffect4(() => {
|
|
773
|
+
if (center) {
|
|
774
|
+
setZoom(1);
|
|
775
|
+
setRotation(positionToRotation(geoToPosition(center)));
|
|
776
|
+
}
|
|
777
|
+
}, [
|
|
778
|
+
center
|
|
779
|
+
]);
|
|
780
|
+
const zooming = useRef(false);
|
|
781
|
+
useImperativeHandle(forwardRef3, () => {
|
|
782
|
+
return {
|
|
825
783
|
canvas,
|
|
826
|
-
projection
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
projection.scale(Math.min(size.width, size.height) / 2 * scale).translate([
|
|
832
|
-
size.width / 2 + (translation?.x ?? 0),
|
|
833
|
-
size.height / 2 + (translation?.y ?? 0)
|
|
834
|
-
]).rotate(rotation ?? [
|
|
835
|
-
0,
|
|
836
|
-
0,
|
|
837
|
-
0
|
|
838
|
-
]);
|
|
839
|
-
renderLayers(generator, layers, scale, styles);
|
|
840
|
-
});
|
|
841
|
-
}
|
|
842
|
-
}, [
|
|
843
|
-
generator,
|
|
844
|
-
size,
|
|
845
|
-
scale,
|
|
784
|
+
projection,
|
|
785
|
+
center,
|
|
786
|
+
get zoom() {
|
|
787
|
+
return zoomRef.current;
|
|
788
|
+
},
|
|
846
789
|
translation,
|
|
847
790
|
rotation,
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
791
|
+
setCenter,
|
|
792
|
+
setZoom: (state) => {
|
|
793
|
+
if (typeof state === "function") {
|
|
794
|
+
const is = interpolateNumber(zoomRef.current, state(zoomRef.current));
|
|
795
|
+
transition().ease(zooming.current ? easeLinear : easeSinOut).duration(200).tween("scale", () => (t) => setZoom(is(t))).on("end", () => {
|
|
796
|
+
zooming.current = false;
|
|
797
|
+
});
|
|
798
|
+
} else {
|
|
799
|
+
setZoom(state);
|
|
800
|
+
}
|
|
801
|
+
},
|
|
802
|
+
setTranslation,
|
|
803
|
+
setRotation
|
|
804
|
+
};
|
|
805
|
+
}, [
|
|
806
|
+
canvas
|
|
807
|
+
]);
|
|
808
|
+
const generator = useMemo2(() => canvas && projection && geoPath2(projection, canvas.getContext("2d", {
|
|
809
|
+
alpha: false
|
|
810
|
+
})), [
|
|
811
|
+
canvas,
|
|
812
|
+
projection
|
|
813
|
+
]);
|
|
814
|
+
useEffect4(() => {
|
|
815
|
+
if (canvas && projection) {
|
|
816
|
+
timer(() => {
|
|
817
|
+
projection.scale(Math.min(size.width, size.height) / 2 * zoom).translate([
|
|
818
|
+
size.width / 2 + (translation?.x ?? 0),
|
|
819
|
+
size.height / 2 + (translation?.y ?? 0)
|
|
820
|
+
]).rotate(rotation ?? [
|
|
821
|
+
0,
|
|
822
|
+
0,
|
|
823
|
+
0
|
|
824
|
+
]);
|
|
825
|
+
renderLayers(generator, layers, zoom, styles);
|
|
826
|
+
});
|
|
852
827
|
}
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
828
|
+
}, [
|
|
829
|
+
generator,
|
|
830
|
+
size,
|
|
831
|
+
zoom,
|
|
832
|
+
translation,
|
|
833
|
+
rotation,
|
|
834
|
+
layers
|
|
835
|
+
]);
|
|
836
|
+
if (!size.width || !size.height) {
|
|
837
|
+
return null;
|
|
860
838
|
}
|
|
839
|
+
return /* @__PURE__ */ React2.createElement("canvas", {
|
|
840
|
+
ref: canvasRef,
|
|
841
|
+
width: size.width,
|
|
842
|
+
height: size.height
|
|
843
|
+
});
|
|
861
844
|
});
|
|
862
845
|
var GlobeDebug = ({ position = "topleft" }) => {
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
rotation
|
|
875
|
-
}, null, 2)));
|
|
876
|
-
} finally {
|
|
877
|
-
_effect.f();
|
|
878
|
-
}
|
|
846
|
+
const { size, zoom, translation, rotation } = useGlobeContext();
|
|
847
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
848
|
+
className: mx("z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded-sm", controlPositions[position])
|
|
849
|
+
}, /* @__PURE__ */ React2.createElement("pre", {
|
|
850
|
+
className: "font-mono text-xs text-green-700"
|
|
851
|
+
}, JSON.stringify({
|
|
852
|
+
size,
|
|
853
|
+
zoom,
|
|
854
|
+
translation,
|
|
855
|
+
rotation
|
|
856
|
+
}, null, 2)));
|
|
879
857
|
};
|
|
880
858
|
var GlobePanel = ({ position, classNames, children }) => {
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
className: mx("z-10 absolute overflow-hidden", controlPositions[position], classNames)
|
|
885
|
-
}, children);
|
|
886
|
-
} finally {
|
|
887
|
-
_effect.f();
|
|
888
|
-
}
|
|
859
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
860
|
+
className: mx("z-10 absolute overflow-hidden", controlPositions[position], classNames)
|
|
861
|
+
}, children);
|
|
889
862
|
};
|
|
890
863
|
var CustomControl = ({ position, children }) => {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
className: mx("z-10 absolute overflow-hidden", controlPositions[position])
|
|
895
|
-
}, children);
|
|
896
|
-
} finally {
|
|
897
|
-
_effect.f();
|
|
898
|
-
}
|
|
864
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
865
|
+
className: mx("z-10 absolute overflow-hidden", controlPositions[position])
|
|
866
|
+
}, children);
|
|
899
867
|
};
|
|
868
|
+
var GlobeZoom = ({ onAction, position = "bottomleft", ...props }) => /* @__PURE__ */ React2.createElement(CustomControl, {
|
|
869
|
+
position,
|
|
870
|
+
...props
|
|
871
|
+
}, /* @__PURE__ */ React2.createElement(ZoomControls, {
|
|
872
|
+
onAction
|
|
873
|
+
}));
|
|
874
|
+
var GlobeAction = ({ onAction, position = "bottomright", ...props }) => /* @__PURE__ */ React2.createElement(CustomControl, {
|
|
875
|
+
position,
|
|
876
|
+
...props
|
|
877
|
+
}, /* @__PURE__ */ React2.createElement(ActionControls, {
|
|
878
|
+
onAction
|
|
879
|
+
}));
|
|
900
880
|
var Globe = {
|
|
901
881
|
Root: GlobeRoot,
|
|
902
882
|
Canvas: GlobeCanvas,
|
|
903
|
-
Zoom:
|
|
904
|
-
|
|
905
|
-
try {
|
|
906
|
-
return /* @__PURE__ */ React3.createElement(CustomControl, {
|
|
907
|
-
position,
|
|
908
|
-
...props
|
|
909
|
-
}, /* @__PURE__ */ React3.createElement(ZoomControls, {
|
|
910
|
-
onAction
|
|
911
|
-
}));
|
|
912
|
-
} finally {
|
|
913
|
-
_effect.f();
|
|
914
|
-
}
|
|
915
|
-
},
|
|
916
|
-
Action: ({ onAction, position = "bottomright", ...props }) => {
|
|
917
|
-
var _effect = _useSignals3();
|
|
918
|
-
try {
|
|
919
|
-
return /* @__PURE__ */ React3.createElement(CustomControl, {
|
|
920
|
-
position,
|
|
921
|
-
...props
|
|
922
|
-
}, /* @__PURE__ */ React3.createElement(ActionControls, {
|
|
923
|
-
onAction
|
|
924
|
-
}));
|
|
925
|
-
} finally {
|
|
926
|
-
_effect.f();
|
|
927
|
-
}
|
|
928
|
-
},
|
|
883
|
+
Zoom: GlobeZoom,
|
|
884
|
+
Action: GlobeAction,
|
|
929
885
|
Debug: GlobeDebug,
|
|
930
886
|
Panel: GlobePanel
|
|
931
887
|
};
|
|
932
888
|
|
|
933
889
|
// src/components/Map/Map.tsx
|
|
934
|
-
import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
|
|
935
890
|
import "leaflet/dist/leaflet.css";
|
|
891
|
+
import { createContext as createContext2 } from "@radix-ui/react-context";
|
|
936
892
|
import L, { Control, DomEvent, DomUtil, latLngBounds } from "leaflet";
|
|
937
|
-
import
|
|
893
|
+
import React3, { forwardRef as forwardRef2, useEffect as useEffect5, useImperativeHandle as useImperativeHandle2, useRef as useRef2 } from "react";
|
|
938
894
|
import { createRoot } from "react-dom/client";
|
|
939
|
-
import { MapContainer, Marker, Popup, TileLayer, useMap } from "react-leaflet";
|
|
940
|
-
import { useResizeDetector as useResizeDetector2 } from "react-resize-detector";
|
|
941
|
-
import { debounce } from "@dxos/async";
|
|
895
|
+
import { MapContainer, Marker, Popup, TileLayer, useMap, useMapEvents } from "react-leaflet";
|
|
942
896
|
import { ThemeProvider, Tooltip } from "@dxos/react-ui";
|
|
943
|
-
import { defaultTx, mx as mx2 } from "@dxos/
|
|
897
|
+
import { composable as composable2, composableProps as composableProps2, defaultTx, mx as mx2 } from "@dxos/ui-theme";
|
|
944
898
|
var defaults = {
|
|
945
|
-
// TODO(burdon): Guess location.
|
|
946
899
|
center: {
|
|
947
900
|
lat: 51,
|
|
948
901
|
lng: 0
|
|
949
902
|
},
|
|
950
903
|
zoom: 4
|
|
951
904
|
};
|
|
952
|
-
var
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
905
|
+
var [MapContextProvider, useMapContext] = createContext2("Map");
|
|
906
|
+
var MapRoot = composable2(({ children, onChange, ...props }, forwardedRef) => {
|
|
907
|
+
const attention = false;
|
|
908
|
+
return /* @__PURE__ */ React3.createElement(MapContextProvider, {
|
|
909
|
+
attention,
|
|
910
|
+
onChange
|
|
911
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
912
|
+
...composableProps2(props, {
|
|
913
|
+
role: "none",
|
|
914
|
+
classNames: "dx-container grid dx-focus-ring-inset"
|
|
915
|
+
}),
|
|
916
|
+
ref: forwardedRef
|
|
917
|
+
}, children));
|
|
918
|
+
});
|
|
919
|
+
MapRoot.displayName = "Map.Root";
|
|
920
|
+
var MAP_CONTENT_NAME = "Map.Content";
|
|
921
|
+
var MapContent = /* @__PURE__ */ forwardRef2(({ classNames, scrollWheelZoom = true, doubleClickZoom = true, touchZoom = true, center, zoom, children, ...props }, forwardedRef) => {
|
|
922
|
+
const { attention } = useMapContext(MAP_CONTENT_NAME);
|
|
923
|
+
const mapRef = useRef2(null);
|
|
924
|
+
const map = mapRef.current;
|
|
925
|
+
useImperativeHandle2(forwardedRef, () => ({
|
|
926
|
+
setCenter: (center2, zoom2) => {
|
|
927
|
+
mapRef.current?.setView(center2, zoom2);
|
|
928
|
+
},
|
|
929
|
+
setZoom: (cb) => {
|
|
930
|
+
mapRef.current?.setZoom(cb(mapRef.current?.getZoom() ?? 0));
|
|
931
|
+
}
|
|
932
|
+
}), []);
|
|
933
|
+
useEffect5(() => {
|
|
934
|
+
if (!map) {
|
|
935
|
+
return;
|
|
936
|
+
}
|
|
937
|
+
if (attention) {
|
|
938
|
+
map.scrollWheelZoom.enable();
|
|
939
|
+
} else {
|
|
940
|
+
map.scrollWheelZoom.disable();
|
|
941
|
+
}
|
|
942
|
+
}, [
|
|
943
|
+
map,
|
|
944
|
+
attention
|
|
945
|
+
]);
|
|
946
|
+
return /* @__PURE__ */ React3.createElement(MapContainer, {
|
|
947
|
+
...props,
|
|
948
|
+
className: mx2("group relative grid bg-base-surface!", classNames),
|
|
949
|
+
attributionControl: false,
|
|
950
|
+
zoomControl: false,
|
|
951
|
+
scrollWheelZoom,
|
|
952
|
+
doubleClickZoom,
|
|
953
|
+
touchZoom,
|
|
954
|
+
center: center ?? defaults.center,
|
|
955
|
+
zoom: zoom ?? defaults.zoom,
|
|
956
|
+
whenReady: () => {
|
|
957
|
+
},
|
|
958
|
+
ref: mapRef
|
|
959
|
+
}, children);
|
|
960
|
+
});
|
|
961
|
+
MapContent.displayName = "Map.Content";
|
|
962
|
+
var MAP_TILES_NAME = "Map.Tiles";
|
|
963
|
+
var MapTiles = (_props) => {
|
|
964
|
+
const ref = useRef2(null);
|
|
965
|
+
const { onChange } = useMapContext(MAP_TILES_NAME);
|
|
966
|
+
useMapEvents({
|
|
967
|
+
zoomstart: (ev) => {
|
|
968
|
+
onChange?.({
|
|
969
|
+
center: ev.target.getCenter(),
|
|
970
|
+
zoom: ev.target.getZoom()
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
});
|
|
974
|
+
const { attention } = useMapContext(MAP_TILES_NAME);
|
|
975
|
+
useEffect5(() => {
|
|
976
|
+
if (ref.current) {
|
|
977
|
+
ref.current.getContainer().dataset.attention = attention ? "1" : "0";
|
|
978
|
+
}
|
|
979
|
+
}, [
|
|
980
|
+
attention
|
|
981
|
+
]);
|
|
982
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(TileLayer, {
|
|
983
|
+
ref,
|
|
984
|
+
"data-attention": attention,
|
|
985
|
+
detectRetina: true,
|
|
986
|
+
className: 'dark:grayscale dark:invert data-[attention="0"]:!opacity-80',
|
|
987
|
+
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
988
|
+
keepBuffer: 4
|
|
989
|
+
}));
|
|
968
990
|
};
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
991
|
+
MapTiles.displayName = MAP_TILES_NAME;
|
|
992
|
+
var MapMarkers = ({ selected, markers }) => {
|
|
993
|
+
const map = useMap();
|
|
994
|
+
useEffect5(() => {
|
|
995
|
+
if (markers.length > 0) {
|
|
996
|
+
const bounds = latLngBounds(markers.map((marker) => marker.location));
|
|
997
|
+
map.fitBounds(bounds);
|
|
998
|
+
} else {
|
|
999
|
+
map.setView(defaults.center, defaults.zoom);
|
|
1000
|
+
}
|
|
1001
|
+
}, [
|
|
1002
|
+
markers
|
|
1003
|
+
]);
|
|
1004
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, markers?.map(({ id, title, location: { lat, lng } }) => {
|
|
1005
|
+
return /* @__PURE__ */ React3.createElement(Marker, {
|
|
1006
|
+
key: id,
|
|
1007
|
+
position: {
|
|
1008
|
+
lat,
|
|
1009
|
+
lng
|
|
979
1010
|
},
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
});
|
|
1010
|
-
}, 100);
|
|
1011
|
-
map.on("move", handler);
|
|
1012
|
-
map.on("zoom", handler);
|
|
1013
|
-
return () => {
|
|
1014
|
-
map.off("move", handler);
|
|
1015
|
-
map.off("zoom", handler);
|
|
1016
|
-
};
|
|
1017
|
-
}, [
|
|
1018
|
-
map,
|
|
1019
|
-
onChange
|
|
1020
|
-
]);
|
|
1021
|
-
useEffect5(() => {
|
|
1022
|
-
if (markers.length > 0) {
|
|
1023
|
-
const bounds = latLngBounds(markers.map((marker) => marker.location));
|
|
1024
|
-
map.fitBounds(bounds);
|
|
1025
|
-
} else {
|
|
1026
|
-
map.setView(defaults.center, defaults.zoom);
|
|
1027
|
-
}
|
|
1028
|
-
}, [
|
|
1029
|
-
markers
|
|
1030
|
-
]);
|
|
1031
|
-
return /* @__PURE__ */ React4.createElement("div", {
|
|
1032
|
-
ref,
|
|
1033
|
-
className: "flex w-full h-full overflow-hidden bg-baseSurface"
|
|
1034
|
-
}, /* @__PURE__ */ React4.createElement(TileLayer, {
|
|
1035
|
-
className: "dark:filter dark:grayscale dark:invert",
|
|
1036
|
-
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
|
1037
|
-
}), markers?.map(({ id, title, location: { lat, lng } }) => {
|
|
1038
|
-
return /* @__PURE__ */ React4.createElement(Marker, {
|
|
1039
|
-
key: id,
|
|
1040
|
-
position: {
|
|
1041
|
-
lat,
|
|
1042
|
-
lng
|
|
1043
|
-
},
|
|
1044
|
-
icon: (
|
|
1045
|
-
// TODO(burdon): Create custom icon from bundled assets.
|
|
1046
|
-
new L.Icon({
|
|
1047
|
-
iconUrl: "https://dxos.network/marker-icon.png",
|
|
1048
|
-
iconRetinaUrl: "https://dxos.network/marker-icon-2x.png",
|
|
1049
|
-
shadowUrl: "https://dxos.network/marker-shadow.png",
|
|
1050
|
-
iconSize: [
|
|
1051
|
-
25,
|
|
1052
|
-
41
|
|
1053
|
-
],
|
|
1054
|
-
iconAnchor: [
|
|
1055
|
-
12,
|
|
1056
|
-
41
|
|
1057
|
-
],
|
|
1058
|
-
popupAnchor: [
|
|
1059
|
-
1,
|
|
1060
|
-
-34
|
|
1061
|
-
],
|
|
1062
|
-
shadowSize: [
|
|
1063
|
-
41,
|
|
1064
|
-
41
|
|
1065
|
-
]
|
|
1066
|
-
})
|
|
1067
|
-
)
|
|
1068
|
-
}, title && /* @__PURE__ */ React4.createElement(Popup, null, title));
|
|
1069
|
-
}));
|
|
1070
|
-
} finally {
|
|
1071
|
-
_effect.f();
|
|
1072
|
-
}
|
|
1073
|
-
});
|
|
1011
|
+
icon: (
|
|
1012
|
+
// TODO(burdon): Create custom icon from bundled assets.
|
|
1013
|
+
// TODO(burdon): Selection state.
|
|
1014
|
+
new L.Icon({
|
|
1015
|
+
iconUrl: "https://dxos.network/marker-icon.png",
|
|
1016
|
+
iconRetinaUrl: "https://dxos.network/marker-icon-2x.png",
|
|
1017
|
+
shadowUrl: "https://dxos.network/marker-shadow.png",
|
|
1018
|
+
iconSize: [
|
|
1019
|
+
25,
|
|
1020
|
+
41
|
|
1021
|
+
],
|
|
1022
|
+
iconAnchor: [
|
|
1023
|
+
12,
|
|
1024
|
+
41
|
|
1025
|
+
],
|
|
1026
|
+
popupAnchor: [
|
|
1027
|
+
1,
|
|
1028
|
+
-34
|
|
1029
|
+
],
|
|
1030
|
+
shadowSize: [
|
|
1031
|
+
41,
|
|
1032
|
+
41
|
|
1033
|
+
]
|
|
1034
|
+
})
|
|
1035
|
+
)
|
|
1036
|
+
}, title && /* @__PURE__ */ React3.createElement(Popup, null, title));
|
|
1037
|
+
}));
|
|
1038
|
+
};
|
|
1039
|
+
MapMarkers.displayName = "Map.Markers";
|
|
1074
1040
|
var CustomControl2 = ({ position, children }) => {
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
control.
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
]);
|
|
1101
|
-
return null;
|
|
1102
|
-
} finally {
|
|
1103
|
-
_effect.f();
|
|
1104
|
-
}
|
|
1041
|
+
const map = useMap();
|
|
1042
|
+
useEffect5(() => {
|
|
1043
|
+
const control = new Control({
|
|
1044
|
+
position
|
|
1045
|
+
});
|
|
1046
|
+
control.onAdd = () => {
|
|
1047
|
+
const container = DomUtil.create("div", mx2("m-0!", controlPositions[position]));
|
|
1048
|
+
DomEvent.disableClickPropagation(container);
|
|
1049
|
+
DomEvent.disableScrollPropagation(container);
|
|
1050
|
+
const root = createRoot(container);
|
|
1051
|
+
root.render(/* @__PURE__ */ React3.createElement(ThemeProvider, {
|
|
1052
|
+
tx: defaultTx
|
|
1053
|
+
}, /* @__PURE__ */ React3.createElement(Tooltip.Provider, null, children)));
|
|
1054
|
+
return container;
|
|
1055
|
+
};
|
|
1056
|
+
control.addTo(map);
|
|
1057
|
+
return () => {
|
|
1058
|
+
control.remove();
|
|
1059
|
+
};
|
|
1060
|
+
}, [
|
|
1061
|
+
map,
|
|
1062
|
+
position,
|
|
1063
|
+
children
|
|
1064
|
+
]);
|
|
1065
|
+
return null;
|
|
1105
1066
|
};
|
|
1067
|
+
var MapZoom = ({ onAction, position = "bottomleft", ...props }) => /* @__PURE__ */ React3.createElement(CustomControl2, {
|
|
1068
|
+
position,
|
|
1069
|
+
...props
|
|
1070
|
+
}, /* @__PURE__ */ React3.createElement(ZoomControls, {
|
|
1071
|
+
onAction
|
|
1072
|
+
}));
|
|
1073
|
+
var MapAction = ({ onAction, position = "bottomright", ...props }) => /* @__PURE__ */ React3.createElement(CustomControl2, {
|
|
1074
|
+
position,
|
|
1075
|
+
...props
|
|
1076
|
+
}, /* @__PURE__ */ React3.createElement(ActionControls, {
|
|
1077
|
+
onAction
|
|
1078
|
+
}));
|
|
1106
1079
|
var Map = {
|
|
1107
1080
|
Root: MapRoot,
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
position,
|
|
1114
|
-
...props
|
|
1115
|
-
}, /* @__PURE__ */ React4.createElement(ZoomControls, {
|
|
1116
|
-
onAction
|
|
1117
|
-
}));
|
|
1118
|
-
} finally {
|
|
1119
|
-
_effect.f();
|
|
1120
|
-
}
|
|
1121
|
-
},
|
|
1122
|
-
Action: ({ onAction, position = "bottomright", ...props }) => {
|
|
1123
|
-
var _effect = _useSignals4();
|
|
1124
|
-
try {
|
|
1125
|
-
return /* @__PURE__ */ React4.createElement(CustomControl2, {
|
|
1126
|
-
position,
|
|
1127
|
-
...props
|
|
1128
|
-
}, /* @__PURE__ */ React4.createElement(ActionControls, {
|
|
1129
|
-
onAction
|
|
1130
|
-
}));
|
|
1131
|
-
} finally {
|
|
1132
|
-
_effect.f();
|
|
1133
|
-
}
|
|
1134
|
-
}
|
|
1081
|
+
Content: MapContent,
|
|
1082
|
+
Tiles: MapTiles,
|
|
1083
|
+
Markers: MapMarkers,
|
|
1084
|
+
Zoom: MapZoom,
|
|
1085
|
+
Action: MapAction
|
|
1135
1086
|
};
|
|
1136
1087
|
export {
|
|
1137
1088
|
ActionControls,
|
|
1138
1089
|
Globe,
|
|
1139
|
-
|
|
1090
|
+
GlobeContext,
|
|
1140
1091
|
Map,
|
|
1141
1092
|
ZoomControls,
|
|
1142
1093
|
closestPoint,
|
|
@@ -1153,6 +1104,8 @@ export {
|
|
|
1153
1104
|
renderLayers,
|
|
1154
1105
|
restrictAxis,
|
|
1155
1106
|
timer,
|
|
1107
|
+
translationKey,
|
|
1108
|
+
translations,
|
|
1156
1109
|
useDrag,
|
|
1157
1110
|
useGlobeContext,
|
|
1158
1111
|
useGlobeZoomHandler,
|