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

Use default coords if userGps not available. #16

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

liayoo
Copy link
Collaborator

@liayoo liayoo commented Apr 21, 2020

  • Use default coords if userGps not available
  • Set maxZoom

Copy link
Collaborator

@ehdgus8077 ehdgus8077 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가벼운 Comment 하나 추가했습니다!

const markers = useRef([]);
const mapRef = useRef(null);
const mapContainerRef = useRef(null);
const gpsRef = useRef(userGps);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

userGps를 바로 사용하지 않고, useRef를 이용하여 따로 만든 이유를 알 수 있을까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTimeout 같은 경우 useState hook으로는 업데이트가 안되서 이렇게 했습니다 (related: facebook/react#14010) usePosition이 App.js 에서 더이상 안쓰이고 있어서 Map.js로 옮겨왔어도 되긴한데.. 그래도 useRef를 사용해야하긴 마찬가지일듯합니다

@liayoo liayoo merged commit aa6e96a into development Apr 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants