[catlyst|madman] make map fire onRegionChange for user zoom in/out again

This commit is contained in:
Jiajie Zhu
2015-04-21 10:19:18 -07:00
parent ee898c24c7
commit 2294da777c

View File

@@ -67,15 +67,13 @@ RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, RCTMap)
{ {
[self _regionChanged:mapView]; [self _regionChanged:mapView];
if (animated) { mapView.regionChangeObserveTimer = [NSTimer timerWithTimeInterval:RCTMapRegionChangeObserveInterval
mapView.regionChangeObserveTimer = [NSTimer timerWithTimeInterval:RCTMapRegionChangeObserveInterval target:self
target:self selector:@selector(_onTick:)
selector:@selector(_onTick:) userInfo:@{ RCTMapViewKey: mapView }
userInfo:@{ RCTMapViewKey: mapView } repeats:YES];
repeats:YES];
[[NSRunLoop mainRunLoop] addTimer:mapView.regionChangeObserveTimer forMode:NSRunLoopCommonModes]; [[NSRunLoop mainRunLoop] addTimer:mapView.regionChangeObserveTimer forMode:NSRunLoopCommonModes];
}
} }
- (void)mapView:(RCTMap *)mapView regionDidChangeAnimated:(BOOL)animated - (void)mapView:(RCTMap *)mapView regionDidChangeAnimated:(BOOL)animated