Commit 17e45f8e authored by Trisno's avatar Trisno

fix issue maps build 149

parent 68929dff
{
"expo": {
"extra" : {
"buildNumber" : "148",
"buildNumber" : "149",
"remarks": ""
},
......
......@@ -151,13 +151,11 @@ class AddreesDetail extends React.Component {
//searchlocation (mencari lokasi)
_searchLocation = async () => {
let search_location = await Location.geocodeAsync(this.state.address, Location.Accuracy.Balanced)
if (search_location.length === 0) {
Alert.alert(i18n.t('alertAddressNotFound'));
} else {
let detail = await Location.reverseGeocodeAsync(search_location[0])
this.setState({
latitude: search_location[0].latitude,
longitude: search_location[0].longitude,
......@@ -172,18 +170,30 @@ class AddreesDetail extends React.Component {
// console.log('LATITUDE' + '' + this.state.latitude + '' + 'LONGITUDE' + this.state.longitude)
}
validation(){
validation() {
if (this.state.name == '') {
Alert.alert(i18n.t('alertLabelAddress'))
} else if (this.state.description == ''){
} else if (this.state.description == '') {
Alert.alert(i18n.t('alertDetailAddress'))
} else {
this.saveAddress()
}
}
_onKeyPress() {
Alert.alert('tes key press')
onChangeLocation = async (e) => {
// console.log(e.nativeEvent.coordinate.latitude)
this.setState({
latitude: e.nativeEvent.coordinate.latitude,
longitude: e.nativeEvent.coordinate.longitude,
})
let detail = await Location.reverseGeocodeAsync(e.nativeEvent.coordinate)
this.setState({
street: detail[0].street,
city: detail[0].city,
// name: detail[0].name,
region: detail[0].region,
postalCode: detail[0].postalCode,
})
}
saveAddress() {
......@@ -265,18 +275,22 @@ class AddreesDetail extends React.Component {
latitude: this.state.latitude,
longitude: this.state.longitude,
latitudeDelta: 0.1,
longitudeDelta: 0.1,
latitudeDelta: 0.001,
longitudeDelta: 0.001,
}}
onPress={(e) => this.onChangeLocation(e)}
zoomEnabled={true}
showsMyLocationButton={true}
loadingEnabled={true}
showsUserLocation={true}
showsScale={true}
provider={PROVIDER_GOOGLE}
zoomControlEnabled={true}
style={styles.cont_google_map}>
<MapView.Marker
draggable
onDragEnd={(e) => this.onChangeLocation(e)}
coordinate={{
latitude: this.state.latitude,
longitude: this.state.longitude
......@@ -287,9 +301,9 @@ class AddreesDetail extends React.Component {
</MapView>
<View style={{ position: 'absolute', top: '50%', alignSelf: 'flex-end' }}>
<View style={{ margin: 15 }}>
<TouchableOpacity style={{ height: 30, width: 30, backgroundColor: '#e6e6e6' }} onPress={() => this._getLocationAsync()}>
{/* <TouchableOpacity style={{ height: 30, width: 30, backgroundColor: 'red' }} onPress={() => this._getLocationAsync()}> */}
{/* <Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} /> */}
</TouchableOpacity>
{/* </TouchableOpacity> */}
</View>
</View>
</View>
......@@ -329,7 +343,7 @@ class AddreesDetail extends React.Component {
caretHidden={this.state.caretHidden}
onFocus={() => this.setState({ caretHidden: false })} />
<Text style={{ color: '#666666', textAlign: 'center', fontSize: 14, paddingBottom:15 }}>{i18n.t('address_fulladdress_helptext')}</Text>
<Text style={{ color: '#666666', textAlign: 'center', fontSize: 14, paddingBottom: 15 }}>{i18n.t('address_fulladdress_helptext')}</Text>
</View>
<View style={{ margin: 50, justifyContent: 'center' }}>
{
......@@ -384,7 +398,7 @@ const styles = StyleSheet.create({
top: 5,
marginRight: 10,
marginLeft: 10,
height: 250,
height: 350,
},
name_addrees_input: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment