Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
lub2code committed Sep 20, 2019
1 parent 7541249 commit 711d9ac
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 8 deletions.
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions ios/del_X/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<string>2</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
Expand All @@ -39,8 +39,10 @@
</dict>
<key>NSCameraUsageDescription</key>
<string>$(PRODUCT_NAME) would like to use your camera</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>The app needs to take your current location.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string></string>
<string>The app needs to take your current location.</string>
<key>NSMicrophoneUsageDescription</key>
<string>$(PRODUCT_NAME) would like to use your microphone (for videos)</string>
<key>NSPhotoLibraryAddUsageDescription</key>
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
11 changes: 9 additions & 2 deletions src/Component/Page/ActualPosition.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
Expand Down Expand Up @@ -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 }
);
Expand All @@ -91,6 +96,9 @@ class ActualPosition extends Component {
}

render() {
if (this.state.isLoading) {
return <ProgressScreen/>
}
return (
<View style={styles.container}>
<Header
Expand All @@ -114,7 +122,6 @@ class ActualPosition extends Component {
onDragStart={e => this.map_sender_log('onDragStart', e)}
onDragEnd={e => this.map_sender_log('onDragEnd', e)}
onPress={e => this.map_sender_log('onPress', e)}
draggable
/>
</MapView>
</View>
Expand Down
59 changes: 57 additions & 2 deletions src/Component/Page/RegisterParcel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -437,12 +438,66 @@ class RegisterParcel extends Component {
{
this.state.isShowSenderMap &&
<Card containerStyle={{padding: 0}}>
<GooglePlacesAutocomplete
placeholder='Search'
minLength={2} // minimum length of text to search
autoFocus={false}
returnKeyType={'search'} // Can be left out for default return key https://facebook.github.io/react-native/docs/textinput.html#returnkeytype
keyboardAppearance={'light'} // Can be left out for default keyboardAppearance https://facebook.github.io/react-native/docs/textinput.html#keyboardappearance
listViewDisplayed='auto' // true/false/undefined
fetchDetails={true}
renderDescription={row => 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.

/>
<MapView
provider={this.props.provider}
style={styles.map}
initialRegion={{
latitude: this.state.sender_coords.LATITUDE,
longitude: this.state.sender_coords.LONGITUDE,
latitude: this.state.sender_coords.latitude,
longitude: this.state.sender_coords.longitude,
latitudeDelta: LATITUDE_DELTA,
longitudeDelta: LONGITUDE_DELTA,
}}
Expand Down
19 changes: 19 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4126,6 +4126,11 @@ locate-path@^3.0.0:
p-locate "^3.0.0"
path-exists "^3.0.0"

lodash.debounce@^4.0.8:
version "4.0.8"
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168=

lodash.sortby@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
Expand Down Expand Up @@ -5378,6 +5383,11 @@ punycode@^2.1.0, punycode@^2.1.1:
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec"
integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==

qs@^5.2.0:
version "5.2.1"
resolved "https://registry.yarnpkg.com/qs/-/qs-5.2.1.tgz#801fee030e0b9450d6385adc48a4cc55b44aedfc"
integrity sha1-gB/uAw4LlFDWOFrcSKTMVbRK7fw=

qs@~6.5.2:
version "6.5.2"
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
Expand Down Expand Up @@ -5495,6 +5505,15 @@ react-native-gesture-handler@^1.4.1:
invariant "^2.2.4"
prop-types "^15.7.2"

react-native-google-places-autocomplete@^1.3.9:
version "1.3.9"
resolved "https://registry.yarnpkg.com/react-native-google-places-autocomplete/-/react-native-google-places-autocomplete-1.3.9.tgz#34c2e8b51df40ecb55ef3ccf57caba4c89ff9b56"
integrity sha512-bMZRYLpkuhvWE+UYmONw5fsEBM9cyJcSBESHTCKT8ZIydi+HKEM4rKZ+qLvgeHMPD2wpWRNwMJFDhR+ja/datQ==
dependencies:
lodash.debounce "^4.0.8"
prop-types "^15.5.10"
qs "^5.2.0"

react-native-image-picker@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/react-native-image-picker/-/react-native-image-picker-1.1.0.tgz#c2a0523886edb4cf2cdc008ad0a71433142a4d53"
Expand Down

0 comments on commit 711d9ac

Please sign in to comment.