@dxos/react-ui-geo 0.8.4-main.ef1bc66f44 → 0.8.4-main.f466a3d56e
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/LICENSE +102 -5
- package/dist/lib/browser/{countries-110m-ZM3ZIEFS.mjs → countries-110m-RE5RNRQG.mjs} +1 -1
- package/dist/lib/browser/data.mjs +4 -3
- package/dist/lib/browser/data.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +101 -117
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/translations.mjs +19 -0
- package/dist/lib/browser/translations.mjs.map +7 -0
- package/dist/lib/node-esm/{countries-110m-3SFASWVD.mjs → countries-110m-4EDBXSFJ.mjs} +1 -1
- package/dist/lib/node-esm/data.mjs +5 -3
- package/dist/lib/node-esm/data.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +101 -116
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/translations.mjs +21 -0
- package/dist/lib/node-esm/translations.mjs.map +7 -0
- package/dist/types/data/airports.d.ts +4 -4
- package/dist/types/data/airports.d.ts.map +1 -1
- package/dist/types/data/cities.d.ts.map +1 -1
- package/dist/types/data/countries-110m.d.ts.map +1 -1
- package/dist/types/data/countries-dots-3.d.ts.map +1 -1
- package/dist/types/data/countries-dots-4.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.d.ts +5 -3
- package/dist/types/src/components/Globe/Globe.d.ts.map +1 -1
- package/dist/types/src/components/Globe/Globe.stories.d.ts +6 -4
- package/dist/types/src/components/Globe/Globe.stories.d.ts.map +1 -1
- package/dist/types/src/components/Map/Map.d.ts +18 -4
- package/dist/types/src/components/Map/Map.d.ts.map +1 -1
- 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/hooks/context.d.ts +1 -3
- package/dist/types/src/hooks/context.d.ts.map +1 -1
- package/dist/types/src/hooks/useDrag.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.map +1 -1
- package/dist/types/src/hooks/useTour.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +4 -4
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/util/debug.d.ts.map +1 -1
- package/dist/types/src/util/inertia.d.ts.map +1 -1
- package/dist/types/src/util/path.d.ts.map +1 -1
- package/dist/types/src/util/render.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +27 -24
- package/src/components/Globe/Globe.stories.tsx +8 -9
- package/src/components/Globe/Globe.tsx +48 -22
- package/src/components/Map/Map.stories.tsx +9 -8
- package/src/components/Map/Map.tsx +65 -26
- package/src/components/Toolbar/Controls.tsx +5 -5
- package/src/hooks/context.tsx +5 -34
- package/src/hooks/useSpinner.ts +0 -1
- package/src/index.ts +0 -2
- package/src/translations.ts +4 -4
- package/src/util/render.ts +0 -1
- package/dist/lib/browser/chunk-GMWLKTLN.mjs +0 -9
- package/dist/lib/browser/chunk-GMWLKTLN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JODBF4CC.mjs +0 -11
- package/dist/lib/node-esm/chunk-JODBF4CC.mjs.map +0 -7
- /package/dist/lib/browser/{countries-110m-ZM3ZIEFS.mjs.map → countries-110m-RE5RNRQG.mjs.map} +0 -0
- /package/dist/lib/node-esm/{countries-110m-3SFASWVD.mjs.map → countries-110m-4EDBXSFJ.mjs.map} +0 -0
|
@@ -1,46 +1,16 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
loadTopology
|
|
4
|
-
} from "./chunk-JODBF4CC.mjs";
|
|
5
2
|
|
|
6
3
|
// src/components/Globe/Globe.tsx
|
|
7
4
|
import { easeLinear, easeSinOut, geoMercator, geoOrthographic, geoPath as geoPath2, geoTransverseMercator, interpolateNumber, transition } from "d3";
|
|
8
|
-
import
|
|
5
|
+
import React2, { forwardRef, useEffect as useEffect4, useImperativeHandle, useMemo as useMemo2, useRef, useState as useState3 } from "react";
|
|
9
6
|
import { useResizeDetector } from "react-resize-detector";
|
|
10
|
-
import { useDynamicRef, useThemeContext } from "@dxos/react-ui";
|
|
11
|
-
import { mx } from "@dxos/ui-theme";
|
|
7
|
+
import { useComposedRefs, useControlledState, useDynamicRef, useThemeContext } from "@dxos/react-ui";
|
|
8
|
+
import { composable, composableProps, mx } from "@dxos/ui-theme";
|
|
12
9
|
|
|
13
10
|
// src/hooks/context.tsx
|
|
14
|
-
import
|
|
11
|
+
import { createContext, useContext } from "react";
|
|
15
12
|
import { raise } from "@dxos/debug";
|
|
16
|
-
import { useControlledState } from "@dxos/react-ui";
|
|
17
|
-
var defaults = {
|
|
18
|
-
center: {
|
|
19
|
-
lat: 51,
|
|
20
|
-
lng: 0
|
|
21
|
-
},
|
|
22
|
-
zoom: 4
|
|
23
|
-
};
|
|
24
13
|
var GlobeContext = /* @__PURE__ */ createContext(void 0);
|
|
25
|
-
var GlobeContextProvider = ({ children, size, center: centerProp = defaults.center, zoom: zoomProp = defaults.zoom, translation: translationProp, rotation: rotationProp }) => {
|
|
26
|
-
const [center, setCenter] = useControlledState(centerProp);
|
|
27
|
-
const [zoom, setZoom] = useControlledState(zoomProp);
|
|
28
|
-
const [translation, setTranslation] = useControlledState(translationProp);
|
|
29
|
-
const [rotation, setRotation] = useControlledState(rotationProp);
|
|
30
|
-
return /* @__PURE__ */ React.createElement(GlobeContext.Provider, {
|
|
31
|
-
value: {
|
|
32
|
-
size,
|
|
33
|
-
center,
|
|
34
|
-
zoom,
|
|
35
|
-
translation,
|
|
36
|
-
rotation,
|
|
37
|
-
setCenter,
|
|
38
|
-
setZoom,
|
|
39
|
-
setTranslation,
|
|
40
|
-
setRotation
|
|
41
|
-
}
|
|
42
|
-
}, children);
|
|
43
|
-
};
|
|
44
14
|
var useGlobeContext = () => {
|
|
45
15
|
return useContext(GlobeContext) ?? raise(new Error("Missing GlobeContext"));
|
|
46
16
|
};
|
|
@@ -625,25 +595,9 @@ var useTour = (controller, points, options = {}) => {
|
|
|
625
595
|
};
|
|
626
596
|
|
|
627
597
|
// src/components/Toolbar/Controls.tsx
|
|
628
|
-
import
|
|
598
|
+
import React from "react";
|
|
629
599
|
import { IconButton, Toolbar, useTranslation } from "@dxos/react-ui";
|
|
630
|
-
|
|
631
|
-
// src/translations.ts
|
|
632
|
-
var translationKey = "@dxos/react-ui-geo";
|
|
633
|
-
var translations = [
|
|
634
|
-
{
|
|
635
|
-
"en-US": {
|
|
636
|
-
[translationKey]: {
|
|
637
|
-
"zoom in icon button": "Zoom in",
|
|
638
|
-
"zoom out icon button": "Zoom out",
|
|
639
|
-
"start icon button": "Start",
|
|
640
|
-
"toggle icon button": "Toggle"
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
];
|
|
645
|
-
|
|
646
|
-
// src/components/Toolbar/Controls.tsx
|
|
600
|
+
import { translationKey } from "#translations";
|
|
647
601
|
var controlPositions = {
|
|
648
602
|
topleft: "top-2 left-2",
|
|
649
603
|
topright: "top-2 right-2",
|
|
@@ -652,39 +606,39 @@ var controlPositions = {
|
|
|
652
606
|
};
|
|
653
607
|
var ZoomControls = ({ classNames, onAction }) => {
|
|
654
608
|
const { t } = useTranslation(translationKey);
|
|
655
|
-
return /* @__PURE__ */
|
|
609
|
+
return /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
656
610
|
classNames: [
|
|
657
611
|
"gap-2",
|
|
658
612
|
classNames
|
|
659
613
|
]
|
|
660
|
-
}, /* @__PURE__ */
|
|
614
|
+
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
661
615
|
icon: "ph--plus--regular",
|
|
662
616
|
iconOnly: true,
|
|
663
|
-
label: t("zoom
|
|
617
|
+
label: t("zoom-in-icon.button"),
|
|
664
618
|
onClick: () => onAction?.("zoom-in")
|
|
665
|
-
}), /* @__PURE__ */
|
|
619
|
+
}), /* @__PURE__ */ React.createElement(IconButton, {
|
|
666
620
|
icon: "ph--minus--regular",
|
|
667
621
|
iconOnly: true,
|
|
668
|
-
label: t("zoom
|
|
622
|
+
label: t("zoom-out-icon.button"),
|
|
669
623
|
onClick: () => onAction?.("zoom-out")
|
|
670
624
|
}));
|
|
671
625
|
};
|
|
672
626
|
var ActionControls = ({ classNames, onAction }) => {
|
|
673
627
|
const { t } = useTranslation(translationKey);
|
|
674
|
-
return /* @__PURE__ */
|
|
628
|
+
return /* @__PURE__ */ React.createElement(Toolbar.Root, {
|
|
675
629
|
classNames: [
|
|
676
630
|
"gap-2",
|
|
677
631
|
classNames
|
|
678
632
|
]
|
|
679
|
-
}, /* @__PURE__ */
|
|
633
|
+
}, /* @__PURE__ */ React.createElement(IconButton, {
|
|
680
634
|
icon: "ph--path--regular",
|
|
681
635
|
iconOnly: true,
|
|
682
|
-
label: t("start
|
|
636
|
+
label: t("start-icon.button"),
|
|
683
637
|
onClick: () => onAction?.("start")
|
|
684
|
-
}), /* @__PURE__ */
|
|
638
|
+
}), /* @__PURE__ */ React.createElement(IconButton, {
|
|
685
639
|
icon: "ph--globe-hemisphere-west--regular",
|
|
686
640
|
iconOnly: true,
|
|
687
|
-
label: t("toggle
|
|
641
|
+
label: t("toggle-icon.button"),
|
|
688
642
|
onClick: () => onAction?.("toggle")
|
|
689
643
|
}));
|
|
690
644
|
};
|
|
@@ -744,19 +698,38 @@ var getProjection = (type = "orthographic") => {
|
|
|
744
698
|
}
|
|
745
699
|
return type ?? geoOrthographic();
|
|
746
700
|
};
|
|
747
|
-
var GlobeRoot = ({
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
701
|
+
var GlobeRoot = composable(({ children, center: centerProp, zoom: zoomProp, translation: translationProp, rotation: rotationProp, ...props }, forwardedRef) => {
|
|
702
|
+
const localRef = useRef(null);
|
|
703
|
+
const composedRef = useComposedRefs(localRef, forwardedRef);
|
|
704
|
+
const { width, height } = useResizeDetector({
|
|
705
|
+
targetRef: localRef
|
|
706
|
+
});
|
|
707
|
+
const [center, setCenter] = useControlledState(centerProp);
|
|
708
|
+
const [zoom, setZoom] = useControlledState(zoomProp ?? 4);
|
|
709
|
+
const [translation, setTranslation] = useControlledState(translationProp);
|
|
710
|
+
const [rotation, setRotation] = useControlledState(rotationProp);
|
|
711
|
+
return /* @__PURE__ */ React2.createElement(GlobeContext.Provider, {
|
|
712
|
+
value: {
|
|
713
|
+
size: {
|
|
714
|
+
width,
|
|
715
|
+
height
|
|
716
|
+
},
|
|
717
|
+
center,
|
|
718
|
+
zoom,
|
|
719
|
+
translation,
|
|
720
|
+
rotation,
|
|
721
|
+
setCenter,
|
|
722
|
+
setZoom,
|
|
723
|
+
setTranslation,
|
|
724
|
+
setRotation
|
|
725
|
+
}
|
|
726
|
+
}, /* @__PURE__ */ React2.createElement("div", {
|
|
727
|
+
...composableProps(props, {
|
|
728
|
+
classNames: "relative dx-container"
|
|
729
|
+
}),
|
|
730
|
+
ref: composedRef
|
|
758
731
|
}, children));
|
|
759
|
-
};
|
|
732
|
+
});
|
|
760
733
|
var GlobeCanvas = /* @__PURE__ */ forwardRef(({ projection: projectionProp, topology, features, styles: stylesProp }, forwardRef3) => {
|
|
761
734
|
const { themeMode } = useThemeContext();
|
|
762
735
|
const styles = useMemo2(() => stylesProp ?? defaultStyles[themeMode], [
|
|
@@ -844,7 +817,7 @@ var GlobeCanvas = /* @__PURE__ */ forwardRef(({ projection: projectionProp, topo
|
|
|
844
817
|
if (!size.width || !size.height) {
|
|
845
818
|
return null;
|
|
846
819
|
}
|
|
847
|
-
return /* @__PURE__ */
|
|
820
|
+
return /* @__PURE__ */ React2.createElement("canvas", {
|
|
848
821
|
ref: canvasRef,
|
|
849
822
|
width: size.width,
|
|
850
823
|
height: size.height
|
|
@@ -852,9 +825,9 @@ var GlobeCanvas = /* @__PURE__ */ forwardRef(({ projection: projectionProp, topo
|
|
|
852
825
|
});
|
|
853
826
|
var GlobeDebug = ({ position = "topleft" }) => {
|
|
854
827
|
const { size, zoom, translation, rotation } = useGlobeContext();
|
|
855
|
-
return /* @__PURE__ */
|
|
856
|
-
className: mx("z-10 absolute
|
|
857
|
-
}, /* @__PURE__ */
|
|
828
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
829
|
+
className: mx("z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded-sm", controlPositions[position])
|
|
830
|
+
}, /* @__PURE__ */ React2.createElement("pre", {
|
|
858
831
|
className: "font-mono text-xs text-green-700"
|
|
859
832
|
}, JSON.stringify({
|
|
860
833
|
size,
|
|
@@ -864,25 +837,25 @@ var GlobeDebug = ({ position = "topleft" }) => {
|
|
|
864
837
|
}, null, 2)));
|
|
865
838
|
};
|
|
866
839
|
var GlobePanel = ({ position, classNames, children }) => {
|
|
867
|
-
return /* @__PURE__ */
|
|
840
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
868
841
|
className: mx("z-10 absolute overflow-hidden", controlPositions[position], classNames)
|
|
869
842
|
}, children);
|
|
870
843
|
};
|
|
871
844
|
var CustomControl = ({ position, children }) => {
|
|
872
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
873
846
|
className: mx("z-10 absolute overflow-hidden", controlPositions[position])
|
|
874
847
|
}, children);
|
|
875
848
|
};
|
|
876
|
-
var GlobeZoom = ({ onAction, position = "bottomleft", ...props }) => /* @__PURE__ */
|
|
849
|
+
var GlobeZoom = ({ onAction, position = "bottomleft", ...props }) => /* @__PURE__ */ React2.createElement(CustomControl, {
|
|
877
850
|
position,
|
|
878
851
|
...props
|
|
879
|
-
}, /* @__PURE__ */
|
|
852
|
+
}, /* @__PURE__ */ React2.createElement(ZoomControls, {
|
|
880
853
|
onAction
|
|
881
854
|
}));
|
|
882
|
-
var GlobeAction = ({ onAction, position = "bottomright", ...props }) => /* @__PURE__ */
|
|
855
|
+
var GlobeAction = ({ onAction, position = "bottomright", ...props }) => /* @__PURE__ */ React2.createElement(CustomControl, {
|
|
883
856
|
position,
|
|
884
857
|
...props
|
|
885
|
-
}, /* @__PURE__ */
|
|
858
|
+
}, /* @__PURE__ */ React2.createElement(ActionControls, {
|
|
886
859
|
onAction
|
|
887
860
|
}));
|
|
888
861
|
var Globe = {
|
|
@@ -898,21 +871,36 @@ var Globe = {
|
|
|
898
871
|
import "leaflet/dist/leaflet.css";
|
|
899
872
|
import { createContext as createContext2 } from "@radix-ui/react-context";
|
|
900
873
|
import L, { Control, DomEvent, DomUtil, latLngBounds } from "leaflet";
|
|
901
|
-
import
|
|
874
|
+
import React3, { forwardRef as forwardRef2, useEffect as useEffect5, useImperativeHandle as useImperativeHandle2, useRef as useRef2 } from "react";
|
|
902
875
|
import { createRoot } from "react-dom/client";
|
|
903
876
|
import { MapContainer, Marker, Popup, TileLayer, useMap, useMapEvents } from "react-leaflet";
|
|
904
877
|
import { ThemeProvider, Tooltip } from "@dxos/react-ui";
|
|
905
|
-
import { defaultTx, mx as mx2 } from "@dxos/ui-theme";
|
|
906
|
-
var
|
|
878
|
+
import { composable as composable2, composableProps as composableProps2, defaultTx, mx as mx2 } from "@dxos/ui-theme";
|
|
879
|
+
var defaults = {
|
|
907
880
|
center: {
|
|
908
881
|
lat: 51,
|
|
909
882
|
lng: 0
|
|
910
883
|
},
|
|
911
884
|
zoom: 4
|
|
912
885
|
};
|
|
913
|
-
var [
|
|
914
|
-
var MapRoot =
|
|
915
|
-
const
|
|
886
|
+
var [MapContextProvider, useMapContext] = createContext2("Map");
|
|
887
|
+
var MapRoot = composable2(({ children, onChange, ...props }, forwardedRef) => {
|
|
888
|
+
const attention = false;
|
|
889
|
+
return /* @__PURE__ */ React3.createElement(MapContextProvider, {
|
|
890
|
+
attention,
|
|
891
|
+
onChange
|
|
892
|
+
}, /* @__PURE__ */ React3.createElement("div", {
|
|
893
|
+
...composableProps2(props, {
|
|
894
|
+
role: "none",
|
|
895
|
+
classNames: "dx-container grid dx-focus-ring-inset"
|
|
896
|
+
}),
|
|
897
|
+
ref: forwardedRef
|
|
898
|
+
}, children));
|
|
899
|
+
});
|
|
900
|
+
MapRoot.displayName = "Map.Root";
|
|
901
|
+
var MAP_CONTENT_NAME = "Map.Content";
|
|
902
|
+
var MapContent = /* @__PURE__ */ forwardRef2(({ classNames, scrollWheelZoom = true, doubleClickZoom = true, touchZoom = true, center, zoom, children, ...props }, forwardedRef) => {
|
|
903
|
+
const { attention } = useMapContext(MAP_CONTENT_NAME);
|
|
916
904
|
const mapRef = useRef2(null);
|
|
917
905
|
const map = mapRef.current;
|
|
918
906
|
useImperativeHandle2(forwardedRef, () => ({
|
|
@@ -936,23 +924,22 @@ var MapRoot = /* @__PURE__ */ forwardRef2(({ classNames, scrollWheelZoom = true,
|
|
|
936
924
|
map,
|
|
937
925
|
attention
|
|
938
926
|
]);
|
|
939
|
-
return /* @__PURE__ */
|
|
940
|
-
attention,
|
|
941
|
-
onChange
|
|
942
|
-
}, /* @__PURE__ */ React4.createElement(MapContainer, {
|
|
927
|
+
return /* @__PURE__ */ React3.createElement(MapContainer, {
|
|
943
928
|
...props,
|
|
944
|
-
|
|
945
|
-
className: mx2("group relative grid bs-full is-full !bg-baseSurface dx-focus-ring-inset", classNames),
|
|
929
|
+
className: mx2("group relative grid bg-base-surface!", classNames),
|
|
946
930
|
attributionControl: false,
|
|
947
931
|
zoomControl: false,
|
|
948
932
|
scrollWheelZoom,
|
|
949
933
|
doubleClickZoom,
|
|
950
934
|
touchZoom,
|
|
951
|
-
center: center ??
|
|
952
|
-
zoom: zoom ??
|
|
953
|
-
|
|
935
|
+
center: center ?? defaults.center,
|
|
936
|
+
zoom: zoom ?? defaults.zoom,
|
|
937
|
+
whenReady: () => {
|
|
938
|
+
},
|
|
939
|
+
ref: mapRef
|
|
940
|
+
}, children);
|
|
954
941
|
});
|
|
955
|
-
|
|
942
|
+
MapContent.displayName = "Map.Content";
|
|
956
943
|
var MAP_TILES_NAME = "Map.Tiles";
|
|
957
944
|
var MapTiles = (_props) => {
|
|
958
945
|
const ref = useRef2(null);
|
|
@@ -973,7 +960,7 @@ var MapTiles = (_props) => {
|
|
|
973
960
|
}, [
|
|
974
961
|
attention
|
|
975
962
|
]);
|
|
976
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(TileLayer, {
|
|
977
964
|
ref,
|
|
978
965
|
"data-attention": attention,
|
|
979
966
|
detectRetina: true,
|
|
@@ -990,13 +977,13 @@ var MapMarkers = ({ selected, markers }) => {
|
|
|
990
977
|
const bounds = latLngBounds(markers.map((marker) => marker.location));
|
|
991
978
|
map.fitBounds(bounds);
|
|
992
979
|
} else {
|
|
993
|
-
map.setView(
|
|
980
|
+
map.setView(defaults.center, defaults.zoom);
|
|
994
981
|
}
|
|
995
982
|
}, [
|
|
996
983
|
markers
|
|
997
984
|
]);
|
|
998
|
-
return /* @__PURE__ */
|
|
999
|
-
return /* @__PURE__ */
|
|
985
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, markers?.map(({ id, title, location: { lat, lng } }) => {
|
|
986
|
+
return /* @__PURE__ */ React3.createElement(Marker, {
|
|
1000
987
|
key: id,
|
|
1001
988
|
position: {
|
|
1002
989
|
lat,
|
|
@@ -1027,7 +1014,7 @@ var MapMarkers = ({ selected, markers }) => {
|
|
|
1027
1014
|
]
|
|
1028
1015
|
})
|
|
1029
1016
|
)
|
|
1030
|
-
}, title && /* @__PURE__ */
|
|
1017
|
+
}, title && /* @__PURE__ */ React3.createElement(Popup, null, title));
|
|
1031
1018
|
}));
|
|
1032
1019
|
};
|
|
1033
1020
|
MapMarkers.displayName = "Map.Markers";
|
|
@@ -1038,13 +1025,13 @@ var CustomControl2 = ({ position, children }) => {
|
|
|
1038
1025
|
position
|
|
1039
1026
|
});
|
|
1040
1027
|
control.onAdd = () => {
|
|
1041
|
-
const container = DomUtil.create("div", mx2("
|
|
1028
|
+
const container = DomUtil.create("div", mx2("m-0!", controlPositions[position]));
|
|
1042
1029
|
DomEvent.disableClickPropagation(container);
|
|
1043
1030
|
DomEvent.disableScrollPropagation(container);
|
|
1044
1031
|
const root = createRoot(container);
|
|
1045
|
-
root.render(/* @__PURE__ */
|
|
1032
|
+
root.render(/* @__PURE__ */ React3.createElement(ThemeProvider, {
|
|
1046
1033
|
tx: defaultTx
|
|
1047
|
-
}, /* @__PURE__ */
|
|
1034
|
+
}, /* @__PURE__ */ React3.createElement(Tooltip.Provider, null, children)));
|
|
1048
1035
|
return container;
|
|
1049
1036
|
};
|
|
1050
1037
|
control.addTo(map);
|
|
@@ -1058,20 +1045,21 @@ var CustomControl2 = ({ position, children }) => {
|
|
|
1058
1045
|
]);
|
|
1059
1046
|
return null;
|
|
1060
1047
|
};
|
|
1061
|
-
var MapZoom = ({ onAction, position = "bottomleft", ...props }) => /* @__PURE__ */
|
|
1048
|
+
var MapZoom = ({ onAction, position = "bottomleft", ...props }) => /* @__PURE__ */ React3.createElement(CustomControl2, {
|
|
1062
1049
|
position,
|
|
1063
1050
|
...props
|
|
1064
|
-
}, /* @__PURE__ */
|
|
1051
|
+
}, /* @__PURE__ */ React3.createElement(ZoomControls, {
|
|
1065
1052
|
onAction
|
|
1066
1053
|
}));
|
|
1067
|
-
var MapAction = ({ onAction, position = "bottomright", ...props }) => /* @__PURE__ */
|
|
1054
|
+
var MapAction = ({ onAction, position = "bottomright", ...props }) => /* @__PURE__ */ React3.createElement(CustomControl2, {
|
|
1068
1055
|
position,
|
|
1069
1056
|
...props
|
|
1070
|
-
}, /* @__PURE__ */
|
|
1057
|
+
}, /* @__PURE__ */ React3.createElement(ActionControls, {
|
|
1071
1058
|
onAction
|
|
1072
1059
|
}));
|
|
1073
1060
|
var Map = {
|
|
1074
1061
|
Root: MapRoot,
|
|
1062
|
+
Content: MapContent,
|
|
1075
1063
|
Tiles: MapTiles,
|
|
1076
1064
|
Markers: MapMarkers,
|
|
1077
1065
|
Zoom: MapZoom,
|
|
@@ -1080,7 +1068,7 @@ var Map = {
|
|
|
1080
1068
|
export {
|
|
1081
1069
|
ActionControls,
|
|
1082
1070
|
Globe,
|
|
1083
|
-
|
|
1071
|
+
GlobeContext,
|
|
1084
1072
|
Map,
|
|
1085
1073
|
ZoomControls,
|
|
1086
1074
|
closestPoint,
|
|
@@ -1092,13 +1080,10 @@ export {
|
|
|
1092
1080
|
geoPoint,
|
|
1093
1081
|
geoToPosition,
|
|
1094
1082
|
getDistance,
|
|
1095
|
-
loadTopology,
|
|
1096
1083
|
positionToRotation,
|
|
1097
1084
|
renderLayers,
|
|
1098
1085
|
restrictAxis,
|
|
1099
1086
|
timer,
|
|
1100
|
-
translationKey,
|
|
1101
|
-
translations,
|
|
1102
1087
|
useDrag,
|
|
1103
1088
|
useGlobeContext,
|
|
1104
1089
|
useGlobeZoomHandler,
|