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
9688deed
Commit
9688deed
authored
Nov 24, 2017
by
7c00
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定位新增返回速度、时间戳、海拔数据
parent
9dfeeddc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
AMapView.kt
...d/src/main/java/cn/qiuxiang/react/amap3d/maps/AMapView.kt
+3
-0
AMapViewManager.m
ios/maps/AMapViewManager.m
+4
-1
No files found.
android/src/main/java/cn/qiuxiang/react/amap3d/maps/AMapView.kt
View file @
9688deed
...
...
@@ -50,6 +50,9 @@ class AMapView(context: Context) : TextureMapView(context) {
event
.
putDouble
(
"latitude"
,
location
.
latitude
)
event
.
putDouble
(
"longitude"
,
location
.
longitude
)
event
.
putDouble
(
"accuracy"
,
location
.
accuracy
.
toDouble
())
event
.
putDouble
(
"altitude"
,
location
.
altitude
)
event
.
putDouble
(
"speed"
,
location
.
speed
.
toDouble
())
event
.
putInt
(
"timestamp"
,
location
.
time
.
toInt
())
emit
(
id
,
"onLocation"
,
event
)
}
...
...
ios/maps/AMapViewManager.m
View file @
9688deed
...
...
@@ -98,6 +98,9 @@ RCT_EXPORT_METHOD(animateTo:(nonnull NSNumber *)reactTag params:(NSDictionary *)
@"latitude"
:
@
(
userLocation
.
coordinate
.
latitude
),
@"longitude"
:
@
(
userLocation
.
coordinate
.
longitude
),
@"accuracy"
:
@
((
userLocation
.
location
.
horizontalAccuracy
+
userLocation
.
location
.
verticalAccuracy
)
/
2
),
@"altitude"
:
@
(
userLocation
.
location
.
altitude
),
@"speed"
:
@
(
userLocation
.
location
.
speed
),
@"timestamp"
:
@
(
userLocation
.
location
.
timestamp
.
timeIntervalSince1970
),
});
}
}
...
...
@@ -194,7 +197,7 @@ RCT_EXPORT_METHOD(animateTo:(nonnull NSNumber *)reactTag params:(NSDictionary *)
mapView
.
loaded
=
YES
;
// struct 里的值会被初始化为 0,这里以此作为条件,判断 initialRegion 是否被设置过
// 但实际上经度为 0 是一个合法的坐标
(赤道)
,只是考虑到高德地图只在中国使用,就这样吧
// 但实际上经度为 0 是一个合法的坐标,只是考虑到高德地图只在中国使用,就这样吧
if
(
mapView
.
initialRegion
.
center
.
latitude
!=
0
)
{
mapView
.
region
=
mapView
.
initialRegion
;
}
...
...
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