aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/MapGeofenceEdit.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-03 11:48:36 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-03 11:48:36 -0700
commita78b32f7d59d51effe7f1419902637fe39a451b9 (patch)
tree2a1b2ac8ab40be9f90b5762f4b1be4e39eafdf63 /modern/src/map/MapGeofenceEdit.js
parent0ed3111ec95e588f90e8d4f14472b651714444d9 (diff)
downloadtrackermap-web-a78b32f7d59d51effe7f1419902637fe39a451b9.tar.gz
trackermap-web-a78b32f7d59d51effe7f1419902637fe39a451b9.tar.bz2
trackermap-web-a78b32f7d59d51effe7f1419902637fe39a451b9.zip
Custom geofence colors (fix #967)
Diffstat (limited to 'modern/src/map/MapGeofenceEdit.js')
-rw-r--r--modern/src/map/MapGeofenceEdit.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/modern/src/map/MapGeofenceEdit.js b/modern/src/map/MapGeofenceEdit.js
index 045eddc2..c387a086 100644
--- a/modern/src/map/MapGeofenceEdit.js
+++ b/modern/src/map/MapGeofenceEdit.js
@@ -7,6 +7,7 @@ import { useEffect } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { useNavigate } from 'react-router-dom';
+import { useTheme } from '@mui/styles';
import { map } from './core/MapView';
import { geofenceToFeature, geometryToArea } from './core/mapUtil';
import { errorsActions, geofencesActions } from '../store';
@@ -37,6 +38,7 @@ const draw = new MapboxDraw({
});
const MapGeofenceEdit = ({ selectedGeofenceId }) => {
+ const theme = useTheme();
const dispatch = useDispatch();
const navigate = useNavigate();
@@ -133,7 +135,7 @@ const MapGeofenceEdit = ({ selectedGeofenceId }) => {
useEffect(() => {
draw.deleteAll();
Object.values(geofences).forEach((geofence) => {
- draw.add(geofenceToFeature(geofence));
+ draw.add(geofenceToFeature(theme, geofence));
});
}, [geofences]);