Bejárás: pont színének megadása. Projekt export geopackage formátumban
This commit is contained in:
@@ -23,6 +23,7 @@ import 'package:terepi_seged/controls/geoid_grid.dart';
|
||||
import 'package:terepi_seged/controls/wgs84_coordinate_formatter.dart';
|
||||
import 'package:terepi_seged/core/geometry_measure.dart';
|
||||
import 'package:terepi_seged/core/geometry_measure_formatter.dart';
|
||||
import 'package:terepi_seged/core/geopackage_exporter.dart';
|
||||
import 'package:terepi_seged/enums/map_edit_tool.dart';
|
||||
import 'package:terepi_seged/enums/map_survey_mode.dart';
|
||||
import 'package:terepi_seged/enums/note_type.dart';
|
||||
@@ -45,6 +46,7 @@ import 'package:terepi_seged/services/gnss/gnss_service.dart';
|
||||
import 'package:terepi_seged/services/ntrip_service.dart';
|
||||
import 'package:terepi_seged/services/project_service.dart';
|
||||
import 'package:terepi_seged/widgets/map/imported_layer_overlay.dart';
|
||||
import 'package:terepi_seged/widgets/map_edit_tools/color_row.dart';
|
||||
import 'package:terepi_seged/widgets/map_edit_tools/map_feature_save_sheet.dart';
|
||||
import 'package:terepi_seged/widgets/map_edit_tools/note_item_list_sheet.dart';
|
||||
import 'package:terepi_seged/widgets/shared_map_widgets.dart';
|
||||
@@ -142,6 +144,9 @@ class MapSurveyController extends GetxController {
|
||||
final pointsToMeasureLabel = <PolyWidget>[].obs;
|
||||
final pointsToMeasureDropDownMenuItem = <DropdownMenuItem<int>>[].obs;
|
||||
|
||||
final allNoteItems = <NoteItem>[].obs;
|
||||
final showGeometryLabels = false.obs;
|
||||
|
||||
// ── Pont adatok ───────────────────────────────────────────────────
|
||||
final RxList<PointToMeasure> pointsToMeasure = <PointToMeasure>[].obs;
|
||||
final RxList<PointWithDescription> pointWithDescriptionList =
|
||||
@@ -1251,6 +1256,8 @@ class MapSurveyController extends GetxController {
|
||||
final projectId = ProjectService.to.activeProject.value?.id;
|
||||
final items = await AppDatabase.instance.listNoteItems(projectId);
|
||||
|
||||
allNoteItems.assignAll(items);
|
||||
|
||||
// Listák resetelése
|
||||
pointNotes.clear();
|
||||
polylineNotes.clear();
|
||||
@@ -1341,6 +1348,9 @@ class MapSurveyController extends GetxController {
|
||||
);
|
||||
|
||||
await updateNoteItem(updated);
|
||||
|
||||
allNoteItems.removeWhere((i) => i.id == id);
|
||||
allNoteItems.add(updated);
|
||||
editingNoteItemId = null;
|
||||
activeEditTool.value = MapEditTool.none;
|
||||
draftAreaSquareMeters.value = 0.0;
|
||||
@@ -1413,6 +1423,7 @@ class MapSurveyController extends GetxController {
|
||||
).then((saved) {
|
||||
if (saved == null) return;
|
||||
pointNotes.add(_markerFromNoteItem(saved));
|
||||
allNoteItems.add(saved);
|
||||
});
|
||||
activeEditTool.value = MapEditTool.none;
|
||||
}
|
||||
@@ -1510,6 +1521,7 @@ class MapSurveyController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> deleteNoteItem(NoteItem item) async {
|
||||
allNoteItems.removeWhere((i) => i.id == item.id);
|
||||
await AppDatabase.instance.deleteNoteItem(item.id!);
|
||||
|
||||
switch (item.type) {
|
||||
@@ -1634,6 +1646,7 @@ class MapSurveyController extends GetxController {
|
||||
);
|
||||
if (saved != null) {
|
||||
polylineNotes.add(saved.toPolyline());
|
||||
allNoteItems.add(saved);
|
||||
}
|
||||
polygonEditorController.clear();
|
||||
activeEditTool.value = MapEditTool.none;
|
||||
@@ -1796,15 +1809,23 @@ class MapSurveyController extends GetxController {
|
||||
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),
|
||||
content: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ColorRow(ctrl: this, circleSize: 34),
|
||||
SizedBox(height: 8),
|
||||
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(
|
||||
@@ -1853,4 +1874,45 @@ class MapSurveyController extends GetxController {
|
||||
ignoreSafeArea: false,
|
||||
);
|
||||
}
|
||||
|
||||
void toggleGeometryLabels() =>
|
||||
showGeometryLabels.value = !showGeometryLabels.value;
|
||||
|
||||
Future<void> exportProject() async {
|
||||
Get.dialog(
|
||||
Center(
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(28),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
),
|
||||
child: const Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
CircularProgressIndicator(),
|
||||
SizedBox(height: 16),
|
||||
Text(
|
||||
'GeoPackage generálása...',
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
barrierDismissible: false,
|
||||
);
|
||||
|
||||
try {
|
||||
await GeoPackageExporter().exportProject();
|
||||
} catch (e) {
|
||||
Get.snackbar('Export hiba', e.toString(),
|
||||
snackPosition: SnackPosition.BOTTOM);
|
||||
} finally {
|
||||
Get.back(); // ← dialóg bezárása, akár sikerült akár nem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user