浏览代码

Cambios para que se envien los usernames con la cita y para que funcione con Confirm

gilberto.cancel 3 年前
父节点
当前提交
a197747f59
共有 1 个文件被更改,包括 33 次插入6 次删除
  1. 33
    6
      screens/main/Map.js

+ 33
- 6
screens/main/Map.js 查看文件

2
 import { useState } from 'react';
2
 import { useState } from 'react';
3
 import MapView, { Marker } from 'react-native-maps';
3
 import MapView, { Marker } from 'react-native-maps';
4
 import { Button, StyleSheet, Text, View, Dimensions, Pressable } from 'react-native';
4
 import { Button, StyleSheet, Text, View, Dimensions, Pressable } from 'react-native';
5
+import { Confirm } from './Confirm';
5
 
6
 
6
 
7
 
7
 export default function Map({route, navigation} ) {
8
 export default function Map({route, navigation} ) {
19
     u_token =  route.params.U_Token,
20
     u_token =  route.params.U_Token,
20
     username = route.params.Username,
21
     username = route.params.Username,
21
     I_username = route.params.I_Username,
22
     I_username = route.params.I_Username,
23
+    Confirm_Flag = route.params.Confirm_Flag,
22
     View_Only = route.params.View_Only
24
     View_Only = route.params.View_Only
23
     } = route.params
25
     } = route.params
24
     
26
     
30
   if(View_Only == true){
32
   if(View_Only == true){
31
 
33
 
32
     const Retrive_pin = route.params.Pin;
34
     const Retrive_pin = route.params.Pin;
35
+    console.log("Retrieve lat", Retrive_pin)
33
 
36
 
34
-  console.log("Retrieve lat", Retrive_pin.Pin[0])
37
+    if(Confirm_Flag == true){
38
+      const [pin2, setPin2] = React.useState({
39
+        latitude: Retrive_pin[0].Pin[0],
40
+        longitude: Retrive_pin[0].Pin[1],
41
+      })
35
 
42
 
36
-  const [pin2, setPin2] = React.useState({
37
-    latitude: Retrive_pin.Pin[0],
38
-    longitude: Retrive_pin.Pin[1],
39
-  })
43
+      console.log("Pin2", pin2)
44
+  
45
+      return (
46
+        <View style={styles.container}>
47
+          <MapView style={styles.map}
48
+            initialRegion={{
49
+              latitude: pin2.latitude,
50
+              longitude: pin2.longitude,
51
+              latitudeDelta: 0.0922,
52
+              longitudeDelta: 0.0421,
53
+            }}
54
+            provider="google"
55
+          >
56
+            <Marker coordinate={pin2} />
57
+          </MapView>
58
+        </View>
59
+      );
60
+    }
40
 
61
 
41
-  console.log("Pin2", pin2)
62
+    else{
63
+      const [pin2, setPin2] = React.useState({
64
+      latitude: Retrive_pin.Pin[0],
65
+      longitude: Retrive_pin.Pin[1],
66
+      })
67
+    console.log("Pin2", pin2)
42
   
68
   
43
     return (
69
     return (
44
       <View style={styles.container}>
70
       <View style={styles.container}>
56
       </View>
82
       </View>
57
     );
83
     );
58
   }
84
   }
85
+}
59
   else{
86
   else{
60
 
87
 
61
     const [pin1, setPin1] = React.useState({
88
     const [pin1, setPin1] = React.useState({