Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/#189 pin logic change #190

Merged
merged 1 commit into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading