diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0e66142..65ca2fb 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -239,9 +239,9 @@ SPEC CHECKSUMS: React-jsiexecutor: 90ad2f9db09513fc763bc757fdc3c4ff8bde2a30 React-jsinspector: e08662d1bf5b129a3d556eb9ea343a3f40353ae4 react-native-geocoder: 757427682892bb256f3b3745858cc90eba148a8e - react-native-geolocation: cbd9d6bd06bac411eed2671810f454d4908484a8 + react-native-geolocation: c956aeb136625c23e0dce0467664af2c437888c9 react-native-google-maps: 88d750ad441b19c24885f20d43a55ecac25939b5 - react-native-image-picker: 3637d63fef7e32a230141ab4660d3ceb773c824f + react-native-image-picker: 7a85cf7b0a53845f03ae52fb4592a2748ded069b react-native-maps: 190c02ca533fddac5bb49cf17bdece3644612107 react-native-network-info: f327b8c73bced5dc08b4da313d96a5e33e9a6dac React-RCTActionSheet: b0f1ea83f4bf75fb966eae9bfc47b78c8d3efd90 diff --git a/ios/del_X/Info.plist b/ios/del_X/Info.plist index a31b09a..45514c8 100644 --- a/ios/del_X/Info.plist +++ b/ios/del_X/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 1 + 2 LSRequiresIPhoneOS NSAppTransportSecurity @@ -39,8 +39,10 @@ NSCameraUsageDescription $(PRODUCT_NAME) would like to use your camera + NSLocationAlwaysAndWhenInUseUsageDescription + The app needs to take your current location. NSLocationWhenInUseUsageDescription - + The app needs to take your current location. NSMicrophoneUsageDescription $(PRODUCT_NAME) would like to use your microphone (for videos) NSPhotoLibraryAddUsageDescription diff --git a/package.json b/package.json index 05d9bb8..1a1e554 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "react-native-geocoding": "^0.4.0", "react-native-geolocation-service": "^3.1.0", "react-native-gesture-handler": "^1.4.1", + "react-native-google-places-autocomplete": "^1.3.9", "react-native-image-picker": "^1.1.0", "react-native-keyboard-aware-scroll-view": "^0.9.1", "react-native-maps": "0.25.0", diff --git a/src/Component/Page/ActualPosition.js b/src/Component/Page/ActualPosition.js index d9f4315..6bdea01 100755 --- a/src/Component/Page/ActualPosition.js +++ b/src/Component/Page/ActualPosition.js @@ -5,6 +5,7 @@ import { Left, Right, Icon } from 'native-base'; import colors from '../../config/colors' import MapView, { Marker, ProviderPropType } from 'react-native-maps'; import Geolocation from 'react-native-geolocation-service'; +import ProgressScreen from '../Refer/ProgressScreen'; const { width, height } = Dimensions.get('window'); const ASPECT_RATIO = width / height; @@ -18,6 +19,7 @@ class ActualPosition extends Component { constructor(props){ super(props) this.state = { + isLoading: true, coords: { latitude: 37.78825 + SPACE, longitude: -122.4324 + SPACE, @@ -73,11 +75,14 @@ class ActualPosition extends Component { LATITUDE : position.coords.latitude, LONGITUDE : position.coords.longitude } + }, () => { + this.setState({isLoading: false}) }) }, (error) => { this.setState({ location: error, loading: false }); - console.log(error); + console.log(error); + this.setState({isLoading: false}) }, { enableHighAccuracy: true, timeout: 15000, maximumAge: 10000, distanceFilter: 50, forceRequestLocation: true } ); @@ -91,6 +96,9 @@ class ActualPosition extends Component { } render() { + if (this.state.isLoading) { + return + } return (
this.map_sender_log('onDragStart', e)} onDragEnd={e => this.map_sender_log('onDragEnd', e)} onPress={e => this.map_sender_log('onPress', e)} - draggable /> diff --git a/src/Component/Page/RegisterParcel.js b/src/Component/Page/RegisterParcel.js index d2541dc..2fce320 100755 --- a/src/Component/Page/RegisterParcel.js +++ b/src/Component/Page/RegisterParcel.js @@ -24,6 +24,7 @@ import Geolocation from 'react-native-geolocation-service'; import RNGeocoder from 'react-native-geocoder'; import Geocoder from 'react-native-geocoding'; import publicIP from 'react-native-public-ip'; +import { GooglePlacesAutocomplete } from 'react-native-google-places-autocomplete'; import colors from '../../config/colors'; import key from '../../config/api_keys'; import api from '../../config/api'; @@ -437,12 +438,66 @@ class RegisterParcel extends Component { { this.state.isShowSenderMap && + row.description} // custom description render + onPress={(data, details = null) => { // 'details' is provided when fetchDetails = true + console.log(data, details); + }} + + getDefaultValue={() => ''} + + query={{ + // available options: https://developers.google.com/places/web-service/autocomplete + key: Platform.OS === 'ios' ? key.google_map_ios: key.google_map_android, + language: 'en', // language of the results + types: '(cities)' // default: 'geocode' + }} + + styles={{ + textInputContainer: { + width: '100%' + }, + description: { + fontWeight: 'bold' + }, + predefinedPlacesDescription: { + color: '#1faadb' + } + }} + nearbyPlacesAPI='GooglePlacesSearch' // Which API to use: GoogleReverseGeocoding or GooglePlacesSearch + GoogleReverseGeocodingQuery={{ + // available options for GoogleReverseGeocoding API : https://developers.google.com/maps/documentation/geocoding/intro + }} + GooglePlacesSearchQuery={{ + // available options for GooglePlacesSearch API : https://developers.google.com/places/web-service/search + rankby: 'distance', + type: 'cafe' + }} + + GooglePlacesDetailsQuery={{ + // available options for GooglePlacesDetails API : https://developers.google.com/places/web-service/details + fields: 'formatted_address', + }} + + filterReverseGeocodingByTypes={['locality', 'administrative_area_level_3']} // filter the reverse geocoding results by types - ['locality', 'administrative_area_level_3'] if you want to display only cities + + + debounce={200} // debounce the requests in ms. Set to 0 to remove debounce. By default 0ms. + + />