Skip to content

Commit

Permalink
[MapView] revert initialRegion change
Browse files Browse the repository at this point in the history
Reverts JS changes made in react-native-maps#1563 which broke initialRegion on iOS,
causing the map to display a region centered around 0, 0.
  • Loading branch information
computerjazz committed Sep 1, 2017
1 parent 3611c22 commit 0ddcfb0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/components/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,13 +466,10 @@ class MapView extends React.Component {
const { layout } = e.nativeEvent;
if (!layout.width || !layout.height) return;
if (this.state.isReady && !this.__layoutCalled) {
const { region, initialRegion } = this.props;
const region = this.props.region || this.props.initialRegion;
if (region) {
this.__layoutCalled = true;
this.map.setNativeProps({ region });
} else if (initialRegion) {
this.__layoutCalled = true;
this.map.setNativeProps({ initialRegion });
}
}
if (this.props.onLayout) {
Expand Down

0 comments on commit 0ddcfb0

Please sign in to comment.