Skip to content

Commit

Permalink
fix: Fix map zoom-out when switching back to map screen when not in f…
Browse files Browse the repository at this point in the history
…ollow-mode (#147)
  • Loading branch information
gmaclennan authored Jun 20, 2019
1 parent b211ed2 commit 372c6fc
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions src/frontend/sharedComponents/MapView.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,20 +221,18 @@ class MapView extends React.Component<Props, State> {
styleURL={styleURL}
onRegionDidChange={this.handleRegionDidChange}
>
{isFocused && locationServicesEnabled && (
<MapboxGL.UserLocation visible />
)}
{isFocused && (
<MapboxGL.Camera
centerCoordinate={initialCoords}
zoomLevel={initialZoom}
followUserLocation={this.state.following}
followUserMode="normal"
followZoomLevel={this.getFollowZoomLevel()}
animationMode="flyTo"
triggerKey={this.state.following}
/>
{locationServicesEnabled && (
<MapboxGL.UserLocation visible={isFocused} />
)}
<MapboxGL.Camera
centerCoordinate={initialCoords}
zoomLevel={initialZoom}
followUserLocation={isFocused && this.state.following}
followUserMode="normal"
followZoomLevel={this.getFollowZoomLevel()}
animationMode="flyTo"
triggerKey={this.state.following}
/>
<ObservationMapLayer
onPress={this.handleObservationPress}
observations={observations}
Expand Down

0 comments on commit 372c6fc

Please sign in to comment.