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
8608af77
Commit
8608af77
authored
Jun 21, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新 js 组件
parent
7972a42a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
33 deletions
+21
-33
MapView.js
components/MapView.js
+1
-8
Marker.js
components/Marker.js
+12
-8
Polyline.js
components/Polyline.js
+7
-3
polyline.js
example/src/examples/polyline.js
+1
-14
No files found.
components/MapView.js
View file @
8608af77
...
@@ -7,7 +7,6 @@ import {
...
@@ -7,7 +7,6 @@ import {
}
from
'react-native'
}
from
'react-native'
import
{
LatLng
}
from
'./PropTypes'
import
{
LatLng
}
from
'./PropTypes'
import
Marker
from
'./Marker'
import
Marker
from
'./Marker'
import
InfoWindow
from
'./InfoWindow'
import
Overlay
from
'./Overlay'
import
Overlay
from
'./Overlay'
import
Polyline
from
'./Polyline'
import
Polyline
from
'./Polyline'
import
Polygon
from
'./Polygon'
import
Polygon
from
'./Polygon'
...
@@ -123,11 +122,6 @@ class MapView extends Component {
...
@@ -123,11 +122,6 @@ class MapView extends Component {
*/
*/
tiltEnabled
:
PropTypes
.
bool
,
tiltEnabled
:
PropTypes
.
bool
,
/**
* 地图加载完毕事件
*/
onReady
:
React
.
PropTypes
.
func
,
/**
/**
* 点击事件
* 点击事件
*/
*/
...
@@ -176,7 +170,6 @@ class MapView extends Component {
...
@@ -176,7 +170,6 @@ class MapView extends Component {
static
Marker
=
Marker
static
Marker
=
Marker
static
Overlay
=
Overlay
static
Overlay
=
Overlay
static
InfoWindow
=
InfoWindow
static
Polyline
=
Polyline
static
Polyline
=
Polyline
static
Polygon
=
Polygon
static
Polygon
=
Polygon
static
Circle
=
Circle
static
Circle
=
Circle
...
@@ -185,4 +178,4 @@ class MapView extends Component {
...
@@ -185,4 +178,4 @@ class MapView extends Component {
AMapView
=
requireNativeComponent
(
'AMapView'
,
MapView
)
AMapView
=
requireNativeComponent
(
'AMapView'
,
MapView
)
export
default
MapView
export
default
MapView
export
{
MapView
,
Marker
,
InfoWindow
,
Overlay
,
Polyline
,
Polygon
,
Circle
}
export
{
MapView
,
Marker
,
Overlay
,
Polyline
,
Polygon
,
Circle
}
components/Marker.js
View file @
8608af77
import
React
,
{
PropTypes
,
Component
}
from
'react'
import
React
,
{
PropTypes
,
Component
}
from
'react'
import
{
requireNativeComponent
,
View
,
P
ixelRatio
,
Platform
}
from
'react-native'
import
{
requireNativeComponent
,
View
,
P
latform
,
StyleSheet
}
from
'react-native'
import
{
LatLng
}
from
'./PropTypes'
import
{
LatLng
}
from
'./PropTypes'
import
InfoWindow
from
'./InfoWindow
'
import
Overlay
from
'./Overlay
'
class
Marker
extends
Component
{
export
default
class
Marker
extends
Component
{
static
propTypes
=
{
static
propTypes
=
{
...
View
.
propTypes
,
...
View
.
propTypes
,
...
@@ -111,15 +111,15 @@ class Marker extends Component {
...
@@ -111,15 +111,15 @@ class Marker extends Component {
})
})
}
}
let
customInfoWindow
=
null
let
customInfoWindow
=
<
View
collapsable
=
{
false
}
/
>
let
customMarker
=
null
let
customMarker
=
<
View
collapsable
=
{
false
}
/
>
if
(
props
.
children
)
{
if
(
props
.
children
)
{
customInfoWindow
=
props
.
children
customInfoWindow
=
<
Overlay
style
=
{
styles
.
overlay
}
>
{
props
.
children
}
<
/Overlay
>
}
}
if
(
typeof
props
.
icon
===
'function'
)
{
if
(
typeof
props
.
icon
===
'function'
)
{
customMarker
=
props
.
icon
()
customMarker
=
<
Overlay
style
=
{
styles
.
overlay
}
>
{
props
.
icon
()}
<
/Overlay
>
delete
props
.
icon
delete
props
.
icon
}
}
...
@@ -132,4 +132,8 @@ class Marker extends Component {
...
@@ -132,4 +132,8 @@ class Marker extends Component {
AMapMarker
=
requireNativeComponent
(
'AMapMarker'
,
Marker
)
AMapMarker
=
requireNativeComponent
(
'AMapMarker'
,
Marker
)
export
default
Marker
const
styles
=
StyleSheet
.
create
({
overlay
:
{
position
:
'absolute'
,
},
})
components/Polyline.js
View file @
8608af77
import
React
,
{
PropTypes
,
Component
}
from
'react'
import
React
,
{
PropTypes
,
Component
}
from
'react'
import
{
processColor
,
requireNativeComponent
,
View
,
PixelRatio
}
from
'react-native'
import
{
processColor
,
requireNativeComponent
,
View
,
PixelRatio
,
Platform
}
from
'react-native'
import
{
LatLng
}
from
'./PropTypes'
import
{
LatLng
}
from
'./PropTypes'
class
Polyline
extends
Component
{
class
Polyline
extends
Component
{
...
@@ -33,7 +33,7 @@ class Polyline extends Component {
...
@@ -33,7 +33,7 @@ class Polyline extends Component {
/**
/**
* 是否绘制虚线
* 是否绘制虚线
*/
*/
d
ottedLine
:
PropTypes
.
bool
,
d
ashed
:
PropTypes
.
bool
,
/**
/**
* 点击事件
* 点击事件
...
@@ -56,7 +56,11 @@ class Polyline extends Component {
...
@@ -56,7 +56,11 @@ class Polyline extends Component {
render
()
{
render
()
{
const
props
=
{
const
props
=
{
...
this
.
props
,
...
this
.
props
,
width
:
PixelRatio
.
getPixelSizeForLayoutSize
(
this
.
props
.
width
),
...
Platform
.
select
({
android
:
{
width
:
PixelRatio
.
getPixelSizeForLayoutSize
(
this
.
props
.
width
),
},
}),
colors
:
this
.
props
.
colors
.
map
(
processColor
),
colors
:
this
.
props
.
colors
.
map
(
processColor
),
onPolylineClick
:
this
.
_handle
(
'onPress'
),
onPolylineClick
:
this
.
_handle
(
'onPress'
),
}
}
...
...
example/src/examples/polyline.js
View file @
8608af77
...
@@ -9,18 +9,6 @@ export default class PolylineExample extends Component {
...
@@ -9,18 +9,6 @@ export default class PolylineExample extends Component {
render
()
{
render
()
{
return
<
MapView
style
=
{
StyleSheet
.
absoluteFill
}
>
return
<
MapView
style
=
{
StyleSheet
.
absoluteFill
}
>
<
Polyline
width
=
{
5
}
coordinates
=
{[
{
latitude
:
40.106901
,
longitude
:
116.097972
,
},
{
latitude
:
40.106901
,
longitude
:
116.597972
,
},
]}
/
>
<
Polyline
<
Polyline
width
=
{
5
}
width
=
{
5
}
color
=
'red'
color
=
'red'
...
@@ -35,7 +23,7 @@ export default class PolylineExample extends Component {
...
@@ -35,7 +23,7 @@ export default class PolylineExample extends Component {
},
},
]}
/
>
]}
/
>
<
Polyline
<
Polyline
d
ottedLine
d
ashed
width
=
{
5
}
width
=
{
5
}
coordinates
=
{[
coordinates
=
{[
{
{
...
@@ -50,7 +38,6 @@ export default class PolylineExample extends Component {
...
@@ -50,7 +38,6 @@ export default class PolylineExample extends Component {
<
Polyline
<
Polyline
gradient
gradient
width
=
{
5
}
width
=
{
5
}
color
=
'blue'
colors
=
{[
'#f44336'
,
'#2196f3'
,
'#4caf50'
]}
colors
=
{[
'#f44336'
,
'#2196f3'
,
'#4caf50'
]}
onPress
=
{()
=>
Alert
.
alert
(
'onPress'
)}
onPress
=
{()
=>
Alert
.
alert
(
'onPress'
)}
coordinates
=
{[
coordinates
=
{[
...
...
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