Skip to content

Commit

Permalink
[MapView] revert initialRegion change (react-native-maps#1613)
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 authored and patricio committed Sep 27, 2017
1 parent 37344ca commit 88061aa
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 88061aa

Please sign in to comment.