mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 17:54:48 +00:00
[madman] map - fix bug that onRegionChangeComplete stopped emitting
This commit is contained in:
parent
7141948a05
commit
7b4ea51bf0
@ -21,7 +21,7 @@ extern const CGFloat RCTMapZoomBoundBuffer;
|
||||
@interface RCTMap: MKMapView
|
||||
|
||||
@property (nonatomic, assign) BOOL followUserLocation;
|
||||
@property (nonatomic, assign) BOOL hasStartedLoading;
|
||||
@property (nonatomic, assign) BOOL hasStartedRendering;
|
||||
@property (nonatomic, assign) CGFloat minDelta;
|
||||
@property (nonatomic, assign) CGFloat maxDelta;
|
||||
@property (nonatomic, assign) UIEdgeInsets legalLabelInsets;
|
||||
|
@ -27,7 +27,7 @@ const CGFloat RCTMapZoomBoundBuffer = 0.01;
|
||||
{
|
||||
if ((self = [super init])) {
|
||||
|
||||
_hasStartedLoading = NO;
|
||||
_hasStartedRendering = NO;
|
||||
|
||||
// Find Apple link label
|
||||
for (UIView *subview in self.subviews) {
|
||||
|
@ -84,15 +84,15 @@ RCT_CUSTOM_VIEW_PROPERTY(region, MKCoordinateRegion, RCTMap)
|
||||
[self _regionChanged:mapView];
|
||||
|
||||
// Don't send region did change events until map has
|
||||
// started loading, as these won't represent the final location
|
||||
if (mapView.hasStartedLoading) {
|
||||
// started rendering, as these won't represent the final location
|
||||
if (mapView.hasStartedRendering) {
|
||||
[self _emitRegionChangeEvent:mapView continuous:NO];
|
||||
};
|
||||
}
|
||||
|
||||
- (void)mapViewWillStartLoadingMap:(RCTMap *)mapView
|
||||
- (void)mapViewWillStartRenderingMap:(RCTMap *)mapView
|
||||
{
|
||||
mapView.hasStartedLoading = YES;
|
||||
mapView.hasStartedRendering = YES;
|
||||
[self _emitRegionChangeEvent:mapView continuous:NO];
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user