From f294821d9d211ce6cc6c116c6989a6142ff8e5a2 Mon Sep 17 00:00:00 2001 From: analuizaff Date: Tue, 2 Mar 2021 17:50:01 -0300 Subject: [PATCH] centrcentering marker on the map --- src/app/screens/MapFormScreen.js | 4 ++-- src/app/screens/RainSharingDataScreen.js | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/app/screens/MapFormScreen.js b/src/app/screens/MapFormScreen.js index 7dcca35..73c6d6e 100644 --- a/src/app/screens/MapFormScreen.js +++ b/src/app/screens/MapFormScreen.js @@ -50,8 +50,8 @@ const MapFormScreen = (props) => { ...lat_long_delta, }} region={{ - latitude: location.latitude, - longitude: location.longitude, + latitude: marker.latitude, + longitude: marker.longitude, ...lat_long_delta, }} > diff --git a/src/app/screens/RainSharingDataScreen.js b/src/app/screens/RainSharingDataScreen.js index ad9a393..799da5a 100644 --- a/src/app/screens/RainSharingDataScreen.js +++ b/src/app/screens/RainSharingDataScreen.js @@ -39,15 +39,12 @@ function RainSharingDataScreen(props) { const [date, setDate] = useState(moment()); const [time, setTime] = useState(moment()); - //======== testei aqui pra ver se atualiza a localização pro default quando abre o formulário =========== - - const context = useContext(EventLocationContext); + const context = useContext(EventLocationContext); useEffect(() => { context.defaultLocation(); }, []); - //======================================================================================================== - + const location = context.eventCoordinates; return (