aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-05-09 15:46:51 -0700
committerAnton Tananaev <anton@traccar.org>2024-05-09 15:46:51 -0700
commitb32a43a277fed24e51f5776b495bfbd670d8cb80 (patch)
tree92ee94de4c161ebb9305263efaa289977a2d61e9 /src
parent1e82bfd81e85c5cd51fab4355ebdc218e66b18ad (diff)
downloadtrackermap-web-b32a43a277fed24e51f5776b495bfbd670d8cb80.tar.gz
trackermap-web-b32a43a277fed24e51f5776b495bfbd670d8cb80.tar.bz2
trackermap-web-b32a43a277fed24e51f5776b495bfbd670d8cb80.zip
Set default geofence name
Diffstat (limited to 'src')
-rw-r--r--src/map/draw/MapGeofenceEdit.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/draw/MapGeofenceEdit.js b/src/map/draw/MapGeofenceEdit.js
index 46fe8c9c..0f63509a 100644
--- a/src/map/draw/MapGeofenceEdit.js
+++ b/src/map/draw/MapGeofenceEdit.js
@@ -12,6 +12,7 @@ import { geofenceToFeature, geometryToArea } from '../core/mapUtil';
import { errorsActions, geofencesActions } from '../../store';
import { useCatchCallback } from '../../reactHelper';
import theme from './theme';
+import { useTranslation } from '../../common/components/LocalizationProvider';
MapboxDraw.constants.classes.CONTROL_BASE = 'maplibregl-ctrl';
MapboxDraw.constants.classes.CONTROL_PREFIX = 'maplibregl-ctrl-';
@@ -45,6 +46,7 @@ const MapGeofenceEdit = ({ selectedGeofenceId }) => {
const theme = useTheme();
const dispatch = useDispatch();
const navigate = useNavigate();
+ const t = useTranslation();
const geofences = useSelector((state) => state.geofences.items);
@@ -67,7 +69,7 @@ const MapGeofenceEdit = ({ selectedGeofenceId }) => {
useEffect(() => {
const listener = async (event) => {
const feature = event.features[0];
- const newItem = { name: '', area: geometryToArea(feature.geometry) };
+ const newItem = { name: t('sharedGeofence'), area: geometryToArea(feature.geometry) };
draw.delete(feature.id);
try {
const response = await fetch('/api/geofences', {