Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix map symbols appearing on top of windows #485

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Map/MapEdgeTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const MapEdgeTooltip = ({ hoverInfo }: IMapEdgeTooltip) => {

return (
<div
className="pointer-events-none absolute z-10 text-center whitespace-nowrap px-2 py-1 default-overlay text-xs text-gray-500"
className="pointer-events-none absolute z-10 text-center whitespace-nowrap px-2 py-1 default-overlay text-xs text-gray-500 z-[inherit]"
style={{ left: x, top: y }}
>
<p>SNR: {snr ?? "UNK"}</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Map/MapNodeTooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const MapNodeTooltip = ({ hoverInfo }: IMapNodeTooltip) => {

return (
<div
className="pointer-events-none absolute z-10 text-center whitespace-nowrap px-2 py-1 default-overlay text-xs text-gray-500"
className="pointer-events-none absolute z-10 text-center whitespace-nowrap px-2 py-1 default-overlay text-xs text-gray-500 z-[inherit]"
style={{ left: x, top: y }}
>
<p>Name: {nodeInfo.user?.longName ?? "UNK"}</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Map/MapSelectedNodeMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const MapSelectedNodeMenu = () => {
};

return (
<div className="absolute top-24 right-9 bg-white dark:bg-gray-800 p-5 pl-4 rounded-lg drop-shadow-lg w-80">
<div className="absolute top-24 right-9 bg-white dark:bg-gray-800 p-5 pl-4 rounded-lg drop-shadow-lg w-80 z-[inherit]">
<div className="flex justify-between">
<h1 className="text-gray-600 dark:text-gray-400 text-2xl leading-5 font-semibold">
{deviceName}
Expand Down
4 changes: 4 additions & 0 deletions src/components/Map/MapView.css
Original file line number Diff line number Diff line change
Expand Up @@ -126,3 +126,7 @@
color: rgb(209 213 219 / var(--tw-text-opacity)) !important;
}
}

#deckgl-overlay {
z-index: 10;
}
32 changes: 18 additions & 14 deletions src/components/Map/MapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ export const MapView = () => {
className="relative w-full h-full z-0"
onContextMenu={(e) => e.preventDefault()}
>
{nodeHoverInfo && <MapNodeTooltip hoverInfo={nodeHoverInfo} />}
{edgeHoverInfo && <MapEdgeTooltip hoverInfo={edgeHoverInfo} />}
<div className="z-40">
{nodeHoverInfo && <MapNodeTooltip hoverInfo={nodeHoverInfo} />}
{edgeHoverInfo && <MapEdgeTooltip hoverInfo={edgeHoverInfo} />}
</div>

{/* Map translation is a pain, assuming users will use translated map tiles https://maplibre.org/maplibre-gl-js/docs/examples/language-switch/ */}

Expand All @@ -183,6 +185,7 @@ export const MapView = () => {
<Marker
latitude={lastRightClickLngLat.lat}
longitude={lastRightClickLngLat.lng}
style={{ zIndex: 30 }}
>
<div className="translate-y-1/2">
{/* https://www.kindacode.com/article/how-to-create-triangles-with-tailwind-css-4-examples/ */}
Expand Down Expand Up @@ -244,22 +247,23 @@ export const MapView = () => {
),
)
}
style={{ zIndex: 10 }}
/>
))}
</Map>

{/* Popups */}
{showInfoPane === "waypoint" ? (
<WaypointMenu
editWaypoint={(w) => {
setWaypointDialogOpen(true);
setEditingWaypoint(w);
}}
/>
) : null}

<NodeSearchDock />
<MapSelectedNodeMenu />
<div className="z-20">
<NodeSearchDock />
<MapSelectedNodeMenu />
{showInfoPane === "waypoint" ? (
<WaypointMenu
editWaypoint={(w) => {
setWaypointDialogOpen(true);
setEditingWaypoint(w);
}}
/>
) : null}
</div>
</div>

{(lastRightClickLngLat || editingWaypoint) && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/NodeSearch/NodeSearchDock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export const NodeSearchDock = () => {
};

return (
<div className="absolute left-9 top-9 w-96 flex flex-col p-4 gap-4">
<div className="absolute left-9 top-9 w-96 flex flex-col p-4 gap-4 z-[inherit]">
<div className="flex flex-row gap-4">
<NodeSearchInput
query={query}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Waypoints/MeshWaypoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { WaypointIcon } from "@components/Waypoints/WaypointIcon";

// This component returns a marker for each individual waypoint. It is called from MapView.tsx
export interface IMeshWaypointProps
extends Pick<MarkerProps, "draggable" | "onDragEnd"> {
extends Pick<MarkerProps, "draggable" | "onDragEnd" | "style"> {
waypoint: app_device_NormalizedWaypoint;
isSelected: boolean;
onClick?: () => void;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Waypoints/WaypointMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const WaypointMenu = ({ editWaypoint }: IWaypointMenuProps) => {
activeWaypoint;

return (
<div className="absolute top-24 right-9 bg-white dark:bg-gray-800 p-6 rounded-lg drop-shadow-lg w-96">
<div className="absolute top-24 right-9 bg-white dark:bg-gray-800 p-6 rounded-lg drop-shadow-lg w-96 z-[inherit]">
<button
className="absolute top-6 right-6"
type="button"
Expand Down