Skip to content

Commit

Permalink
fix: Don't collapse map in observation view when map does not load
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaclennan committed Nov 22, 2019
1 parent d4b394b commit d077ece
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/frontend/screens/Observation/ObservationView.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,18 @@ const MapFeatures = ({ lat, lon }: MapProps) => {

const InsetMapView = ({ lon, lat }: MapProps) => {
const [{ styleURL, loading, error }] = useMapStyle();
if (loading) return <Loading />;
if (error) return <Text>Map Error</Text>;
if (loading)
return (
<View style={styles.map}>
<Loading />
</View>
);
if (error)
return (
<View style={styles.map}>
<Text>Map Error</Text>
</View>
);
return (
<MapboxGL.MapView
style={styles.map}
Expand Down

0 comments on commit d077ece

Please sign in to comment.