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
8d35f57c
Commit
8d35f57c
authored
Jul 09, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加地图事件示例
parent
dc07b1b2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
0 deletions
+67
-0
app.js
example/src/app.js
+2
-0
examples.js
example/src/examples.js
+2
-0
events.js
example/src/examples/events.js
+63
-0
No files found.
example/src/app.js
View file @
8d35f57c
...
...
@@ -11,6 +11,7 @@ import Marker from './examples/marker'
import
Polyline
from
'./examples/polyline'
import
Polygon
from
'./examples/polygon'
import
Circle
from
'./examples/circle'
import
Events
from
'./examples/events'
export
default
StackNavigator
({
Examples
:
{
screen
:
Examples
},
...
...
@@ -24,6 +25,7 @@ export default StackNavigator({
Polyline
:
{
screen
:
Polyline
},
Polygon
:
{
screen
:
Polygon
},
Circle
:
{
screen
:
Circle
},
Events
:
{
screen
:
Events
},
},
{
navigationOptions
:
{
headerTintColor
:
'#212121'
,
...
...
example/src/examples.js
View file @
8d35f57c
...
...
@@ -43,6 +43,8 @@ export default class Examples extends Component {
{
this
.
_renderItem
(
'手势交互'
,
'Gestures'
)}
<
View
style
=
{
styles
.
separator
}
/
>
{
this
.
_renderItem
(
'动画移动'
,
'Animated'
)}
<
View
style
=
{
styles
.
separator
}
/
>
{
this
.
_renderItem
(
'地图事件'
,
'Events'
)}
<
/View
>
<
View
style
=
{
styles
.
group
}
>
{
this
.
_renderItem
(
'添加标记'
,
'Marker'
)}
...
...
example/src/examples/events.js
0 → 100644
View file @
8d35f57c
import
React
,
{
Component
}
from
'react'
import
{
View
,
Text
,
ScrollView
,
StyleSheet
,
}
from
'react-native'
import
MapView
from
'react-native-amap3d'
export
default
class
Events
extends
Component
{
static
navigationOptions
=
{
title
:
'地图事件'
,
}
state
=
{
logs
:
[],
}
_log
(
event
,
data
)
{
this
.
setState
({
logs
:
[
{
key
:
Math
.
random
(),
time
:
new
Date
().
toLocaleString
(),
event
:
event
,
data
:
JSON
.
stringify
(
data
,
null
,
2
),
},
...
this
.
state
.
logs
,
],
})
}
render
()
{
return
<
View
style
=
{
styles
.
body
}
>
<
MapView
locationEnabled
onPress
=
{({
nativeEvent
})
=>
this
.
_log
(
'onPress'
,
nativeEvent
)}
onLongPress
=
{({
nativeEvent
})
=>
this
.
_log
(
'onLongPress'
,
nativeEvent
)}
onLocation
=
{({
nativeEvent
})
=>
this
.
_log
(
'onLocation'
,
nativeEvent
)}
style
=
{
styles
.
body
}
/
>
<
ScrollView
contentContainerStyle
=
{
styles
.
log
}
>
{
this
.
state
.
logs
.
map
(
item
=>
<
Text
key
=
{
item
.
key
}
style
=
{
styles
.
logText
}
>
{
item
.
time
}
{
item
.
event
}:
{
item
.
data
}
<
/Text
>
)}
<
/ScrollView
>
<
/View
>
}
}
const
styles
=
StyleSheet
.
create
({
body
:
{
flex
:
1
,
backgroundColor
:
'#fff'
,
},
log
:
{
padding
:
10
,
},
logText
:
{
marginBottom
:
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