Skip to content

Commit

Permalink
refactor: 핀 관련 에러 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwonh423 committed Aug 3, 2023
1 parent 9741449 commit b4f1a48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion frontend/src/hooks/useAnimateClickedPin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const useAnimateClickedPin = (map: any, markers: any) => {
const marker = markers.find((marker: any) => marker.id === pinId);
if (marker) {
map.setCenter(marker.getPosition());
map.setZoom(14);
map.setZoom(17);
marker._marker_data.options.animation =
window.Tmapv2.MarkerOptions.ANIMATE_BALLOON;
marker._marker_data.options.animationLength = 500;
Expand Down
5 changes: 4 additions & 1 deletion frontend/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ import TopicCard from '../components/TopicCard';
import Button from '../components/common/Button';
import Flex from '../components/common/Flex';
import Box from '../components/common/Box';
import { Fragment, useEffect, useState } from 'react';
import { Fragment, useContext, useEffect, useState } from 'react';
import { getApi } from '../utils/getApi';
import { TopicType } from '../types/Topic';
import useNavigator from '../hooks/useNavigator';
import { MergeOrSeeTogether } from '../components/MergeOrSeeTogether';
import { MarkerContext } from '../context/MarkerContext';

const Home = () => {
const [topics, setTopics] = useState<TopicType[]>([]);
const [taggedTopicIds, setTaggedTopicIds] = useState<number[]>([]);
const [tagTopics, setTagTopics] = useState<string[]>([]);
const { markers, removeMarkers } = useContext(MarkerContext);
const { routePage } = useNavigator();

const goToNewTopic = () => {
Expand All @@ -37,6 +39,7 @@ const Home = () => {
// 현재 위치 받아오기
useEffect(() => {
getAndSetDataFromServer();
if (markers.length > 0) removeMarkers();
}, []);

return (
Expand Down

0 comments on commit b4f1a48

Please sign in to comment.