Skip to content

Commit

Permalink
update InsetMapView to use style url query hook
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 committed May 14, 2024
1 parent 7f559f1 commit 82847fd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/frontend/screens/Observation/InsetMapView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {View, Text, StyleSheet, Dimensions, Image} from 'react-native';
import {BLACK, WHITE} from '../../lib/styles';
import {usePersistedSettings} from '../../hooks/persistedState/usePersistedSettings';
import {FormattedCoords} from '../../sharedComponents/FormattedData';
import {MAP_STYLE} from '../MapScreen';
import {useMapStyleUrl} from '../../hooks/server/mapStyleUrl';

const MAP_HEIGHT = 175;
const ICON_OFFSET = {x: 22, y: 21};
Expand All @@ -16,6 +16,8 @@ type MapProps = {

export const InsetMapView = React.memo<MapProps>(({lon, lat}: MapProps) => {
const format = usePersistedSettings(store => store.coordinateFormat);
const styleUrlQuery = useMapStyleUrl();

return (
<View>
<Image
Expand All @@ -37,7 +39,7 @@ export const InsetMapView = React.memo<MapProps>(({lon, lat}: MapProps) => {
rotateEnabled={false}
compassEnabled={false}
scaleBarEnabled={false}
styleURL={MAP_STYLE}>
styleURL={styleUrlQuery.data}>
<MapboxGL.Camera
centerCoordinate={[lon, lat]}
zoomLevel={12}
Expand Down

0 comments on commit 82847fd

Please sign in to comment.