Skip to content

Commit 721d67c

Browse files
committed
Only set belowLayerID for routes in interactive mode
1 parent 519d468 commit 721d67c

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/components/MapView/Direction.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import useThemeStyles from '@hooks/useThemeStyles';
33
import CONST from '@src/CONST';
44
import type {DirectionProps} from './MapViewTypes';
55

6-
function Direction({coordinates}: DirectionProps) {
6+
function Direction({coordinates, belowLayerID}: DirectionProps) {
77
const styles = useThemeStyles();
88
if (coordinates.length < 1) {
99
return null;
@@ -22,7 +22,7 @@ function Direction({coordinates}: DirectionProps) {
2222
}}
2323
>
2424
<Mapbox.LineLayer
25-
belowLayerID={CONST.MAP_VIEW_LAYERS.USER_LOCATION}
25+
belowLayerID={belowLayerID}
2626
id={CONST.MAP_VIEW_LAYERS.ROUTE_FILL}
2727
style={styles.mapDirection}
2828
/>

src/components/MapView/MapView.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,12 @@ function MapView({
319319
);
320320
})}
321321

322-
{!!directionCoordinates && <Direction coordinates={directionCoordinates} />}
322+
{!!directionCoordinates && (
323+
<Direction
324+
coordinates={directionCoordinates}
325+
belowLayerID={interactive ? CONST.MAP_VIEW_LAYERS.USER_LOCATION : undefined}
326+
/>
327+
)}
323328
{!!distanceSymbolCoordinate && !!distanceInMeters && !!distanceUnit && (
324329
<MarkerView
325330
coordinate={distanceSymbolCoordinate}

src/components/MapView/MapViewTypes.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ type MapViewProps = {
3939
type DirectionProps = {
4040
// Coordinates of points that constitute the direction
4141
coordinates: Coordinate[];
42+
43+
// ID of the layer to place the line layer below
44+
belowLayerID?: string;
4245
};
4346

4447
type PendingMapViewProps = {

0 commit comments

Comments
 (0)