-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: 특정 줌 레벨까지 마커의 크기를 줄여서 보여주는 기능을 구현한다 #830
Conversation
- 임시로 데모 만들어본 것입니다. 추후 제거할 가능성이 높습니다. [#157]
- 아직 줌레벨을 실시간으로 트래킹해 17 이상인지 여부를 판별하고 있지 않으므로 재요청이 발생한 경우에만 마커가 다르게 찍히고 있습니다. [#157]
- 각 상태에 따라 렌더링 되는 컴포넌트에 역할 위임 [#157]
- zoom state에 max 추가 - max가 추가됨에 따라 변경이 필요한 컴포넌트들 수정 - zoom state의 변화에 따라 카페인 마커가 렌더링 되는 기능 구현 - zoom state가 high, max인 경우에 HighZoomMarkerContainer 컴포넌트 마운트 - MaxZoomMarkerContainer를 만들려 했으나 HighZoomMarkerContainer와 공유하는 값들이 많아 일단 보류 [#157]
- zoom state에 따라 CarffeineMarker, DefaultMarker를 선택해 렌더링하는 로직이 두 군데에서 사용되고 있어 이 부분을 함수로 분리해주었습니다. [#157]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
코멘트 외에 딱히 변경 사항 없어보입니다! 👍🏻
background: marker.availableCount > 0 ? '#3373DC' : '#EA4335', | ||
borderColor: marker.availableCount > 0 ? '#324F8E' : '#B8312F', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MARKER_COLORS
가 따로 있어요! CarFfeineMarker.style에서 가져와서 쓰면 될 것 같습니다~
(저도 여기서 색깔 가져다 쓰는 컴포넌트 작업 중이라 상수로 뺄까 그냥 마커 관련이니까 저기에 둘까 고민되네요)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
일단 상수를 가져다 사용하는 방법으로 수정했습니다!
const markerInstance = markerInstances.find( | ||
(markerInstance) => markerInstance.stationId === marker.stationId | ||
)?.markerInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[질문] markerInstance.markerInstance
제 눈엔 markerInstance에서 markerInstance를 꺼내는 게 뭔가 어색한데 보통 이런 식으로 같은 이름으로 둬도 괜찮나요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 꺼내는거 괜찮은 것 같아요.
다만, 이걸 actions 같은 곳에서 해줬음 어땠나 싶긴 하지만...
아니면 네이밍을 targetMarkerInstance는 어떤가요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 네이밍이 사용된 부분들이 좀 있어서 수정은 내일 캠퍼스에서 같이 해보시죠!
frontend/package.json
Outdated
@@ -16,6 +16,7 @@ | |||
"author": "", | |||
"license": "ISC", | |||
"dependencies": { | |||
"@googlemaps/markerclusterer": "^2.5.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이거 사용 가능 한가여?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 이거 지운다는게 깜빡했네요!
@@ -6,3 +8,4 @@ export interface StationMarkerInstance { | |||
} | |||
|
|||
export const markerInstanceStore = store<StationMarkerInstance[]>([]); | |||
export const markerClusterStore = store<MarkerClusterer>(null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앞으로도 사용 예정이라면 살려둬도 괜찮을 듯 합니다만, markerclusterer를 사용하지 못하는 것으로 들었어서 확인 부탁드립니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분도 까먹고 놓친 부분이었습니다!
@@ -2,6 +2,7 @@ export interface ZoomBreakpoints { | |||
low: number; | |||
middle: number; | |||
high: number; | |||
max: number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mini ,기본, plus, pro, pro max
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ultra
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
장난입니다. 바꾸면 안됩니다
}; | ||
|
||
export const zoomActions = { | ||
setZoom: (newZoom: number) => { | ||
const newZoomState = getZoomState(newZoom); | ||
if (newZoomState !== zoomStore.getState().state) { | ||
zoomStore.setState({ level: newZoom, state: getZoomState(newZoom) }); | ||
zoomStore.setState({ level: newZoom, state: newZoomState }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 만들어 놓은 기능이긴 하다만, level이라는 개념이 계속 필요한가 싶긴 해요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
일단은 두고 나중에 고민해보면 좋은 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
같이 서버 클러스터링 적용해보면서 생각해봅시다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
동작 제대로 하는 것 같아서 어프룹 드립니다. 특이사항이 없는 것 같아요
📄 Summary
🕰️ Actual Time of Completion
5시간
🙋🏻 More
🚀 Storybook
close #157