QuadFlask / react-native-naver-map

🗺️naver map for react-native
MIT License
163 stars 147 forks source link

NaverMapView 컴포넌트 center 의 위도, 경도 변경시 해당 위치로 이동이 안되는데 해결법 아시는분 계신가요?(정확히는 한번만됨) #181

Open ghost opened 1 year ago

ghost commented 1 year ago

Version of react-native-naver-map libraries

0.0.66

Version of react-native

0.71.4

Platforms you faced the error (IOS or Android or both?)

IOS

Expected behavior

Actual behavior

NaverMapView 컴포넌트의 center props 의 longitude, latitude 값을 state 로 관리하고 있어요 그래서 state 가 변경되면 위치 포커스가 이동이 되는 방식인데 현재는 한번만 적용이 되고 값이 그대로일 경우 위치포커스가 바뀌지않아요 (ref 를 NaverMapView 로 값을 바꿔서 넣어줬으나 재렌더링으로 인해서 정신없이 이동됨)

Tested environment (Emulator? Real Device?)

iphone12 mini 실제기기

Screen Shot

dgfh0450 commented 1 year ago

동일한 현상이 있습니다. state를 변경해도 지도가 움직이지 않아서 method중 animateToCoordinate를 활용하고 있습니다. //현재 위치로 돌아가기 버튼 const handleToCenter = (): void => { mapView?.current.animateToCoordinate(nowCoor); }