@dxos/solid-ui-geo 0.8.4-main.fcc0d83b33 → 0.8.4-staging.60fe92afc8
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/index.mjs +223 -172
- package/dist/lib/browser/index.mjs.map +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +223 -172
- package/dist/lib/node-esm/index.mjs.map +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/Globe/Globe.solid-stories.d.ts +2 -2
- package/dist/types/src/components/Globe/Globe.solid-stories.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/components/Globe/Globe.solid-stories.tsx +2 -2
|
@@ -4,14 +4,23 @@ import {
|
|
|
4
4
|
} from "./chunk-ICM52DKE.mjs";
|
|
5
5
|
|
|
6
6
|
// src/components/Globe/Globe.tsx
|
|
7
|
-
import {
|
|
7
|
+
import { template as _$template2 } from "solid-js/web";
|
|
8
|
+
import { className as _$className2 } from "solid-js/web";
|
|
9
|
+
import { setAttribute as _$setAttribute } from "solid-js/web";
|
|
10
|
+
import { effect as _$effect2 } from "solid-js/web";
|
|
11
|
+
import { memo as _$memo } from "solid-js/web";
|
|
12
|
+
import { createComponent as _$createComponent2 } from "solid-js/web";
|
|
13
|
+
import { insert as _$insert } from "solid-js/web";
|
|
14
|
+
import { use as _$use } from "solid-js/web";
|
|
15
|
+
import { spread as _$spread } from "solid-js/web";
|
|
16
|
+
import { mergeProps as _$mergeProps } from "solid-js/web";
|
|
8
17
|
import { createResizeObserver } from "@solid-primitives/resize-observer";
|
|
9
18
|
import { easeLinear, easeSinOut, geoMercator, geoOrthographic, geoPath as geoPath2, geoTransverseMercator, interpolateNumber, transition } from "d3";
|
|
10
19
|
import { Show, createEffect as createEffect5, createMemo, createSignal as createSignal4 } from "solid-js";
|
|
11
20
|
import { mx } from "@dxos/ui-theme";
|
|
12
21
|
|
|
13
22
|
// src/hooks/context.tsx
|
|
14
|
-
import {
|
|
23
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
15
24
|
import { createContext, createEffect, createSignal, useContext } from "solid-js";
|
|
16
25
|
import { raise } from "@dxos/debug";
|
|
17
26
|
var defaults = {
|
|
@@ -36,7 +45,7 @@ var GlobeContextProvider = (props) => {
|
|
|
36
45
|
setSize(props.size);
|
|
37
46
|
}
|
|
38
47
|
});
|
|
39
|
-
return
|
|
48
|
+
return _$createComponent(GlobeContext.Provider, {
|
|
40
49
|
value: {
|
|
41
50
|
size,
|
|
42
51
|
center,
|
|
@@ -48,7 +57,9 @@ var GlobeContextProvider = (props) => {
|
|
|
48
57
|
setTranslation,
|
|
49
58
|
setRotation
|
|
50
59
|
},
|
|
51
|
-
children
|
|
60
|
+
get children() {
|
|
61
|
+
return props.children;
|
|
62
|
+
}
|
|
52
63
|
});
|
|
53
64
|
};
|
|
54
65
|
var useGlobeContext = () => {
|
|
@@ -619,7 +630,12 @@ var useTour = (controller, points, options = {}) => {
|
|
|
619
630
|
};
|
|
620
631
|
|
|
621
632
|
// src/components/Toolbar/Controls.tsx
|
|
622
|
-
import {
|
|
633
|
+
import { template as _$template } from "solid-js/web";
|
|
634
|
+
import { delegateEvents as _$delegateEvents } from "solid-js/web";
|
|
635
|
+
import { className as _$className } from "solid-js/web";
|
|
636
|
+
import { effect as _$effect } from "solid-js/web";
|
|
637
|
+
var _tmpl$ = /* @__PURE__ */ _$template(`<div><button type=button class="dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center"title="Zoom in"><span class=text-xl>+</span></button><button type=button class="dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center"title="Zoom out"><span class=text-xl>\u2212`);
|
|
638
|
+
var _tmpl$2 = /* @__PURE__ */ _$template(`<div><button type=button class="dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center"title=Start><span class=text-xl>\u25B6</span></button><button type=button class="dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center"title=Toggle><span class=text-xl>\u{1F30D}`);
|
|
623
639
|
var controlPositions = {
|
|
624
640
|
topleft: "top-2 left-2",
|
|
625
641
|
topright: "top-2 right-2",
|
|
@@ -627,61 +643,29 @@ var controlPositions = {
|
|
|
627
643
|
bottomright: "bottom-2 right-2"
|
|
628
644
|
};
|
|
629
645
|
var ZoomControls = (props) => {
|
|
630
|
-
return
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
title: "Zoom in",
|
|
638
|
-
children: /* @__PURE__ */ _jsx2("span", {
|
|
639
|
-
class: "text-xl",
|
|
640
|
-
children: "+"
|
|
641
|
-
})
|
|
642
|
-
}),
|
|
643
|
-
/* @__PURE__ */ _jsx2("button", {
|
|
644
|
-
type: "button",
|
|
645
|
-
class: "dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center",
|
|
646
|
-
onClick: () => props.onAction?.("zoom-out"),
|
|
647
|
-
title: "Zoom out",
|
|
648
|
-
children: /* @__PURE__ */ _jsx2("span", {
|
|
649
|
-
class: "text-xl",
|
|
650
|
-
children: "\u2212"
|
|
651
|
-
})
|
|
652
|
-
})
|
|
653
|
-
]
|
|
654
|
-
});
|
|
646
|
+
return (() => {
|
|
647
|
+
var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
|
|
648
|
+
_el$2.$$click = () => props.onAction?.("zoom-in");
|
|
649
|
+
_el$3.$$click = () => props.onAction?.("zoom-out");
|
|
650
|
+
_$effect(() => _$className(_el$, `flex flex-row gap-2 ${props.class ?? ""}`));
|
|
651
|
+
return _el$;
|
|
652
|
+
})();
|
|
655
653
|
};
|
|
656
654
|
var ActionControls = (props) => {
|
|
657
|
-
return
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
title: "Start",
|
|
665
|
-
children: /* @__PURE__ */ _jsx2("span", {
|
|
666
|
-
class: "text-xl",
|
|
667
|
-
children: "\u25B6"
|
|
668
|
-
})
|
|
669
|
-
}),
|
|
670
|
-
/* @__PURE__ */ _jsx2("button", {
|
|
671
|
-
type: "button",
|
|
672
|
-
class: "dx-button dx-focus-ring w-10 h-10 min-h-[2.5rem] px-3 rounded-xs flex items-center justify-center",
|
|
673
|
-
onClick: () => props.onAction?.("toggle"),
|
|
674
|
-
title: "Toggle",
|
|
675
|
-
children: /* @__PURE__ */ _jsx2("span", {
|
|
676
|
-
class: "text-xl",
|
|
677
|
-
children: "\u{1F30D}"
|
|
678
|
-
})
|
|
679
|
-
})
|
|
680
|
-
]
|
|
681
|
-
});
|
|
655
|
+
return (() => {
|
|
656
|
+
var _el$4 = _tmpl$2(), _el$5 = _el$4.firstChild, _el$6 = _el$5.nextSibling;
|
|
657
|
+
_el$5.$$click = () => props.onAction?.("start");
|
|
658
|
+
_el$6.$$click = () => props.onAction?.("toggle");
|
|
659
|
+
_$effect(() => _$className(_el$4, `flex flex-row gap-2 ${props.class ?? ""}`));
|
|
660
|
+
return _el$4;
|
|
661
|
+
})();
|
|
682
662
|
};
|
|
663
|
+
_$delegateEvents(["click"]);
|
|
683
664
|
|
|
684
665
|
// src/components/Globe/Globe.tsx
|
|
666
|
+
var _tmpl$3 = /* @__PURE__ */ _$template2(`<div>`);
|
|
667
|
+
var _tmpl$22 = /* @__PURE__ */ _$template2(`<canvas>`);
|
|
668
|
+
var _tmpl$32 = /* @__PURE__ */ _$template2(`<div><pre class="font-mono text-xs text-green-700">`);
|
|
685
669
|
var defaultStyles = {
|
|
686
670
|
light: {
|
|
687
671
|
background: {
|
|
@@ -742,22 +726,33 @@ var GlobeRoot = (props) => {
|
|
|
742
726
|
width: 0,
|
|
743
727
|
height: 0
|
|
744
728
|
});
|
|
745
|
-
createResizeObserver(() => containerRef, ({
|
|
729
|
+
createResizeObserver(() => containerRef, ({
|
|
730
|
+
width,
|
|
731
|
+
height
|
|
732
|
+
}) => {
|
|
746
733
|
setSize({
|
|
747
734
|
width,
|
|
748
735
|
height
|
|
749
736
|
});
|
|
750
737
|
});
|
|
751
|
-
return
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
738
|
+
return _$createComponent2(GlobeContextProvider, _$mergeProps({
|
|
739
|
+
get size() {
|
|
740
|
+
return size();
|
|
741
|
+
}
|
|
742
|
+
}, props, {
|
|
743
|
+
get children() {
|
|
744
|
+
var _el$ = _tmpl$3();
|
|
745
|
+
var _ref$ = containerRef;
|
|
746
|
+
typeof _ref$ === "function" ? _$use(_ref$, _el$) : containerRef = _el$;
|
|
747
|
+
_$spread(_el$, _$mergeProps({
|
|
748
|
+
get ["class"]() {
|
|
749
|
+
return mx("relative dx-container");
|
|
750
|
+
}
|
|
751
|
+
}, props), false, true);
|
|
752
|
+
_$insert(_el$, () => props.children);
|
|
753
|
+
return _el$;
|
|
754
|
+
}
|
|
755
|
+
}));
|
|
761
756
|
};
|
|
762
757
|
var GlobeCanvas = (props) => {
|
|
763
758
|
const themeMode = "dark";
|
|
@@ -767,7 +762,17 @@ var GlobeCanvas = (props) => {
|
|
|
767
762
|
const layers = createMemo(() => {
|
|
768
763
|
return timer(() => createLayers(props.topology, props.features, styles()));
|
|
769
764
|
});
|
|
770
|
-
const {
|
|
765
|
+
const {
|
|
766
|
+
size,
|
|
767
|
+
center,
|
|
768
|
+
zoom,
|
|
769
|
+
translation,
|
|
770
|
+
rotation,
|
|
771
|
+
setCenter,
|
|
772
|
+
setZoom,
|
|
773
|
+
setTranslation,
|
|
774
|
+
setRotation
|
|
775
|
+
} = useGlobeContext();
|
|
771
776
|
let zoomValue = zoom();
|
|
772
777
|
let zooming = false;
|
|
773
778
|
createEffect5(() => {
|
|
@@ -828,65 +833,89 @@ var GlobeCanvas = (props) => {
|
|
|
828
833
|
const s = size();
|
|
829
834
|
if (canvasEl && proj && gen) {
|
|
830
835
|
timer(() => {
|
|
831
|
-
proj.scale(Math.min(s.width, s.height) / 2 * z).translate([
|
|
832
|
-
s.width / 2 + (t?.x ?? 0),
|
|
833
|
-
s.height / 2 + (t?.y ?? 0)
|
|
834
|
-
]).rotate(r ?? [
|
|
835
|
-
0,
|
|
836
|
-
0,
|
|
837
|
-
0
|
|
838
|
-
]);
|
|
836
|
+
proj.scale(Math.min(s.width, s.height) / 2 * z).translate([s.width / 2 + (t?.x ?? 0), s.height / 2 + (t?.y ?? 0)]).rotate(r ?? [0, 0, 0]);
|
|
839
837
|
renderLayers(gen, layers(), z, styles());
|
|
840
838
|
});
|
|
841
839
|
}
|
|
842
840
|
});
|
|
843
|
-
return
|
|
844
|
-
when
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
841
|
+
return _$createComponent2(Show, {
|
|
842
|
+
get when() {
|
|
843
|
+
return _$memo(() => size().width > 0)() && size().height > 0;
|
|
844
|
+
},
|
|
845
|
+
get children() {
|
|
846
|
+
var _el$2 = _tmpl$22();
|
|
847
|
+
_$use(setCanvas, _el$2);
|
|
848
|
+
_$effect2((_p$) => {
|
|
849
|
+
var _v$ = size().width, _v$2 = size().height;
|
|
850
|
+
_v$ !== _p$.e && _$setAttribute(_el$2, "width", _p$.e = _v$);
|
|
851
|
+
_v$2 !== _p$.t && _$setAttribute(_el$2, "height", _p$.t = _v$2);
|
|
852
|
+
return _p$;
|
|
853
|
+
}, {
|
|
854
|
+
e: void 0,
|
|
855
|
+
t: void 0
|
|
856
|
+
});
|
|
857
|
+
return _el$2;
|
|
858
|
+
}
|
|
850
859
|
});
|
|
851
860
|
};
|
|
852
861
|
var GlobeDebug = (props) => {
|
|
853
|
-
const {
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
862
|
+
const {
|
|
863
|
+
size,
|
|
864
|
+
zoom,
|
|
865
|
+
translation,
|
|
866
|
+
rotation
|
|
867
|
+
} = useGlobeContext();
|
|
868
|
+
return (() => {
|
|
869
|
+
var _el$3 = _tmpl$32(), _el$4 = _el$3.firstChild;
|
|
870
|
+
_$insert(_el$4, () => JSON.stringify({
|
|
871
|
+
size,
|
|
872
|
+
zoom: zoom(),
|
|
873
|
+
translation: translation(),
|
|
874
|
+
rotation: rotation()
|
|
875
|
+
}, null, 2));
|
|
876
|
+
_$effect2(() => _$className2(_el$3, `z-10 absolute w-96 p-2 overflow-hidden border border-green-700 rounded-sm ${controlPositions[props.position ?? "topleft"]}`));
|
|
877
|
+
return _el$3;
|
|
878
|
+
})();
|
|
866
879
|
};
|
|
867
880
|
var GlobePanel = (props) => {
|
|
868
|
-
return
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
881
|
+
return (() => {
|
|
882
|
+
var _el$5 = _tmpl$3();
|
|
883
|
+
_$insert(_el$5, () => props.children);
|
|
884
|
+
_$effect2(() => _$className2(_el$5, `z-10 absolute overflow-hidden ${controlPositions[props.position ?? "topleft"]} ${props.class ?? ""}`));
|
|
885
|
+
return _el$5;
|
|
886
|
+
})();
|
|
872
887
|
};
|
|
873
888
|
var CustomControl = (props) => {
|
|
874
|
-
return
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
889
|
+
return (() => {
|
|
890
|
+
var _el$6 = _tmpl$3();
|
|
891
|
+
_$insert(_el$6, () => props.children);
|
|
892
|
+
_$effect2(() => _$className2(_el$6, `z-10 absolute overflow-hidden ${controlPositions[props.position]}`));
|
|
893
|
+
return _el$6;
|
|
894
|
+
})();
|
|
878
895
|
};
|
|
879
|
-
var GlobeZoom = (props) =>
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
896
|
+
var GlobeZoom = (props) => _$createComponent2(CustomControl, {
|
|
897
|
+
get position() {
|
|
898
|
+
return props.position ?? "bottomleft";
|
|
899
|
+
},
|
|
900
|
+
get children() {
|
|
901
|
+
return _$createComponent2(ZoomControls, {
|
|
902
|
+
get onAction() {
|
|
903
|
+
return props.onAction;
|
|
904
|
+
}
|
|
905
|
+
});
|
|
906
|
+
}
|
|
884
907
|
});
|
|
885
|
-
var GlobeAction = (props) =>
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
908
|
+
var GlobeAction = (props) => _$createComponent2(CustomControl, {
|
|
909
|
+
get position() {
|
|
910
|
+
return props.position ?? "bottomright";
|
|
911
|
+
},
|
|
912
|
+
get children() {
|
|
913
|
+
return _$createComponent2(ActionControls, {
|
|
914
|
+
get onAction() {
|
|
915
|
+
return props.onAction;
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
}
|
|
890
919
|
});
|
|
891
920
|
var Globe = {
|
|
892
921
|
Root: GlobeRoot,
|
|
@@ -898,10 +927,18 @@ var Globe = {
|
|
|
898
927
|
};
|
|
899
928
|
|
|
900
929
|
// src/components/Map/Map.tsx
|
|
901
|
-
import {
|
|
930
|
+
import { template as _$template3 } from "solid-js/web";
|
|
931
|
+
import { memo as _$memo2 } from "solid-js/web";
|
|
932
|
+
import { insert as _$insert2 } from "solid-js/web";
|
|
933
|
+
import { createComponent as _$createComponent3 } from "solid-js/web";
|
|
934
|
+
import { className as _$className3 } from "solid-js/web";
|
|
935
|
+
import { effect as _$effect3 } from "solid-js/web";
|
|
936
|
+
import { use as _$use2 } from "solid-js/web";
|
|
902
937
|
import "leaflet/dist/leaflet.css";
|
|
903
938
|
import L, { latLngBounds } from "leaflet";
|
|
904
939
|
import { Show as Show2, createContext as createContext2, createEffect as createEffect6, createSignal as createSignal5, onCleanup as onCleanup4, onMount, useContext as useContext2 } from "solid-js";
|
|
940
|
+
var _tmpl$4 = /* @__PURE__ */ _$template3(`<div style=z-index:0>`);
|
|
941
|
+
var _tmpl$23 = /* @__PURE__ */ _$template3(`<div style=display:contents>`);
|
|
905
942
|
var defaults2 = {
|
|
906
943
|
center: {
|
|
907
944
|
lat: 51,
|
|
@@ -960,30 +997,39 @@ var MapRoot = (props) => {
|
|
|
960
997
|
leafletMap.scrollWheelZoom.disable();
|
|
961
998
|
}
|
|
962
999
|
});
|
|
963
|
-
return
|
|
964
|
-
value
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1000
|
+
return _$createComponent3(MapContext.Provider, {
|
|
1001
|
+
get value() {
|
|
1002
|
+
return {
|
|
1003
|
+
map,
|
|
1004
|
+
attention,
|
|
1005
|
+
setAttention,
|
|
1006
|
+
onChange: props.onChange
|
|
1007
|
+
};
|
|
969
1008
|
},
|
|
970
|
-
children
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
1009
|
+
get children() {
|
|
1010
|
+
return [(() => {
|
|
1011
|
+
var _el$ = _tmpl$4();
|
|
1012
|
+
var _ref$ = mapContainer;
|
|
1013
|
+
typeof _ref$ === "function" ? _$use2(_ref$, _el$) : mapContainer = _el$;
|
|
1014
|
+
_$effect3(() => _$className3(_el$, `group relative grid h-full w-full bg-gray-100 dark:bg-gray-900 ${props.class ?? ""}`));
|
|
1015
|
+
return _el$;
|
|
1016
|
+
})(), _$createComponent3(Show2, {
|
|
1017
|
+
get when() {
|
|
1018
|
+
return map();
|
|
1019
|
+
},
|
|
1020
|
+
get children() {
|
|
1021
|
+
return props.children;
|
|
976
1022
|
}
|
|
977
|
-
})
|
|
978
|
-
|
|
979
|
-
when: map(),
|
|
980
|
-
children: props.children
|
|
981
|
-
})
|
|
982
|
-
]
|
|
1023
|
+
})];
|
|
1024
|
+
}
|
|
983
1025
|
});
|
|
984
1026
|
};
|
|
985
1027
|
var MapTiles = () => {
|
|
986
|
-
const {
|
|
1028
|
+
const {
|
|
1029
|
+
map,
|
|
1030
|
+
onChange,
|
|
1031
|
+
attention
|
|
1032
|
+
} = useMapContext(MapTiles.name);
|
|
987
1033
|
let tileLayer = null;
|
|
988
1034
|
createEffect6(() => {
|
|
989
1035
|
const leafletMap = map();
|
|
@@ -1022,7 +1068,9 @@ var MapTiles = () => {
|
|
|
1022
1068
|
return null;
|
|
1023
1069
|
};
|
|
1024
1070
|
var MapMarkers = (props) => {
|
|
1025
|
-
const {
|
|
1071
|
+
const {
|
|
1072
|
+
map
|
|
1073
|
+
} = useMapContext(MapMarkers.name);
|
|
1026
1074
|
const leafletMarkers = [];
|
|
1027
1075
|
let lastMarkerIds = /* @__PURE__ */ new Set();
|
|
1028
1076
|
onCleanup4(() => {
|
|
@@ -1036,9 +1084,7 @@ var MapMarkers = (props) => {
|
|
|
1036
1084
|
}
|
|
1037
1085
|
const markerList = props.markers?.() ?? [];
|
|
1038
1086
|
const currentIds = new Set(markerList.map((m) => m.id));
|
|
1039
|
-
if (currentIds.size === lastMarkerIds.size && [
|
|
1040
|
-
...currentIds
|
|
1041
|
-
].every((id) => lastMarkerIds.has(id)) && leafletMarkers.length > 0) {
|
|
1087
|
+
if (currentIds.size === lastMarkerIds.size && [...currentIds].every((id) => lastMarkerIds.has(id)) && leafletMarkers.length > 0) {
|
|
1042
1088
|
return;
|
|
1043
1089
|
}
|
|
1044
1090
|
leafletMarkers.forEach((marker) => marker.remove());
|
|
@@ -1047,28 +1093,19 @@ var MapMarkers = (props) => {
|
|
|
1047
1093
|
if (markerList.length > 0) {
|
|
1048
1094
|
const bounds = latLngBounds(markerList.map((marker) => marker.location));
|
|
1049
1095
|
leafletMap.fitBounds(bounds);
|
|
1050
|
-
markerList.forEach(({
|
|
1096
|
+
markerList.forEach(({
|
|
1097
|
+
title,
|
|
1098
|
+
location
|
|
1099
|
+
}) => {
|
|
1051
1100
|
const marker = L.marker(location, {
|
|
1052
1101
|
icon: new L.Icon({
|
|
1053
1102
|
iconUrl: "https://dxos.network/marker-icon.png",
|
|
1054
1103
|
iconRetinaUrl: "https://dxos.network/marker-icon-2x.png",
|
|
1055
1104
|
shadowUrl: "https://dxos.network/marker-shadow.png",
|
|
1056
|
-
iconSize: [
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
]
|
|
1060
|
-
iconAnchor: [
|
|
1061
|
-
12,
|
|
1062
|
-
41
|
|
1063
|
-
],
|
|
1064
|
-
popupAnchor: [
|
|
1065
|
-
1,
|
|
1066
|
-
-34
|
|
1067
|
-
],
|
|
1068
|
-
shadowSize: [
|
|
1069
|
-
41,
|
|
1070
|
-
41
|
|
1071
|
-
]
|
|
1105
|
+
iconSize: [25, 41],
|
|
1106
|
+
iconAnchor: [12, 41],
|
|
1107
|
+
popupAnchor: [1, -34],
|
|
1108
|
+
shadowSize: [41, 41]
|
|
1072
1109
|
})
|
|
1073
1110
|
});
|
|
1074
1111
|
if (title) {
|
|
@@ -1084,7 +1121,9 @@ var MapMarkers = (props) => {
|
|
|
1084
1121
|
return null;
|
|
1085
1122
|
};
|
|
1086
1123
|
var CustomControl2 = (props) => {
|
|
1087
|
-
const {
|
|
1124
|
+
const {
|
|
1125
|
+
map: mapAccessor
|
|
1126
|
+
} = useMapContext(CustomControl2.name);
|
|
1088
1127
|
let controlContainer;
|
|
1089
1128
|
createEffect6(() => {
|
|
1090
1129
|
const map = mapAccessor();
|
|
@@ -1110,25 +1149,37 @@ var CustomControl2 = (props) => {
|
|
|
1110
1149
|
control.remove();
|
|
1111
1150
|
});
|
|
1112
1151
|
});
|
|
1113
|
-
return
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
});
|
|
1152
|
+
return (() => {
|
|
1153
|
+
var _el$2 = _tmpl$23();
|
|
1154
|
+
var _ref$2 = controlContainer;
|
|
1155
|
+
typeof _ref$2 === "function" ? _$use2(_ref$2, _el$2) : controlContainer = _el$2;
|
|
1156
|
+
_$insert2(_el$2, () => props.children);
|
|
1157
|
+
return _el$2;
|
|
1158
|
+
})();
|
|
1120
1159
|
};
|
|
1121
|
-
var MapZoom = (props) =>
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1160
|
+
var MapZoom = (props) => _$createComponent3(CustomControl2, {
|
|
1161
|
+
get position() {
|
|
1162
|
+
return props.position ?? "bottomleft";
|
|
1163
|
+
},
|
|
1164
|
+
get children() {
|
|
1165
|
+
return _$createComponent3(ZoomControls, {
|
|
1166
|
+
get onAction() {
|
|
1167
|
+
return props.onAction;
|
|
1168
|
+
}
|
|
1169
|
+
});
|
|
1170
|
+
}
|
|
1126
1171
|
});
|
|
1127
|
-
var MapAction = (props) =>
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1172
|
+
var MapAction = (props) => _$createComponent3(CustomControl2, {
|
|
1173
|
+
get position() {
|
|
1174
|
+
return props.position ?? "bottomright";
|
|
1175
|
+
},
|
|
1176
|
+
get children() {
|
|
1177
|
+
return _$createComponent3(ActionControls, {
|
|
1178
|
+
get onAction() {
|
|
1179
|
+
return props.onAction;
|
|
1180
|
+
}
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1132
1183
|
});
|
|
1133
1184
|
var Map = {
|
|
1134
1185
|
Root: MapRoot,
|