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
c3fd9be0
Commit
c3fd9be0
authored
Jul 07, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加地图旋转角度接口 rotation
parent
37717782
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
5 deletions
+17
-5
AMapViewManager.kt
...src/main/java/cn/qiuxiang/react/amap3d/AMapViewManager.kt
+5
-0
MapView.js
components/MapView.js
+7
-2
AMapView.m
ios/AMapView.m
+4
-3
AMapViewManager.m
ios/AMapViewManager.m
+1
-0
No files found.
android/src/main/java/cn/qiuxiang/react/amap3d/AMapViewManager.kt
View file @
c3fd9be0
...
...
@@ -171,5 +171,10 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() {
view
.
map
.
moveCamera
(
CameraUpdateFactory
.
changeTilt
(
tilt
))
}
@ReactProp
(
name
=
"rotation"
)
fun
changeRotation
(
view
:
AMapView
,
rotation
:
Float
)
{
view
.
map
.
moveCamera
(
CameraUpdateFactory
.
changeBearing
(
rotation
))
}
// todo: 自定义 locationStyle
}
components/MapView.js
View file @
c3fd9be0
...
...
@@ -105,7 +105,12 @@ class MapView extends Component {
limitRegion
:
Region
,
/**
* 设置倾斜角度,取值范围 [0, 60]
* 旋转角度,取值范围 [0, 360]
*/
rotation
:
PropTypes
.
number
,
/**
* 倾斜角度,取值范围 [0, 60]
*/
tilt
:
PropTypes
.
number
,
...
...
@@ -158,7 +163,7 @@ class MapView extends Component {
/**
* 动画过渡到某个位置(坐标、缩放级别、倾斜度)
*
* @param {{zoomLevel: ?number, coordinate: ?LatLng, titl: ?number}} target
* @param {{zoomLevel: ?number, coordinate: ?LatLng, titl: ?number
, rotation: ?number
}} target
* @param duration
*/
animateTo
(
target
,
duration
=
1000
)
{
...
...
ios/AMapView.m
View file @
c3fd9be0
...
...
@@ -28,6 +28,10 @@
super
.
cameraDegree
=
degree
;
}
-
(
void
)
setRotation
:
(
CGFloat
)
degree
{
super
.
rotationDegree
=
degree
;
}
-
(
void
)
insertReactSubview
:
(
id
<
RCTComponent
>
)
subview
atIndex
:
(
NSInteger
)
atIndex
{
[
super
insertReactSubview
:(
UIView
*
)
subview
atIndex
:
atIndex
];
if
([
subview
isKindOfClass
:[
AMapMarker
class
]])
{
...
...
@@ -49,7 +53,4 @@
}
}
-
(
void
)
didUpdateReactSubviews
{
}
@end
ios/AMapViewManager.m
View file @
c3fd9be0
...
...
@@ -43,6 +43,7 @@ RCT_EXPORT_VIEW_PROPERTY(mapType, MAMapType)
RCT_EXPORT_VIEW_PROPERTY
(
coordinate
,
CLLocationCoordinate2D
)
RCT_EXPORT_VIEW_PROPERTY
(
limitRegion
,
MACoordinateRegion
)
RCT_EXPORT_VIEW_PROPERTY
(
tilt
,
CGFloat
)
RCT_EXPORT_VIEW_PROPERTY
(
rotation
,
CGFloat
)
RCT_EXPORT_VIEW_PROPERTY
(
onPress
,
RCTBubblingEventBlock
)
RCT_EXPORT_VIEW_PROPERTY
(
onLongPress
,
RCTBubblingEventBlock
)
...
...
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