|
|
@ -24,11 +24,7 @@ const MapFormScreen = (props) => { |
|
|
|
const address = await Location.reverseGeocodeAsync(coordenadas); |
|
|
|
if (address[0] != undefined) { |
|
|
|
context.saveNewLocation( |
|
|
|
address[0].street + |
|
|
|
", " + |
|
|
|
address[0].name + |
|
|
|
"\n" + |
|
|
|
address[0].district, |
|
|
|
address[0].street + ", " + address[0].name + "\n" + address[0].district, |
|
|
|
coordenadas |
|
|
|
); |
|
|
|
} else { |
|
|
@ -48,16 +44,19 @@ const MapFormScreen = (props) => { |
|
|
|
longitudeDelta: map_scale * (screen_width / screen_height), |
|
|
|
}; |
|
|
|
|
|
|
|
const default_location = { |
|
|
|
latitude: -12.901799, |
|
|
|
longitude: -51.692116, |
|
|
|
latitudeDelta: 70, |
|
|
|
longitudeDelta: 70 * (screen_width / screen_height), |
|
|
|
}; |
|
|
|
|
|
|
|
return ( |
|
|
|
<View style={styles.container}> |
|
|
|
<MapView |
|
|
|
style={styles.mapStyle} |
|
|
|
showsUserLocation={true} |
|
|
|
initialRegion={{ |
|
|
|
latitude: -23.533773, |
|
|
|
longitude: -46.62529, |
|
|
|
...lat_long_delta, |
|
|
|
}} |
|
|
|
initialRegion={{ ...default_location }} |
|
|
|
region={{ |
|
|
|
latitude: marker.latitude, |
|
|
|
longitude: marker.longitude, |
|
|
@ -67,7 +66,7 @@ const MapFormScreen = (props) => { |
|
|
|
console.log(r); |
|
|
|
setMarker({ latitude: r.latitude, longitude: r.longitude }); |
|
|
|
}} |
|
|
|
></MapView> |
|
|
|
/> |
|
|
|
<View style={styles.markerFixed}> |
|
|
|
<Image |
|
|
|
style={styles.marker} |
|
|
@ -75,14 +74,8 @@ const MapFormScreen = (props) => { |
|
|
|
source={require("../assets/map-marker.png")} |
|
|
|
/> |
|
|
|
</View> |
|
|
|
<View |
|
|
|
style={{ |
|
|
|
flexDirection: "column", |
|
|
|
flex: 1, |
|
|
|
justifyContent: "flex-end", |
|
|
|
padding: 10, |
|
|
|
}} |
|
|
|
> |
|
|
|
|
|
|
|
<View style={styles.submit_btn}> |
|
|
|
<TouchableOpacity onPress={() => setLocation()}> |
|
|
|
<View style={styles.button}> |
|
|
|
<Text style={styles.text}>Confirmar</Text> |
|
|
@ -94,6 +87,12 @@ const MapFormScreen = (props) => { |
|
|
|
}; |
|
|
|
|
|
|
|
const styles = StyleSheet.create({ |
|
|
|
submit_btn: { |
|
|
|
position: "absolute", |
|
|
|
bottom: 0, |
|
|
|
width: "100%", |
|
|
|
padding: 20, |
|
|
|
}, |
|
|
|
container: { |
|
|
|
backgroundColor: colors.black, |
|
|
|
flex: 1, |
|
|
|