diff --git a/src/components/PageComponents/Map/MapControlls.tsx b/src/components/PageComponents/Map/MapControlls.tsx new file mode 100644 index 00000000..e88599ee --- /dev/null +++ b/src/components/PageComponents/Map/MapControlls.tsx @@ -0,0 +1,40 @@ +import { FiCrosshair } from "react-icons/fi"; +import { useMap } from "react-map-gl"; + +import { + MagnifyingGlassMinusIcon, + MagnifyingGlassPlusIcon +} from "@heroicons/react/24/outline"; + +export const MapControlls = (): JSX.Element => { + const { current: map } = useMap(); + + return ( +
+
+
{ + map?.zoomIn(); + }} + > + +
+
{ + map?.zoomOut(); + }} + > + +
+
{}} + > + +
+
+
+ ); +}; diff --git a/src/pages/Map.tsx b/src/pages/Map.tsx index 3b311089..19a4f63c 100644 --- a/src/pages/Map.tsx +++ b/src/pages/Map.tsx @@ -1,75 +1,20 @@ import type React from "react"; import maplibregl from "maplibre-gl"; -import { Layer, Map, Marker, Source, useMap } from "react-map-gl"; -import { base16 } from "rfc4648"; +import { Layer, Map, Marker, Source } from "react-map-gl"; -import { Card } from "@app/components/Card.js"; -import { IconButton } from "@app/components/IconButton.js"; -import { Mono } from "@app/components/Mono.js"; +import { MapControlls } from "@app/components/PageComponents/Map/MapControlls.js"; import { useAppStore } from "@app/core/stores/appStore.js"; import { useDevice } from "@core/providers/useDevice.js"; import { Hashicon } from "@emeraldpay/hashicon-react"; -import { - EllipsisHorizontalCircleIcon, - MapPinIcon -} from "@heroicons/react/24/outline"; +import { MapPinIcon } from "@heroicons/react/24/outline"; export const MapPage = (): JSX.Element => { const { nodes, waypoints } = useDevice(); const { rasterSources } = useAppStore(); - const { current: map } = useMap(); return (
-
- -
Title
-
- {nodes.map((n) => ( -
- - - -
- {n.data.user?.longName} - - {base16 - .stringify(n.data.user?.macaddr ?? []) - .match(/.{1,2}/g) - ?.join(":") ?? ""} - -
-
- } - onClick={() => { - if (n.data.position?.latitudeI) { - map?.flyTo({ - center: [ - n.data.position.longitudeI / 1e7, - n.data.position.latitudeI / 1e7 - ], - zoom: 10 - }); - } - }} - /> -
-
- ))} -
- {/* */} - {rasterSources.map((source, index) => ( -
{source.title}Tst
- ))} -
-
{ dragRotate={false} touchZoomRotate={false} > + {waypoints.map((wp) => (