Skip to content

Commit

Permalink
feat: add on region change event to update the map
Browse files Browse the repository at this point in the history
  • Loading branch information
geeekgod committed Apr 1, 2023
1 parent 11dd2d4 commit 718bd97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/context/DataContext/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ const DataContextProvider = ({ children }) => {
Authorization: token
}
}).then((res) => {
console.log(res.data);
if (res.data.success) {
setNearByRequests(res.data.data)
storeData("@nearByRequest", res.data.data)
Expand Down
4 changes: 3 additions & 1 deletion app/screens/MapRequestsView/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ const MapRequestsView = () => {
<View style={styles.container}>
<MapView
initialRegion={locationState}
style={styles.map} >
style={styles.map}
onRegionChangeComplete={(e) => setLocationState({...locationState, latitude: e.latitude, longitude: e.longitude})}
>

{locationState.latitude && locationState.longitude && (
<Marker coordinate={locationState}
Expand Down

0 comments on commit 718bd97

Please sign in to comment.