Bejárás mód: pont leírás mentése

This commit is contained in:
2026-06-21 12:57:17 +02:00
parent 52bce4b925
commit 026d7799f9
3 changed files with 69 additions and 13 deletions
@@ -1787,4 +1787,53 @@ class MapSurveyController extends GetxController {
ignoreSafeArea: false,
);
}
// ----- Terepbejárás pont mentése
void showSavePointDialog({required LatLng point}) {
final labelCtrl = TextEditingController();
Get.dialog(
AlertDialog(
title: const Text('Pont mentése'),
content: TextField(
controller: labelCtrl,
autofocus: true,
decoration: const InputDecoration(
hintText: 'Pont neve (opcionális)',
border: OutlineInputBorder(),
),
textCapitalization: TextCapitalization.sentences,
onSubmitted: (_) => _doSavePoint(point, labelCtrl.text),
),
actions: [
TextButton(
onPressed: Get.back,
child: const Text('Mégse'),
),
FilledButton(
onPressed: () => _doSavePoint(point, labelCtrl.text),
child: const Text('Mentés'),
),
],
),
barrierDismissible: false,
);
}
void _doSavePoint(LatLng point, String label) {
activeEditLabel.value = label.trim();
Get.back();
saveEditedPoint(point: point);
}
void savePointFromCurrentPosition() {
final lat = currentLatitude.value;
final lon = currentLongitude.value;
if (lat == 0.0 && lon == 0.0) {
Get.snackbar('Hiba', 'GPS pozíció nem elérhető',
snackPosition: SnackPosition.BOTTOM);
return;
}
showSavePointDialog(point: LatLng(lat, lon));
}
}
@@ -51,7 +51,8 @@ class MapSurveyView extends GetView<MapSurveyController> {
onCenterOnGps: controller.setIsMapMoveToCenter,
onLongPress: (tapPosition, point) {
if (controller.activeEditTool.value == MapEditTool.point) {
controller.saveEditedPoint(point: point);
//controller.saveEditedPoint(point: point);
controller.showSavePointDialog(point: point);
}
if (controller.activeEditTool.value == MapEditTool.line ||
controller.activeEditTool.value == MapEditTool.polygon) {