Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
clone_excelso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Prasetya Saputra
clone_excelso
Commits
17e45f8e
Commit
17e45f8e
authored
Sep 17, 2020
by
Trisno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix issue maps build 149
parent
68929dff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
14 deletions
+28
-14
app.json
app.json
+1
-1
AddreesDetail.js
view/AddreesDetail.js
+27
-13
No files found.
app.json
View file @
17e45f8e
{
{
"expo"
:
{
"expo"
:
{
"extra"
:
{
"extra"
:
{
"buildNumber"
:
"14
8
"
,
"buildNumber"
:
"14
9
"
,
"remarks"
:
""
"remarks"
:
""
},
},
...
...
view/AddreesDetail.js
View file @
17e45f8e
...
@@ -151,13 +151,11 @@ class AddreesDetail extends React.Component {
...
@@ -151,13 +151,11 @@ class AddreesDetail extends React.Component {
//searchlocation (mencari lokasi)
//searchlocation (mencari lokasi)
_searchLocation
=
async
()
=>
{
_searchLocation
=
async
()
=>
{
let
search_location
=
await
Location
.
geocodeAsync
(
this
.
state
.
address
,
Location
.
Accuracy
.
Balanced
)
let
search_location
=
await
Location
.
geocodeAsync
(
this
.
state
.
address
,
Location
.
Accuracy
.
Balanced
)
if
(
search_location
.
length
===
0
)
{
if
(
search_location
.
length
===
0
)
{
Alert
.
alert
(
i18n
.
t
(
'alertAddressNotFound'
));
Alert
.
alert
(
i18n
.
t
(
'alertAddressNotFound'
));
}
else
{
}
else
{
let
detail
=
await
Location
.
reverseGeocodeAsync
(
search_location
[
0
])
let
detail
=
await
Location
.
reverseGeocodeAsync
(
search_location
[
0
])
this
.
setState
({
this
.
setState
({
latitude
:
search_location
[
0
].
latitude
,
latitude
:
search_location
[
0
].
latitude
,
longitude
:
search_location
[
0
].
longitude
,
longitude
:
search_location
[
0
].
longitude
,
...
@@ -172,18 +170,30 @@ class AddreesDetail extends React.Component {
...
@@ -172,18 +170,30 @@ class AddreesDetail extends React.Component {
// console.log('LATITUDE' + '' + this.state.latitude + '' + 'LONGITUDE' + this.state.longitude)
// console.log('LATITUDE' + '' + this.state.latitude + '' + 'LONGITUDE' + this.state.longitude)
}
}
validation
(){
validation
()
{
if
(
this
.
state
.
name
==
''
)
{
if
(
this
.
state
.
name
==
''
)
{
Alert
.
alert
(
i18n
.
t
(
'alertLabelAddress'
))
Alert
.
alert
(
i18n
.
t
(
'alertLabelAddress'
))
}
else
if
(
this
.
state
.
description
==
''
){
}
else
if
(
this
.
state
.
description
==
''
)
{
Alert
.
alert
(
i18n
.
t
(
'alertDetailAddress'
))
Alert
.
alert
(
i18n
.
t
(
'alertDetailAddress'
))
}
else
{
}
else
{
this
.
saveAddress
()
this
.
saveAddress
()
}
}
}
}
_onKeyPress
()
{
onChangeLocation
=
async
(
e
)
=>
{
Alert
.
alert
(
'tes key press'
)
// 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
()
{
saveAddress
()
{
...
@@ -265,18 +275,22 @@ class AddreesDetail extends React.Component {
...
@@ -265,18 +275,22 @@ class AddreesDetail extends React.Component {
latitude
:
this
.
state
.
latitude
,
latitude
:
this
.
state
.
latitude
,
longitude
:
this
.
state
.
longitude
,
longitude
:
this
.
state
.
longitude
,
latitudeDelta
:
0.1
,
latitudeDelta
:
0.
00
1
,
longitudeDelta
:
0.1
,
longitudeDelta
:
0.
00
1
,
}}
}}
onPress
=
{(
e
)
=>
this
.
onChangeLocation
(
e
)}
zoomEnabled
=
{
true
}
zoomEnabled
=
{
true
}
showsMyLocationButton
=
{
true
}
showsMyLocationButton
=
{
true
}
loadingEnabled
=
{
true
}
loadingEnabled
=
{
true
}
showsUserLocation
=
{
true
}
showsUserLocation
=
{
true
}
showsScale
=
{
true
}
showsScale
=
{
true
}
provider
=
{
PROVIDER_GOOGLE
}
provider
=
{
PROVIDER_GOOGLE
}
zoomControlEnabled
=
{
true
}
style
=
{
styles
.
cont_google_map
}
>
style
=
{
styles
.
cont_google_map
}
>
<
MapView
.
Marker
<
MapView
.
Marker
draggable
onDragEnd
=
{(
e
)
=>
this
.
onChangeLocation
(
e
)}
coordinate
=
{{
coordinate
=
{{
latitude
:
this
.
state
.
latitude
,
latitude
:
this
.
state
.
latitude
,
longitude
:
this
.
state
.
longitude
longitude
:
this
.
state
.
longitude
...
@@ -287,9 +301,9 @@ class AddreesDetail extends React.Component {
...
@@ -287,9 +301,9 @@ class AddreesDetail extends React.Component {
<
/MapView
>
<
/MapView
>
<
View
style
=
{{
position
:
'absolute'
,
top
:
'50%'
,
alignSelf
:
'flex-end'
}}
>
<
View
style
=
{{
position
:
'absolute'
,
top
:
'50%'
,
alignSelf
:
'flex-end'
}}
>
<
View
style
=
{{
margin
:
15
}}
>
<
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 }} /> */
}
{
/* <Image source={require('../assets/icon/gps.png')} style={{ height: 30, width: 30 }} /> */
}
<
/TouchableOpacity
>
{
/* </TouchableOpacity> */
}
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
...
@@ -329,7 +343,7 @@ class AddreesDetail extends React.Component {
...
@@ -329,7 +343,7 @@ class AddreesDetail extends React.Component {
caretHidden
=
{
this
.
state
.
caretHidden
}
caretHidden
=
{
this
.
state
.
caretHidden
}
onFocus
=
{()
=>
this
.
setState
({
caretHidden
:
false
})}
/
>
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
>
<
View
style
=
{{
margin
:
50
,
justifyContent
:
'center'
}}
>
<
View
style
=
{{
margin
:
50
,
justifyContent
:
'center'
}}
>
{
{
...
@@ -384,7 +398,7 @@ const styles = StyleSheet.create({
...
@@ -384,7 +398,7 @@ const styles = StyleSheet.create({
top
:
5
,
top
:
5
,
marginRight
:
10
,
marginRight
:
10
,
marginLeft
:
10
,
marginLeft
:
10
,
height
:
2
50
,
height
:
3
50
,
},
},
name_addrees_input
:
{
name_addrees_input
:
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment