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
cca53946
Commit
cca53946
authored
Jun 09, 2017
by
Qiu Xiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加动画事件接口
parent
9a6deb84
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
AMapView.kt
android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt
+2
-2
AMapViewManager.kt
...src/main/java/cn/qiuxiang/react/amap3d/AMapViewManager.kt
+3
-0
MapView.js
components/MapView.js
+10
-0
No files found.
android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt
View file @
cca53946
...
...
@@ -125,11 +125,11 @@ class AMapView(context: ThemedReactContext) : MapView(context) {
val
animateCallback
=
object
:
AMap
.
CancelableCallback
{
override
fun
onCancel
()
{
TODO
(
"not implemented
"
)
emit
(
id
,
"onAnimateCancel
"
)
}
override
fun
onFinish
()
{
TODO
(
"not implemented
"
)
emit
(
id
,
"onAnimateFinish
"
)
}
}
...
...
android/src/main/java/cn/qiuxiang/react/amap3d/AMapViewManager.kt
View file @
cca53946
...
...
@@ -10,6 +10,7 @@ import com.facebook.react.uimanager.ThemedReactContext
import
com.facebook.react.uimanager.ViewGroupManager
import
com.facebook.react.uimanager.annotations.ReactProp
@Suppress
(
"unused"
)
internal
class
AMapViewManager
:
ViewGroupManager
<
AMapView
>()
{
companion
object
{
val
ANIMATE_TO_COORDINATE
=
1
...
...
@@ -56,6 +57,8 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() {
"onMapLoaded"
to
mapOf
(
"registrationName"
to
"onReady"
),
"onMapClick"
to
mapOf
(
"registrationName"
to
"onPress"
),
"onMapLongClick"
to
mapOf
(
"registrationName"
to
"onLongPress"
),
"onAnimateCancel"
to
mapOf
(
"registrationName"
to
"onAnimateCancel"
),
"onAnimateFinish"
to
mapOf
(
"registrationName"
to
"onAnimateFinish"
),
"onLocationChange"
to
mapOf
(
"registrationName"
to
"onLocation"
))
}
...
...
components/MapView.js
View file @
cca53946
...
...
@@ -145,6 +145,16 @@ class MapView extends Component {
* 定位事件
*/
onLocation
:
React
.
PropTypes
.
func
,
/**
* 动画完成事件
*/
onAnimateFinish
:
React
.
PropTypes
.
func
,
/**
* 动画取消事件
*/
onAnimateCancel
:
React
.
PropTypes
.
func
,
}
animateToCoordinate
(
coordinate
,
duration
=
1000
)
{
...
...
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