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
fe76f486
Commit
fe76f486
authored
May 09, 2018
by
sen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加LocationType only Android
parent
5e411d6a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
AMapView.kt
...d/src/main/java/cn/qiuxiang/react/amap3d/maps/AMapView.kt
+4
-0
AMapViewManager.kt
...ain/java/cn/qiuxiang/react/amap3d/maps/AMapViewManager.kt
+14
-0
MapView.js
lib/js/maps/MapView.js
+8
-0
No files found.
lib/android/src/main/java/cn/qiuxiang/react/amap3d/maps/AMapView.kt
View file @
fe76f486
...
...
@@ -227,4 +227,8 @@ class AMapView(context: Context) : TextureMapView(context) {
locationStyle
.
myLocationIcon
(
BitmapDescriptorFactory
.
fromResource
(
drawable
))
}
}
fun
setLocationType
(
type
:
Int
)
{
locationStyle
.
myLocationType
(
type
)
}
}
lib/android/src/main/java/cn/qiuxiang/react/amap3d/maps/AMapViewManager.kt
View file @
fe76f486
...
...
@@ -194,4 +194,18 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() {
fun
setLocationStyle
(
view
:
AMapView
,
style
:
ReadableMap
)
{
view
.
setLocationStyle
(
style
)
}
@ReactProp
(
name
=
"locationType"
)
fun
setLocationStyle
(
view
:
AMapView
,
type
:
String
)
{
when
(
type
)
{
"show"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_SHOW
)
"locate"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_LOCATE
)
"follow"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_FOLLOW
)
"map_rotate"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_MAP_ROTATE
)
"location_rotate"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_LOCATION_ROTATE
)
"location_rotate_no_center"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER
)
"follow_no_center"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_FOLLOW_NO_CENTER
)
"map_rotate_no_center"
->
view
.
setLocationType
(
MyLocationStyle
.
LOCATION_TYPE_MAP_ROTATE_NO_CENTER
)
}
}
}
lib/js/maps/MapView.js
View file @
fe76f486
...
...
@@ -39,6 +39,14 @@ export default class MapView extends Component<any> {
*/
locationStyle
:
LocationStyle
,
/**
* 设置定位模式 默认 LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER
*
* @platform android
*/
locationType
:
PropTypes
.
oneOf
([
'show'
,
'locate'
,
'follow'
,
'map_rotate'
,
'location_rotate'
,
'location_rotate_no_center'
,
'follow_no_center'
,
'map_rotate_no_center'
]),
/**
* 是否启用定位
*/
...
...
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