Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
react-native-amap3d
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
放牛的园子
react-native-amap3d
Commits
aa43ddc0
Commit
aa43ddc0
authored
Jun 13, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化示例在 iOS 下的样式
parent
dca66e6d
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
83 additions
and
70 deletions
+83
-70
app.js
example/src/app.js
+9
-1
examples.js
example/src/examples.js
+5
-2
controls.js
example/src/examples/controls.js
+3
-24
gestures.js
example/src/examples/gestures.js
+1
-23
indoor.js
example/src/examples/indoor.js
+2
-1
layers.js
example/src/examples/layers.js
+21
-19
styles.js
example/src/styles.js
+42
-0
No files found.
example/src/app.js
View file @
aa43ddc0
import
{
Platform
}
from
'react-native'
import
{
StackNavigator
}
from
'react-navigation'
import
Examples
from
'./examples'
import
MapTypes
from
'./examples/map-types'
...
...
@@ -25,7 +26,14 @@ export default StackNavigator({
navigationOptions
:
{
headerTintColor
:
'#212121'
,
headerStyle
:
{
backgroundColor
:
'#f5f5f5'
,
...
Platform
.
select
({
ios
:
{
backgroundColor
:
'#fff'
,
},
android
:
{
backgroundColor
:
'#f5f5f5'
,
},
})
},
},
})
example/src/examples.js
View file @
aa43ddc0
...
...
@@ -58,7 +58,11 @@ export default class Examples extends Component {
const
styles
=
StyleSheet
.
create
({
scrollView
:
{
flex
:
1
,
backgroundColor
:
'#f5f5f5'
,
...
Platform
.
select
({
android
:
{
backgroundColor
:
'#f5f5f5'
,
},
})
},
group
:
{
marginTop
:
15
,
...
...
@@ -69,7 +73,6 @@ const styles = StyleSheet.create({
},
separator
:
{
height
:
StyleSheet
.
hairlineWidth
,
backgroundColor
:
'#e0e0e0'
,
},
itemText
:
{
fontSize
:
16
,
...
...
example/src/examples/controls.js
View file @
aa43ddc0
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
{
StyleSheet
,
View
,
Text
,
Switch
,
Platform
}
from
'react-native'
import
MapView
from
'react-native-amap3d'
import
styles
from
'../styles'
export
default
class
Controls
extends
Component
{
static
navigationOptions
=
{
...
...
@@ -9,7 +10,7 @@ export default class Controls extends Component {
state
=
{
showsCompass
:
false
,
showsScale
:
fals
e
,
showsScale
:
tru
e
,
showsZoomControls
:
true
,
showsLocationButton
:
false
,
}
...
...
@@ -56,25 +57,3 @@ export default class Controls extends Component {
<
/View
>
}
}
const
styles
=
StyleSheet
.
create
({
map
:
{
flex
:
1
,
},
controls
:
{
height
:
72
,
backgroundColor
:
'#f5f5f5'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
elevation
:
4
,
paddingLeft
:
20
,
paddingRight
:
20
,
},
control
:
{
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
switch
:
{
marginTop
:
5
,
},
})
example/src/examples/gestures.js
View file @
aa43ddc0
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
MapView
from
'react-native-amap3d'
import
styles
from
'../styles'
export
default
class
Gestures
extends
Component
{
static
navigationOptions
=
{
...
...
@@ -55,26 +56,3 @@ export default class Gestures extends Component {
<
/View
>
}
}
const
styles
=
StyleSheet
.
create
({
map
:
{
flex
:
1
,
},
controls
:
{
height
:
72
,
backgroundColor
:
'#f5f5f5'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
elevation
:
4
,
paddingLeft
:
20
,
paddingRight
:
20
,
},
control
:
{
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
switch
:
{
marginTop
:
5
,
},
})
example/src/examples/indoor.js
View file @
aa43ddc0
...
...
@@ -10,11 +10,12 @@ export default class Indoor extends Component {
render
()
{
return
<
MapView
coordinate
=
{{
latitude
:
39.9
1095
,
latitude
:
39.9
0980
,
longitude
:
116.37296
,
}}
zoomLevel
=
{
18
}
showsIndoorMap
=
{
true
}
tilt
=
{
45
}
style
=
{
StyleSheet
.
absoluteFill
}
/
>
}
}
example/src/examples/layers.js
View file @
aa43ddc0
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
{
StyleSheet
,
View
,
Text
,
Switch
,
Platform
}
from
'react-native'
import
MapView
from
'react-native-amap3d'
import
commonStyles
from
'../styles'
export
default
class
Layers
extends
Component
{
static
navigationOptions
=
{
...
...
@@ -17,19 +18,19 @@ export default class Layers extends Component {
return
<
View
style
=
{
StyleSheet
.
absoluteFill
}
>
<
View
style
=
{
styles
.
controls
}
>
<
View
style
=
{
styles
.
control
}
>
<
Text
>
建筑
<
/Text
>
<
Text
style
=
{
styles
.
label
}
>
建筑
<
/Text
>
<
Switch
onValueChange
=
{
showsBuildings
=>
this
.
setState
({
showsBuildings
})}
value
=
{
this
.
state
.
showsBuildings
}
/
>
<
/View
>
<
View
style
=
{
styles
.
control
}
>
<
Text
>
路况
<
/Text
>
<
Text
style
=
{
styles
.
label
}
>
路况
<
/Text
>
<
Switch
onValueChange
=
{
showsTraffic
=>
this
.
setState
({
showsTraffic
})}
value
=
{
this
.
state
.
showsTraffic
}
/
>
<
/View
>
<
View
style
=
{
styles
.
control
}
>
<
Text
>
标签
<
/Text
>
<
Text
style
=
{
styles
.
label
}
>
标签
<
/Text
>
<
Switch
onValueChange
=
{
showsLabels
=>
this
.
setState
({
showsLabels
})}
value
=
{
this
.
state
.
showsLabels
}
/
>
...
...
@@ -46,21 +47,22 @@ export default class Layers extends Component {
}
}
const
styles
=
StyleSheet
.
create
({
map
:
{
flex
:
1
,
},
controls
:
{
const
styles
=
{
...
commonStyles
,
map
:
[
commonStyles
.
map
,
{
...
Platform
.
select
({
ios
:
{
marginBottom
:
54
,
},
}),
}],
controls
:
[
commonStyles
.
controls
,
{
height
:
54
,
backgroundColor
:
'#f5f5f5'
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
elevation
:
4
,
paddingLeft
:
20
,
paddingRight
:
20
,
},
control
:
{
}],
control
:
[
commonStyles
.
control
,
{
flexDirection
:
'row'
,
alignItems
:
'center'
,
}],
label
:
{
marginRight
:
5
,
},
}
)
}
example/src/styles.js
0 → 100644
View file @
aa43ddc0
import
{
StyleSheet
,
Platform
}
from
'react-native'
export
default
StyleSheet
.
create
({
map
:
{
flex
:
1
,
...
Platform
.
select
({
ios
:
{
marginBottom
:
72
,
},
}),
},
controls
:
{
height
:
72
,
flexDirection
:
'row'
,
justifyContent
:
'space-between'
,
elevation
:
4
,
paddingLeft
:
20
,
paddingRight
:
20
,
...
Platform
.
select
({
android
:
{
backgroundColor
:
'#f5f5f5'
,
},
ios
:
{
backgroundColor
:
'#fff'
,
position
:
'absolute'
,
left
:
0
,
right
:
0
,
bottom
:
0
,
borderTopColor
:
'#e0e0e0'
,
borderTopWidth
:
StyleSheet
.
hairlineWidth
,
zIndex
:
1
,
},
}),
},
control
:
{
alignItems
:
'center'
,
justifyContent
:
'center'
,
},
switch
:
{
marginTop
:
5
,
},
})
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