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
ea90f1ef
Unverified
Commit
ea90f1ef
authored
May 11, 2018
by
7c00
Committed by
GitHub
May 11, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #301 from Qiu800820/master
add locationType(only android)
parents
5e411d6a
a4c4a917
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
+28
-0
AMapView.kt
...d/src/main/java/cn/qiuxiang/react/amap3d/maps/AMapView.kt
+5
-0
AMapViewManager.kt
...ain/java/cn/qiuxiang/react/amap3d/maps/AMapViewManager.kt
+15
-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 @
ea90f1ef
...
@@ -227,4 +227,9 @@ class AMapView(context: Context) : TextureMapView(context) {
...
@@ -227,4 +227,9 @@ class AMapView(context: Context) : TextureMapView(context) {
locationStyle
.
myLocationIcon
(
BitmapDescriptorFactory
.
fromResource
(
drawable
))
locationStyle
.
myLocationIcon
(
BitmapDescriptorFactory
.
fromResource
(
drawable
))
}
}
}
}
fun
setLocationType
(
type
:
Int
)
{
locationStyle
.
myLocationType
(
type
)
map
.
myLocationStyle
=
locationStyle
}
}
}
lib/android/src/main/java/cn/qiuxiang/react/amap3d/maps/AMapViewManager.kt
View file @
ea90f1ef
...
@@ -4,6 +4,7 @@ import android.view.View
...
@@ -4,6 +4,7 @@ import android.view.View
import
com.amap.api.maps.AMap
import
com.amap.api.maps.AMap
import
com.amap.api.maps.CameraUpdateFactory
import
com.amap.api.maps.CameraUpdateFactory
import
com.amap.api.maps.model.LatLng
import
com.amap.api.maps.model.LatLng
import
com.amap.api.maps.model.MyLocationStyle
import
com.facebook.react.bridge.ReadableArray
import
com.facebook.react.bridge.ReadableArray
import
com.facebook.react.bridge.ReadableMap
import
com.facebook.react.bridge.ReadableMap
import
com.facebook.react.common.MapBuilder
import
com.facebook.react.common.MapBuilder
...
@@ -194,4 +195,18 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() {
...
@@ -194,4 +195,18 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() {
fun
setLocationStyle
(
view
:
AMapView
,
style
:
ReadableMap
)
{
fun
setLocationStyle
(
view
:
AMapView
,
style
:
ReadableMap
)
{
view
.
setLocationStyle
(
style
)
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 @
ea90f1ef
...
@@ -39,6 +39,14 @@ export default class MapView extends Component<any> {
...
@@ -39,6 +39,14 @@ export default class MapView extends Component<any> {
*/
*/
locationStyle
:
LocationStyle
,
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