Browse Source

centrcentering marker on the map

master
analuizaff 4 years ago
parent
commit
f294821d9d
  1. 4
      src/app/screens/MapFormScreen.js
  2. 7
      src/app/screens/RainSharingDataScreen.js

4
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,
}}
>

7
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 (

Loading…
Cancel
Save