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
98874aeb
Commit
98874aeb
authored
Aug 20, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化组件代码
parent
1dd57591
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
11 deletions
+5
-11
Marker.js
components/Marker.js
+2
-2
Polyline.js
components/Polyline.js
+2
-8
circle.js
example/src/examples/circle.js
+1
-1
No files found.
components/Marker.js
View file @
98874aeb
import
React
,
{
PropTypes
,
Component
}
from
'react'
import
React
,
{
PropTypes
,
Pure
Component
}
from
'react'
import
{
requireNativeComponent
,
View
,
...
...
@@ -9,7 +9,7 @@ import {
import
{
LatLng
}
from
'./PropTypes'
import
Overlay
from
'./Overlay'
export
default
class
Marker
extends
Component
{
export
default
class
Marker
extends
Pure
Component
{
static
propTypes
=
{
...
ViewPropTypes
,
...
...
components/Polyline.js
View file @
98874aeb
...
...
@@ -65,13 +65,7 @@ export default class Polyline extends PureComponent {
colors
:
[],
}
_handle
(
name
)
{
return
event
=>
{
if
(
this
.
props
[
name
])
{
this
.
props
[
name
](
event
)
}
}
}
_onPress
=
event
=>
this
.
props
.
onPress
&&
this
.
props
.
onPress
(
event
)
render
()
{
const
props
=
{
...
...
@@ -82,7 +76,7 @@ export default class Polyline extends PureComponent {
colors
:
this
.
props
.
colors
.
map
(
processColor
),
},
}),
onPolylineClick
:
this
.
_
handle
(
'onPress'
)
,
onPolylineClick
:
this
.
_
onPress
,
}
return
<
AMapPolyline
{...
props
}
/
>
}
...
...
example/src/examples/circle.js
View file @
98874aeb
import
React
,
{
Component
}
from
'react'
import
{
StyleSheet
,
View
}
from
'react-native'
import
{
StyleSheet
}
from
'react-native'
import
{
MapView
,
Circle
}
from
'react-native-amap3d'
export
default
class
CircleExample
extends
Component
{
...
...
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