Skip to content

Commit

Permalink
Added top navbar with search box and centering button, imported all t…
Browse files Browse the repository at this point in the history
…he institute names to search box so that it can move to the location on the globe.
  • Loading branch information
Rhymlore committed Oct 19, 2023
1 parent cfd4fe0 commit 34d1598
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/mapbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import '../app/globals.css';
import { ThemeProvider, createTheme} from '@mui/material/styles';
import * as mapboxgl from 'mapbox-gl';

type MapboxMap = mapboxgl.Map;

interface Institution {
name: string;
coordinates: [number, number];
Expand All @@ -33,7 +35,7 @@ interface Institution {
export const GlobeComponent = () => {
const [anchorEl, setAnchorEl] = useState<Element | null>(null);
const [popoverContent, setPopoverContent] = useState<string>('');
const mapRef = useRef<mapboxgl.Map | null>(null as any);
const mapRef = useRef<MapboxMap | null>(null);
const [institutionData, setInstitutionData] = useState<Institution[]>([]);

const theme = createTheme({
Expand Down Expand Up @@ -130,7 +132,7 @@ export const GlobeComponent = () => {
if (mapRef.current) {
mapRef.current.flyTo({
center: [-89.4081, 43.0733],
zoom: 1,
zoom: 2,
essential: true // this animation is considered essential with respect to prefers-reduced-motion
});
}
Expand Down

0 comments on commit 34d1598

Please sign in to comment.