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
5de8ae18
Commit
5de8ae18
authored
May 27, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化 MapView 封装
parent
5a07eb3a
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
17 deletions
+24
-17
controls.js
example/src/controls.js
+2
-2
gestures.js
example/src/gestures.js
+2
-2
indoor.js
example/src/indoor.js
+3
-3
layers.js
example/src/layers.js
+2
-2
map-types.js
example/src/map-types.js
+2
-2
index.js
index.js
+13
-6
No files found.
example/src/controls.js
View file @
5de8ae18
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
A
MapView
from
'react-native-amap3d'
import
MapView
from
'react-native-amap3d'
export
default
class
Controls
extends
Component
{
export
default
class
Controls
extends
Component
{
static
navigationOptions
=
{
static
navigationOptions
=
{
...
@@ -42,7 +42,7 @@ export default class Controls extends Component {
...
@@ -42,7 +42,7 @@ export default class Controls extends Component {
value
=
{
this
.
state
.
showsZoomControls
}
/
>
value
=
{
this
.
state
.
showsZoomControls
}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
A
MapView
<
MapView
showsUserLocation
=
{
true
}
showsUserLocation
=
{
true
}
showsCompass
=
{
this
.
state
.
showsCompass
}
showsCompass
=
{
this
.
state
.
showsCompass
}
showsScale
=
{
this
.
state
.
showsScale
}
showsScale
=
{
this
.
state
.
showsScale
}
...
...
example/src/gestures.js
View file @
5de8ae18
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
A
MapView
from
'react-native-amap3d'
import
MapView
from
'react-native-amap3d'
export
default
class
Gestures
extends
Component
{
export
default
class
Gestures
extends
Component
{
static
navigationOptions
=
{
static
navigationOptions
=
{
...
@@ -42,7 +42,7 @@ export default class Gestures extends Component {
...
@@ -42,7 +42,7 @@ export default class Gestures extends Component {
value
=
{
this
.
state
.
tiltEnabled
}
/
>
value
=
{
this
.
state
.
tiltEnabled
}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
A
MapView
<
MapView
zoomEnabled
=
{
this
.
state
.
zoomEnabled
}
zoomEnabled
=
{
this
.
state
.
zoomEnabled
}
scrollEnabled
=
{
this
.
state
.
scrollEnabled
}
scrollEnabled
=
{
this
.
state
.
scrollEnabled
}
rotateEnabled
=
{
this
.
state
.
rotateEnabled
}
rotateEnabled
=
{
this
.
state
.
rotateEnabled
}
...
...
example/src/indoor.js
View file @
5de8ae18
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
{
StyleSheet
}
from
'react-native'
import
A
MapView
from
'react-native-amap3d'
import
MapView
from
'react-native-amap3d'
export
default
class
Indoor
extends
Component
{
export
default
class
Indoor
extends
Component
{
static
navigationOptions
=
{
static
navigationOptions
=
{
...
@@ -8,7 +8,7 @@ export default class Indoor extends Component {
...
@@ -8,7 +8,7 @@ export default class Indoor extends Component {
}
}
render
()
{
render
()
{
return
<
A
MapView
return
<
MapView
showsIndoorMap
=
{
true
}
showsIndoorMap
=
{
true
}
showsIndoorSwitch
=
{
true
}
showsIndoorSwitch
=
{
true
}
style
=
{
StyleSheet
.
absoluteFill
}
/
>
style
=
{
StyleSheet
.
absoluteFill
}
/
>
...
...
example/src/layers.js
View file @
5de8ae18
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
{
StyleSheet
,
View
,
Text
,
Switch
}
from
'react-native'
import
A
MapView
from
'react-native-amap3d'
import
MapView
from
'react-native-amap3d'
export
default
class
Layers
extends
Component
{
export
default
class
Layers
extends
Component
{
static
navigationOptions
=
{
static
navigationOptions
=
{
...
@@ -35,7 +35,7 @@ export default class Layers extends Component {
...
@@ -35,7 +35,7 @@ export default class Layers extends Component {
value
=
{
this
.
state
.
showsMapText
}
/
>
value
=
{
this
.
state
.
showsMapText
}
/
>
<
/View
>
<
/View
>
<
/View
>
<
/View
>
<
A
MapView
<
MapView
zoomLevel
=
{
17
}
zoomLevel
=
{
17
}
showsMapText
=
{
this
.
state
.
showsMapText
}
showsMapText
=
{
this
.
state
.
showsMapText
}
showsTraffic
=
{
this
.
state
.
showsTraffic
}
showsTraffic
=
{
this
.
state
.
showsTraffic
}
...
...
example/src/map-types.js
View file @
5de8ae18
import
React
,
{
Component
}
from
'react'
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
Picker
}
from
'react-native'
import
{
StyleSheet
,
Picker
}
from
'react-native'
import
A
MapView
from
'react-native-amap3d'
import
MapView
from
'react-native-amap3d'
export
default
class
MapTypes
extends
Component
{
export
default
class
MapTypes
extends
Component
{
static
navigationOptions
=
({
navigation
})
=>
{
static
navigationOptions
=
({
navigation
})
=>
{
...
@@ -21,7 +21,7 @@ export default class MapTypes extends Component {
...
@@ -21,7 +21,7 @@ export default class MapTypes extends Component {
}
}
render
()
{
render
()
{
return
<
A
MapView
return
<
MapView
mapType
=
{
this
.
props
.
navigation
.
state
.
params
.
mapType
}
mapType
=
{
this
.
props
.
navigation
.
state
.
params
.
mapType
}
style
=
{
StyleSheet
.
absoluteFill
}
/
>
style
=
{
StyleSheet
.
absoluteFill
}
/
>
}
}
...
...
index.js
View file @
5de8ae18
import
{
PropTypes
}
from
'react'
import
React
,
{
PropTypes
,
Component
}
from
'react'
import
{
requireNativeComponent
,
View
}
from
'react-native'
import
{
requireNativeComponent
,
View
}
from
'react-native'
export
default
requireNativeComponent
(
'AMapView'
,
{
class
MapView
extends
Component
{
name
:
'AMapView'
,
static
propTypes
=
{
propTypes
:
{
...
View
.
propTypes
,
...
View
.
propTypes
,
showsUserLocation
:
PropTypes
.
bool
,
showsUserLocation
:
PropTypes
.
bool
,
showsIndoorMap
:
PropTypes
.
bool
,
showsIndoorMap
:
PropTypes
.
bool
,
...
@@ -24,6 +23,14 @@ export default requireNativeComponent('AMapView', {
...
@@ -24,6 +23,14 @@ export default requireNativeComponent('AMapView', {
scrollEnabled
:
PropTypes
.
bool
,
scrollEnabled
:
PropTypes
.
bool
,
rotateEnabled
:
PropTypes
.
bool
,
rotateEnabled
:
PropTypes
.
bool
,
tiltEnabled
:
PropTypes
.
bool
,
tiltEnabled
:
PropTypes
.
bool
,
},
}
})
render
()
{
return
<
AMapView
{...
this
.
props
}
/
>
}
}
AMapView
=
requireNativeComponent
(
'AMapView'
,
MapView
)
export
default
MapView
export
{
MapView
}
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