Commit d502d661 authored by Qiu Xiang's avatar Qiu Xiang

调整 iOS animateTo 参数 duration 的传递

parent c20f3f86
......@@ -170,7 +170,6 @@ class MapView extends Component {
)
break;
case 'ios':
params[1] = 300
NativeModules.AMapViewManager[command](findNodeHandle(this), params)
break;
}
......
......@@ -49,7 +49,6 @@ RCT_EXPORT_METHOD(animateTo:(nonnull NSNumber *)reactTag data:(NSArray *)data) {
[self.bridge.uiManager addUIBlock:^(__unused RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) {
AMapView *mapView = (AMapView *) viewRegistry[reactTag];
NSDictionary *params = data[0];
CFTimeInterval duration = [data[1] doubleValue] / 1000;
if (params[@"zoomLevel"]) {
[mapView setZoomLevel:[params[@"zoomLevel"] floatValue] animated: YES];
}
......@@ -60,7 +59,7 @@ RCT_EXPORT_METHOD(animateTo:(nonnull NSNumber *)reactTag data:(NSArray *)data) {
[coordinate[@"longitude"] doubleValue]) animated:YES];
}
if (params[@"tilt"]) {
[mapView setCameraDegree:[params[@"tilt"] floatValue] animated:YES duration:duration];
[mapView setCameraDegree:[params[@"tilt"] floatValue] animated:YES duration:0.3];
}
}];
}
......
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