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
dd480009
Commit
dd480009
authored
Jul 27, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
onStatusChangeComplete 将同时返回 latitudeDelta 和 longitudeDelta
相关:#18
parent
0307603d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
AMapView.kt
android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt
+6
-0
AMapViewManager.m
ios/AMapViewManager.m
+18
-2
No files found.
android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt
View file @
dd480009
...
...
@@ -113,6 +113,12 @@ class AMapView(context: Context) : MapView(context) {
data
.
putDouble
(
"rotation"
,
it
.
bearing
.
toDouble
())
data
.
putDouble
(
"latitude"
,
it
.
target
.
latitude
)
data
.
putDouble
(
"longitude"
,
it
.
target
.
longitude
)
if
(
event
==
"onCameraChangeFinish"
)
{
val
southwest
=
map
.
projection
.
visibleRegion
.
latLngBounds
.
southwest
val
northeast
=
map
.
projection
.
visibleRegion
.
latLngBounds
.
northeast
data
.
putDouble
(
"latitudeDelta"
,
Math
.
abs
(
southwest
.
latitude
-
northeast
.
latitude
))
data
.
putDouble
(
"longitudeDelta"
,
Math
.
abs
(
southwest
.
longitude
-
northeast
.
longitude
))
}
emit
(
id
,
event
,
data
)
}
}
...
...
ios/AMapViewManager.m
View file @
dd480009
...
...
@@ -162,13 +162,29 @@ RCT_EXPORT_METHOD(animateTo:(nonnull NSNumber *)reactTag params:(NSDictionary *)
-
(
void
)
mapViewRegionChanged
:
(
AMapView
*
)
mapView
{
if
(
mapView
.
onStatusChange
)
{
mapView
.
onStatusChange
([
self
buildStatusData
:
mapView
.
getMapStatus
]);
MAMapStatus
*
status
=
mapView
.
getMapStatus
;
mapView
.
onStatusChange
(@{
@"zoomLevel"
:
@
(
status
.
zoomLevel
),
@"tilt"
:
@
(
status
.
cameraDegree
),
@"rotation"
:
@
(
status
.
rotationDegree
),
@"latitude"
:
@
(
status
.
centerCoordinate
.
latitude
),
@"longitude"
:
@
(
status
.
centerCoordinate
.
longitude
),
});
}
}
-
(
void
)
mapView
:
(
AMapView
*
)
mapView
regionDidChangeAnimated
:
(
BOOL
)
animated
{
if
(
mapView
.
onStatusChangeComplete
)
{
mapView
.
onStatusChangeComplete
([
self
buildStatusData
:
mapView
.
getMapStatus
]);
MAMapStatus
*
status
=
mapView
.
getMapStatus
;
mapView
.
onStatusChangeComplete
(@{
@"zoomLevel"
:
@
(
status
.
zoomLevel
),
@"tilt"
:
@
(
status
.
cameraDegree
),
@"rotation"
:
@
(
status
.
rotationDegree
),
@"latitude"
:
@
(
status
.
centerCoordinate
.
latitude
),
@"longitude"
:
@
(
status
.
centerCoordinate
.
longitude
),
@"latitudeDelta"
:
@
(
mapView
.
region
.
span
.
latitudeDelta
),
@"longitudeDelta"
:
@
(
mapView
.
region
.
span
.
longitudeDelta
),
});
}
}
...
...
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