Skip to content

Commit

Permalink
missing reportColor
Browse files Browse the repository at this point in the history
  • Loading branch information
jcardus committed Jun 30, 2024
1 parent 244028c commit abe03b6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 34 deletions.
28 changes: 13 additions & 15 deletions src/map/MapRouteCoordinates.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,19 @@ const MapRouteCoordinates = ({ name, coordinates, deviceId }) => {
'line-width': 2,
},
});
if (name) {
map.addLayer({
source: id,
id: `${id}-title`,
type: 'symbol',
layout: {
'text-field': '{name}',
'text-size': 12,
},
paint: {
'text-halo-color': 'white',
'text-halo-width': 1,
},
});
}
map.addLayer({
source: id,
id: `${id}-title`,
type: 'symbol',
layout: {
'text-field': '{name}',
'text-size': 12,
},
paint: {
'text-halo-color': 'white',
'text-halo-width': 1,
},
});

return () => {
if (map.getLayer(`${id}-title`)) {
Expand Down
20 changes: 1 addition & 19 deletions src/map/MapRoutePath.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useId, useEffect } from 'react';
import { map } from './core/MapView';
import { getSpeedColor } from '../common/util/colors';

const MapRoutePath = ({ name, positions }) => {
const MapRoutePath = ({ positions }) => {
const id = useId();

const theme = useTheme();
Expand Down Expand Up @@ -32,21 +32,6 @@ const MapRoutePath = ({ name, positions }) => {
'line-width': 2,
},
});
if (name) {
map.addLayer({
source: id,
id: `${id}-title`,
type: 'symbol',
layout: {
'text-field': '{name}',
'text-size': 12,
},
paint: {
'text-halo-color': 'white',
'text-halo-width': 1,
},
});
}

return () => {
if (map.getLayer(`${id}-title`)) {
Expand Down Expand Up @@ -85,9 +70,6 @@ const MapRoutePath = ({ name, positions }) => {
map.getSource(id)?.setData({
type: 'FeatureCollection',
features,
properties: {
name,
},
});
}, [theme, positions]);

Expand Down

0 comments on commit abe03b6

Please sign in to comment.