Skip to content

Commit

Permalink
[FE][Fix] QA
Browse files Browse the repository at this point in the history
- ๋„ค์˜จ ์œ„์น˜ ๋ณ€๊ฒฝ
- ์ฑ„๋„ ์ถ”๊ฐ€ ํŽ˜์ด์ง€์—์„œ ์ดˆ๊ธฐ ์ขŒํ‘œ ๋ณ€๊ฒฝ
  • Loading branch information
happyhyep committed Dec 5, 2024
1 parent 3a24a45 commit e172002
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ import { useRedrawCanvas } from '@/hooks/useRedraw';
import { zoomMapView } from '@/utils/map/mapUtils';
import { ICluster, useCluster } from '@/hooks/useCluster';
import { MIN_ZOOM } from '@/lib/constants/mapConstants.ts';
import { getUserLocation } from '@/hooks/getUserLocation.ts';

export const MapCanvasForDraw = ({
width,
height,
initialCenter,
initialZoom,
}: IMapCanvasProps) => {
const { lat, lng } = getUserLocation();

const mapRef = useRef<HTMLDivElement>(null);
const canvasRef = useRef<HTMLCanvasElement>(null);
const [projection, setProjection] = useState<naver.maps.MapSystemProjection | null>(null);
Expand Down Expand Up @@ -68,7 +71,7 @@ export const MapCanvasForDraw = ({
if (!mapRef.current) return;

const mapInstance = new naver.maps.Map(mapRef.current, {
center: new naver.maps.LatLng(initialCenter.lat, initialCenter.lng),
center: new naver.maps.LatLng(lat || initialCenter.lat, lng || initialCenter.lng),
zoom: initialZoom,
minZoom: MIN_ZOOM,
maxBounds: new naver.maps.LatLngBounds(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useRedraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export const useRedrawCanvas = ({
}

ctx.save();
ctx.translate(point.x, point.y - zoom);
ctx.translate(point.x, point.y + zoom);
ctx.rotate(rotate);
let filteredImage;
if (markerType === MARKER_TYPE.CHARACTER) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/lib/constants/mapConstants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ export const KOREA_BOUNDS = {

// ์ดˆ๊ธฐ ์ค‘์‹ฌ์  (๋Œ€ํ•œ๋ฏผ๊ตญ ์ค‘์•™ ๊ทผ์ฒ˜)
export const DEFAULT_CENTER = {
lat: (KOREA_BOUNDS.sw.lat + KOREA_BOUNDS.ne.lat) / 2,
lng: (KOREA_BOUNDS.sw.lng + KOREA_BOUNDS.ne.lng) / 2,
lat: 37.35921406312911,
lng: 127.10430493337978,
};

export const MIN_ZOOM = 7; // ๋Œ€ํ•œ๋ฏผ๊ตญ ์ „์ฒด๊ฐ€ ๋ณด์ด๋Š” ์ตœ์†Œ ์คŒ ๋ ˆ๋ฒจ
Expand Down

0 comments on commit e172002

Please sign in to comment.