codestates / codestates/YUMMY-SEOUL

[Error handle log] 지도 api 위치 고정

Open
#49 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

***Error handling log

***발생한 오류
반응형에 따라 kakao map width, height가 줄어짐
그러나 위치가 흔들리면서 중심 좌표가 흔들리는 현상 발견

***해결방법
사실 제품 디바이스별 디스플레이 인치는 제 각각이며 새로고침하면 다시 원래 좌표로 중심이 맞추는 관계로 큰 문제는 아님

해결 1)
```js
let result = document.querySelector('.result');
result.offsetWidth // 해당 현재 width 값 추적
```

```js
map.setCenter(latlng); // 해당 좌표로 호출하여 중앙 정렬
```
DOM으로 접근하여 width 값을 계속 받아 변화가 생길떄마다 중앙 좌표 함수를 호출 한다.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the Kakao map initialization and the `.result` container used by the responsive layout. Reproduce the map shift while its width or height changes, then verify that the map remains centered on `latlng` after resizing.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.