mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-17 06:19:25 +08:00
Reflect user pin location change if user manually overrides location
This commit is contained in:
parent
7da7d0f217
commit
19d19c3dd5
1 changed files with 14 additions and 5 deletions
|
@ -243,8 +243,12 @@ export default function Home() {
|
|||
minZoomLevel={19}
|
||||
zoomTapEnabled
|
||||
initialRegion={{
|
||||
latitude: location.coords.latitude,
|
||||
longitude: location.coords.longitude,
|
||||
latitude:
|
||||
student_status?.location?.latitude ||
|
||||
location.coords.latitude,
|
||||
longitude:
|
||||
student_status?.location?.longitude ||
|
||||
location.coords.longitude,
|
||||
latitudeDelta: 0.4,
|
||||
longitudeDelta: 0.4,
|
||||
}}
|
||||
|
@ -372,11 +376,16 @@ export default function Home() {
|
|||
}
|
||||
)}
|
||||
<Marker
|
||||
zIndex={1001}
|
||||
coordinate={{
|
||||
latitude: location.coords.latitude,
|
||||
longitude: location.coords.longitude,
|
||||
latitude:
|
||||
student_status?.location?.latitude ||
|
||||
location.coords.latitude,
|
||||
longitude:
|
||||
student_status?.location?.longitude ||
|
||||
location.coords.longitude,
|
||||
}}
|
||||
draggable={student_status?.active}
|
||||
draggable={!student_status?.active}
|
||||
onDragEnd={(e) => {
|
||||
const newLocation = e.nativeEvent.coordinate;
|
||||
const distance = GetDistance(
|
||||
|
|
Loading…
Reference in a new issue