Skip to content

Commit

Permalink
fix: Adjust initial state
Browse files Browse the repository at this point in the history
  • Loading branch information
hampfh committed Nov 14, 2024
1 parent 6cfd6f3 commit d4dff68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/app/student/map/_components/MainView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Exhibitor } from "@/components/shared/hooks/api/useExhibitors"
import { Button } from "@/components/ui/button"
import { useSearchParams } from "next/navigation"
import { useMemo, useState } from "react"
import { ViewState } from "react-map-gl/dist/esm/types"
import { Booth, BoothID, BoothMap } from "../lib/booths"
import {
defaultLocation,
Expand Down Expand Up @@ -59,7 +60,12 @@ export default function MainView({
const zoom =
parseFloat(searchParams.get("zoom") ?? "") || location.center.zoom

const initialView = { latitude, longitude, zoom }
const initialView = {
latitude,
longitude,
zoom,
pitch: 40
} satisfies Partial<ViewState>

const [activeBoothId, setActiveBoothId] = useState<BoothID | null>(null)
const [hoveredBoothId, setHoveredBoothId] = useState<BoothID | null>(null)
Expand Down
2 changes: 0 additions & 2 deletions src/app/student/map/_components/MapComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,6 @@ export function MapComponent({
[18.063, 59.345],
[18.079, 59.35]
]}
pitch={40}
touchZoomRotate={false}
dragRotate={false}
mapStyle="https://api.maptiler.com/maps/376fa556-c405-4a91-8e9e-15be82eb3a58/style.json?key=mgMcr2yF2fWUHzf27ygv">
<Layer {...backgroundLayerStyle}></Layer>
Expand Down

0 comments on commit d4dff68

Please sign in to comment.