Skip to content

Commit

Permalink
Merge pull request nitaliano#208 from innovactorybv/ios-camera-center…
Browse files Browse the repository at this point in the history
…-fix

Fixed bug where camera moves to incorrect position on physical iOS devices
  • Loading branch information
mattijsf authored Jul 5, 2019
2 parents f55f0b7 + 7fb74d3 commit 1e88617
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ios/RCTMGL/CameraUpdateItem.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ - (MGLMapCamera*)_makeCamera:(RCTMGLMapView*)mapView
if ([self _isCoordValid:_cameraStop.coordinate]) {
nextCamera.centerCoordinate = _cameraStop.coordinate;
} else if ([self _areBoundsValid:_cameraStop.bounds]) {
MGLMapCamera *boundsCamera = [mapView camera:_cameraStop fittingCoordinateBounds:_cameraStop.bounds edgePadding: _cameraStop.boundsPadding];
MGLMapCamera *boundsCamera = [mapView camera:nextCamera fittingCoordinateBounds:_cameraStop.bounds edgePadding: _cameraStop.boundsPadding];
nextCamera.centerCoordinate = boundsCamera.centerCoordinate;
nextCamera.altitude = boundsCamera.altitude;
}
Expand Down

0 comments on commit 1e88617

Please sign in to comment.