Browse Source

centrcentering marker on the map

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

4
src/app/screens/MapFormScreen.js

@ -50,8 +50,8 @@ const MapFormScreen = (props) => {
...lat_long_delta, ...lat_long_delta,
}} }}
region={{ region={{
latitude: location.latitude,
longitude: location.longitude,
latitude: marker.latitude,
longitude: marker.longitude,
...lat_long_delta, ...lat_long_delta,
}} }}
> >

3
src/app/screens/RainSharingDataScreen.js

@ -39,14 +39,11 @@ function RainSharingDataScreen(props) {
const [date, setDate] = useState(moment()); const [date, setDate] = useState(moment());
const [time, setTime] = 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(() => { useEffect(() => {
context.defaultLocation(); context.defaultLocation();
}, []); }, []);
//========================================================================================================
const location = context.eventCoordinates; const location = context.eventCoordinates;

Loading…
Cancel
Save