aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/MapPositions.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-20 16:08:18 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-20 16:08:46 -0700
commit29365a7bf12331ecee5f53eca83cf141a2e8d1f9 (patch)
treefef6768ee6a2d7a45a22e7ade9c9d5fde96f4705 /modern/src/map/MapPositions.js
parent503421e22059140daa6dafbb1e6b0f08918a7757 (diff)
downloadtrackermap-web-29365a7bf12331ecee5f53eca83cf141a2e8d1f9.tar.gz
trackermap-web-29365a7bf12331ecee5f53eca83cf141a2e8d1f9.tar.bz2
trackermap-web-29365a7bf12331ecee5f53eca83cf141a2e8d1f9.zip
Handle missing categories
Diffstat (limited to 'modern/src/map/MapPositions.js')
-rw-r--r--modern/src/map/MapPositions.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/modern/src/map/MapPositions.js b/modern/src/map/MapPositions.js
index 89a48df1..c1c3a1ca 100644
--- a/modern/src/map/MapPositions.js
+++ b/modern/src/map/MapPositions.js
@@ -4,6 +4,7 @@ import { useSelector } from 'react-redux';
import { map } from './core/MapView';
import { getStatusColor } from '../common/util/formatter';
import usePersistedState from '../common/util/usePersistedState';
+import { mapIconKey } from './core/preloadImages';
const MapPositions = ({ positions, onClick, showStatus }) => {
const id = 'positions';
@@ -19,7 +20,7 @@ const MapPositions = ({ positions, onClick, showStatus }) => {
id: position.id,
deviceId: position.deviceId,
name: device.name,
- category: device.category || 'default',
+ category: mapIconKey(device.category),
color: showStatus ? position.attributes.color || getStatusColor(device.status) : 'neutral',
};
};