-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* refactor: 불필요한 인자 제거 * refactor: getDistanceOfPin 훅으로 분리 * refactor: InfoWindow 타입 추가 * refactor: 모아보기 상태에서 클러스터링 및 이벤트 핸들링 적용 * refactor: 사용자에게 노출되는 단어 중 도메인 용어인 토픽을 지도로 변환 * refactor: 혼잡한 dom 구조 및 잘못된 indent 수정 * refactor: 한 토픽에 해당하는 핀이 클러스터링 되었을 땐 무지개색 적용 하지 않기 * refactor: 스크린 사이즈 내 좌표가 아닌 초기 좌표로 모아보기 색 구별하도록 변경 * refactor: 모아보기가 비어있을 때 초기화 하는 로직 함수 분리 * refactor: type 정의 위치 수정
- Loading branch information
1 parent
206fd06
commit b05ba62
Showing
13 changed files
with
202 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { PIN_SIZE } from '../constants'; | ||
|
||
const useRealDistanceOfPin = () => { | ||
const { Tmapv3 } = window; | ||
|
||
const getDistanceOfPin = (mapInstance: TMap) => { | ||
const mapBounds = mapInstance.getBounds(); | ||
|
||
const leftWidth = new Tmapv3.LatLng(mapBounds._ne._lat, mapBounds._sw._lng); | ||
const rightWidth = new Tmapv3.LatLng( | ||
mapBounds._ne._lat, | ||
mapBounds._ne._lng, | ||
); | ||
|
||
const realDistanceOfScreen = leftWidth.distanceTo(rightWidth); | ||
const currentScreenSize = | ||
mapInstance.realToScreen(rightWidth).x - | ||
mapInstance.realToScreen(leftWidth).x; | ||
|
||
return (realDistanceOfScreen / currentScreenSize) * PIN_SIZE; | ||
}; | ||
|
||
return { getDistanceOfPin }; | ||
}; | ||
|
||
export default useRealDistanceOfPin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.