feat: update default view to map and adjust map zoom/projection

This commit is contained in:
Usman Baig
2026-01-16 20:19:38 +01:00
parent 5c30e53617
commit 7606e9709b
2 changed files with 37 additions and 35 deletions

View File

@@ -13,7 +13,7 @@ interface LocationProps {
type Tab = 'map' | 'countries' | 'cities'
export default function Locations({ countries, cities }: LocationProps) {
const [activeTab, setActiveTab] = useState<Tab>('countries')
const [activeTab, setActiveTab] = useState<Tab>('map')
const getFlagComponent = (countryCode: string) => {
if (!countryCode || countryCode === 'Unknown') return null

View File

@@ -45,11 +45,13 @@ const WorldMap = ({ data }: WorldMapProps) => {
return (
<div className="relative w-full h-[300px] bg-neutral-50 dark:bg-neutral-900/50 rounded-lg overflow-hidden border border-neutral-100 dark:border-neutral-800">
<ComposableMap projectionConfig={{ rotate: [-10, 0, 0], scale: 147 }}>
<ZoomableGroup>
<ComposableMap projectionConfig={{ rotate: [-10, 0, 0], scale: 160, center: [0, 15] }}>
<ZoomableGroup maxZoom={1}>
<Geographies geography={geoUrl}>
{({ geographies }) =>
geographies.map((geo) => {
geographies
.filter(geo => geo.id !== "010") // Remove Antarctica
.map((geo) => {
// Ensure ID is padded to 3 digits as standard ISO numeric
const id = String(geo.id).padStart(3, '0')
const count = processedData.map.get(id) || 0