Commit 7972a42a authored by Qiu Xiang's avatar Qiu Xiang

移除 onReady 事件接口

parent 6643b286
...@@ -28,10 +28,6 @@ class AMapView(context: ThemedReactContext) : MapView(context) { ...@@ -28,10 +28,6 @@ class AMapView(context: ThemedReactContext) : MapView(context) {
locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER) locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER)
map.myLocationStyle = locationStyle map.myLocationStyle = locationStyle
map.setOnMapLoadedListener {
emit(id, "onMapLoaded")
}
map.setOnMapClickListener { latLng -> map.setOnMapClickListener { latLng ->
val event = Arguments.createMap() val event = Arguments.createMap()
event.putDouble("latitude", latLng.latitude) event.putDouble("latitude", latLng.latitude)
......
...@@ -55,7 +55,6 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() { ...@@ -55,7 +55,6 @@ internal class AMapViewManager : ViewGroupManager<AMapView>() {
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> { override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> {
return mapOf( return mapOf(
"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"), "onAnimateCancel" to mapOf("registrationName" to "onAnimateCancel"),
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
@interface AMapView : MAMapView @interface AMapView : MAMapView
@property(nonatomic, copy) RCTBubblingEventBlock onReady;
@property(nonatomic, copy) RCTBubblingEventBlock onLocation; @property(nonatomic, copy) RCTBubblingEventBlock onLocation;
@property(nonatomic, copy) RCTBubblingEventBlock onPress; @property(nonatomic, copy) RCTBubblingEventBlock onPress;
@property(nonatomic, copy) RCTBubblingEventBlock onLongPress; @property(nonatomic, copy) RCTBubblingEventBlock onLongPress;
......
...@@ -41,17 +41,10 @@ RCT_EXPORT_VIEW_PROPERTY(mapType, MAMapType) ...@@ -41,17 +41,10 @@ RCT_EXPORT_VIEW_PROPERTY(mapType, MAMapType)
RCT_EXPORT_VIEW_PROPERTY(coordinate, CLLocationCoordinate2D) RCT_EXPORT_VIEW_PROPERTY(coordinate, CLLocationCoordinate2D)
RCT_EXPORT_VIEW_PROPERTY(tilt, CGFloat) RCT_EXPORT_VIEW_PROPERTY(tilt, CGFloat)
RCT_EXPORT_VIEW_PROPERTY(onReady, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
RCT_EXPORT_VIEW_PROPERTY(onLocation, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(onLocation, RCTBubblingEventBlock)
- (void)mapInitComplete:(AMapView *)mapView {
if (mapView.onReady) {
mapView.onReady(@{});
}
}
- (void)mapView:(AMapView *)mapView didSingleTappedAtCoordinate:(CLLocationCoordinate2D)coordinate { - (void)mapView:(AMapView *)mapView didSingleTappedAtCoordinate:(CLLocationCoordinate2D)coordinate {
if (mapView.onPress) { if (mapView.onPress) {
mapView.onPress(@{ mapView.onPress(@{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment