3fcf7e2a67
Basemaps: added Google Satellite option ANCPI ortofoto: fixed bbox conversion (all 4 corners, not just SW/NE) Selection: ESC key and right-click exit selection mode, tooltips updated UAT layers: removed fill (only lines + labels), less visual clutter Proprietari vechi: greyed out (opacity-50) so current owners stand out Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
47 lines
1.5 KiB
TypeScript
47 lines
1.5 KiB
TypeScript
"use client";
|
|
|
|
import { Map, Moon, Satellite, TreePine } from "lucide-react";
|
|
import { Button } from "@/shared/components/ui/button";
|
|
import { cn } from "@/shared/lib/utils";
|
|
import type { BasemapId } from "../types";
|
|
|
|
const BASEMAPS: { id: BasemapId; label: string; icon: typeof Map }[] = [
|
|
{ id: "liberty", label: "Harta", icon: Map },
|
|
{ id: "dark", label: "Dark", icon: Moon },
|
|
{ id: "google", label: "Satelit", icon: Satellite },
|
|
{ id: "satellite", label: "ESRI", icon: Satellite },
|
|
{ id: "orto", label: "ANCPI", icon: TreePine },
|
|
];
|
|
|
|
type BasemapSwitcherProps = {
|
|
value: BasemapId;
|
|
onChange: (id: BasemapId) => void;
|
|
};
|
|
|
|
export function BasemapSwitcher({ value, onChange }: BasemapSwitcherProps) {
|
|
return (
|
|
<div className="bg-background/95 backdrop-blur-sm border rounded-lg shadow-lg flex p-0.5 gap-0.5">
|
|
{BASEMAPS.map((b) => {
|
|
const Icon = b.icon;
|
|
const active = value === b.id;
|
|
return (
|
|
<Button
|
|
key={b.id}
|
|
variant="ghost"
|
|
size="sm"
|
|
className={cn(
|
|
"px-2 py-1 h-7 text-xs gap-1 rounded-md",
|
|
active && "bg-primary text-primary-foreground hover:bg-primary/90 hover:text-primary-foreground"
|
|
)}
|
|
onClick={() => onChange(b.id)}
|
|
title={b.label}
|
|
>
|
|
<Icon className="h-3.5 w-3.5" />
|
|
<span className="hidden sm:inline">{b.label}</span>
|
|
</Button>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|