Skip to content

Commit

Permalink
[MapView] revert initialRegion change (#1613)
Browse files Browse the repository at this point in the history
Reverts JS changes made in #1563 which broke initialRegion on iOS,
causing the map to display a region centered around 0, 0.
  • Loading branch information
computerjazz authored and christopherdro committed Sep 3, 2017
1 parent ddf858b commit e6a3f7a
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 e6a3f7a

Please sign in to comment.