[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
1 changed files with 6 additions and 8 deletions

View File

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