Terepbejárás oldalon vonal és terület tulajdonságainak szerkesztése, mentés
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map_polygon_editor/polygon_editor/polygon_editor.dart';
|
||||
import 'package:flutter_map_polywidget/flutter_map_polywidget.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
import 'package:terepi_seged/enums/map_edit_tool.dart';
|
||||
import 'package:terepi_seged/enums/map_survey_mode.dart';
|
||||
import 'package:terepi_seged/pages/map_survey/presentations/controllers/map_survey_controller.dart';
|
||||
import 'package:terepi_seged/pages/map_survey/presentations/views/settings_dialog.dart';
|
||||
@@ -10,6 +12,8 @@ import 'package:terepi_seged/pages/tracking/presentation/controllers/tracking_co
|
||||
import 'package:terepi_seged/utils/rive_utils.dart';
|
||||
import 'package:terepi_seged/widgets/coordinate_panel.dart';
|
||||
import 'package:terepi_seged/widgets/map_bottom_panel.dart';
|
||||
import 'package:terepi_seged/widgets/map_edit_tools/map_edit_drawing_toolbar.dart';
|
||||
import 'package:terepi_seged/widgets/map_edit_tools/map_edit_toolbar.dart';
|
||||
import 'package:terepi_seged/widgets/map_info_card_column.dart';
|
||||
import 'package:terepi_seged/widgets/save_point_fab.dart';
|
||||
import 'package:terepi_seged/widgets/shared_map_widgets.dart';
|
||||
@@ -28,6 +32,15 @@ class MapSurveyView extends GetView<MapSurveyController> {
|
||||
onZoomIn: controller.mapZoomIn,
|
||||
onZoomOut: controller.mapZoomOut,
|
||||
onCenterOnGps: controller.isMapMoveToCenter,
|
||||
onLongPress: (tapPosition, point) {
|
||||
if (controller.activeEditTool.value == MapEditTool.point) {
|
||||
controller.saveEditedPoint(point: point);
|
||||
}
|
||||
if (controller.activeEditTool.value == MapEditTool.line ||
|
||||
controller.activeEditTool.value == MapEditTool.polygon) {
|
||||
controller.polygonEditorController.addPoint(point);
|
||||
}
|
||||
},
|
||||
layers: [
|
||||
Obx(() =>
|
||||
MarkerLayer(markers: controller.currentLocationMarker.toList())),
|
||||
@@ -41,6 +54,36 @@ class MapSurveyView extends GetView<MapSurveyController> {
|
||||
} else {
|
||||
return _buildTrackLayer();
|
||||
}
|
||||
}),
|
||||
Obx(() {
|
||||
if (controller.mode.value != MapSurveyMode.fieldWalk) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
return PolygonEditor(
|
||||
controller: controller.polygonEditorController,
|
||||
throttleDuration: Duration.zero);
|
||||
}),
|
||||
Obx(() {
|
||||
if (controller.mode.value != MapSurveyMode.fieldWalk) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return MarkerLayer(markers: [...controller.pointNotes]);
|
||||
}),
|
||||
Obx(() {
|
||||
if (controller.mode.value != MapSurveyMode.fieldWalk) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return PolylineLayer(polylines: [...controller.polylineNotes]);
|
||||
}),
|
||||
Obx(() {
|
||||
if (controller.mode.value != MapSurveyMode.fieldWalk) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
|
||||
return PolygonLayer(
|
||||
polygons: [...controller.polygonNotes], useAltRendering: true);
|
||||
})
|
||||
],
|
||||
),
|
||||
@@ -50,23 +93,40 @@ class MapSurveyView extends GetView<MapSurveyController> {
|
||||
child: MapInfoCardColumn(controller: controller),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
top: 390,
|
||||
right: 60,
|
||||
left: 8,
|
||||
child: CoordinatePanel(
|
||||
eovY: controller.eovY,
|
||||
eovX: controller.eovX,
|
||||
horError: controller.gpsLatitudeError,
|
||||
vertError: controller.gpsAltitudeError,
|
||||
altitudeMsl: controller.gpsAltitude,
|
||||
geoidSeparation: controller.gpsGeoidSeparation,
|
||||
ntripConnected: controller.ntripIsConnected,
|
||||
ntripBytes: controller.ntripReceivedData,
|
||||
ntripPackets: controller.ntripDataPacketNumbers,
|
||||
ggaPackets: controller.ggaSenDataPacketNumber,
|
||||
),
|
||||
),
|
||||
// Positioned(
|
||||
// top: 390,
|
||||
// right: 60,
|
||||
// left: 8,
|
||||
// child: CoordinatePanel(
|
||||
// eovY: controller.eovY,
|
||||
// eovX: controller.eovX,
|
||||
// horError: controller.gpsLatitudeError,
|
||||
// vertError: controller.gpsAltitudeError,
|
||||
// altitudeMsl: controller.gpsAltitude,
|
||||
// geoidSeparation: controller.gpsGeoidSeparation,
|
||||
// ntripConnected: controller.ntripIsConnected,
|
||||
// ntripBytes: controller.ntripReceivedData,
|
||||
// ntripPackets: controller.ntripDataPacketNumbers,
|
||||
// ggaPackets: controller.ggaSenDataPacketNumber,
|
||||
// ),
|
||||
// ),
|
||||
Obx(() {
|
||||
if (controller.mode.value != MapSurveyMode.fieldWalk) {
|
||||
return const SizedBox.shrink();
|
||||
}
|
||||
if (controller.activeEditTool.value == MapEditTool.none) {
|
||||
return Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: MapEditCompactToolbar(controller: controller));
|
||||
}
|
||||
return Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: MapEditDrawingToolbar(controller: controller));
|
||||
})
|
||||
// Positioned(top: 8, left: 0, right: 0, child: _ModeSelector()),
|
||||
// Positioned(
|
||||
// bottom: 80,
|
||||
|
||||
Reference in New Issue
Block a user