Loading android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -125,11 +125,11 @@ class AMapView(context: ThemedReactContext) : MapView(context) { val animateCallback = object: AMap.CancelableCallback { val animateCallback = object: AMap.CancelableCallback { override fun onCancel() { override fun onCancel() { TODO("not implemented") emit(id, "onAnimateCancel") } } override fun onFinish() { override fun onFinish() { TODO("not implemented") emit(id, "onAnimateFinish") } } } } Loading android/src/main/java/cn/qiuxiang/react/amap3d/AMapViewManager.kt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -10,6 +10,7 @@ import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.ViewGroupManager import com.facebook.react.uimanager.ViewGroupManager import com.facebook.react.uimanager.annotations.ReactProp import com.facebook.react.uimanager.annotations.ReactProp @Suppress("unused") internal class AMapViewManager : ViewGroupManager<AMapView>() { internal class AMapViewManager : ViewGroupManager<AMapView>() { companion object { companion object { val ANIMATE_TO_COORDINATE = 1 val ANIMATE_TO_COORDINATE = 1 Loading Loading @@ -56,6 +57,8 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() { "onMapLoaded" to mapOf("registrationName" to "onReady"), "onMapLoaded" to mapOf("registrationName" to "onReady"), "onMapClick" to mapOf("registrationName" to "onPress"), "onMapClick" to mapOf("registrationName" to "onPress"), "onMapLongClick" to mapOf("registrationName" to "onLongPress"), "onMapLongClick" to mapOf("registrationName" to "onLongPress"), "onAnimateCancel" to mapOf("registrationName" to "onAnimateCancel"), "onAnimateFinish" to mapOf("registrationName" to "onAnimateFinish"), "onLocationChange" to mapOf("registrationName" to "onLocation")) "onLocationChange" to mapOf("registrationName" to "onLocation")) } } Loading components/MapView.js +10 −0 Original line number Original line Diff line number Diff line Loading @@ -145,6 +145,16 @@ class MapView extends Component { * 定位事件 * 定位事件 */ */ onLocation: React.PropTypes.func, onLocation: React.PropTypes.func, /** * 动画完成事件 */ onAnimateFinish: React.PropTypes.func, /** * 动画取消事件 */ onAnimateCancel: React.PropTypes.func, } } animateToCoordinate(coordinate, duration = 1000) { animateToCoordinate(coordinate, duration = 1000) { Loading Loading
android/src/main/java/cn/qiuxiang/react/amap3d/AMapView.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -125,11 +125,11 @@ class AMapView(context: ThemedReactContext) : MapView(context) { val animateCallback = object: AMap.CancelableCallback { val animateCallback = object: AMap.CancelableCallback { override fun onCancel() { override fun onCancel() { TODO("not implemented") emit(id, "onAnimateCancel") } } override fun onFinish() { override fun onFinish() { TODO("not implemented") emit(id, "onAnimateFinish") } } } } Loading
android/src/main/java/cn/qiuxiang/react/amap3d/AMapViewManager.kt +3 −0 Original line number Original line Diff line number Diff line Loading @@ -10,6 +10,7 @@ import com.facebook.react.uimanager.ThemedReactContext import com.facebook.react.uimanager.ViewGroupManager import com.facebook.react.uimanager.ViewGroupManager import com.facebook.react.uimanager.annotations.ReactProp import com.facebook.react.uimanager.annotations.ReactProp @Suppress("unused") internal class AMapViewManager : ViewGroupManager<AMapView>() { internal class AMapViewManager : ViewGroupManager<AMapView>() { companion object { companion object { val ANIMATE_TO_COORDINATE = 1 val ANIMATE_TO_COORDINATE = 1 Loading Loading @@ -56,6 +57,8 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() { "onMapLoaded" to mapOf("registrationName" to "onReady"), "onMapLoaded" to mapOf("registrationName" to "onReady"), "onMapClick" to mapOf("registrationName" to "onPress"), "onMapClick" to mapOf("registrationName" to "onPress"), "onMapLongClick" to mapOf("registrationName" to "onLongPress"), "onMapLongClick" to mapOf("registrationName" to "onLongPress"), "onAnimateCancel" to mapOf("registrationName" to "onAnimateCancel"), "onAnimateFinish" to mapOf("registrationName" to "onAnimateFinish"), "onLocationChange" to mapOf("registrationName" to "onLocation")) "onLocationChange" to mapOf("registrationName" to "onLocation")) } } Loading
components/MapView.js +10 −0 Original line number Original line Diff line number Diff line Loading @@ -145,6 +145,16 @@ class MapView extends Component { * 定位事件 * 定位事件 */ */ onLocation: React.PropTypes.func, onLocation: React.PropTypes.func, /** * 动画完成事件 */ onAnimateFinish: React.PropTypes.func, /** * 动画取消事件 */ onAnimateCancel: React.PropTypes.func, } } animateToCoordinate(coordinate, duration = 1000) { animateToCoordinate(coordinate, duration = 1000) { Loading