Skip to content

Commit

Permalink
campusCordinated was changed to campus in order to reuse the img from…
Browse files Browse the repository at this point in the history
… it.
  • Loading branch information
Ramin Farhadi authored and Ramin Farhadi committed Jun 13, 2024
1 parent d086be5 commit 7d767de
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ function App() {
features: []
});

const [campusCoordinate, setCampusCoordinate] = useState<Campus>(campusData[0]);
const [campusIcon, setCampusIcon] = useState<string>(campusData[0].img);
const [campus, setCampus] = useState<Campus>(campusData[0]);

const [searchResults, setSearchResults] = useState<Array<Feature>>([]);

Expand Down Expand Up @@ -211,8 +210,7 @@ function App() {
zoom: campus.zoom
})

setCampusCoordinate(campus);
setCampusIcon(campus.img);
setCampus(campus);
}

useMemo(() => {
Expand Down Expand Up @@ -469,6 +467,7 @@ function App() {
layout: {
...defaultLayoutProps,
"icon-image": 'building-ramp',
"icon-size": .5,
visibility: visibility.accessibility.buildingRamps! ? 'visible': 'none'
},
};
Expand Down Expand Up @@ -685,8 +684,8 @@ function App() {
<Layer {...searchResultLayer} />
</Source>

<Marker longitude={campusCoordinate.longitude} latitude={campusCoordinate.latitude} anchor="bottom" >
<img src={campusIcon} />
<Marker longitude={campus.longitude} latitude={campus.latitude} anchor="bottom" >
<img src={campus.img} />
</Marker>

{popupData && (
Expand Down

0 comments on commit 7d767de

Please sign in to comment.