Terepbejárás geometriák szerkesztése: kontrollpontok és tulajdonságok.

This commit is contained in:
2026-06-19 12:53:50 +02:00
parent 1276ac0610
commit 0257beec38
8 changed files with 921 additions and 108 deletions
@@ -41,6 +41,23 @@ class MapSurveyView extends GetView<MapSurveyController> {
controller.polygonEditorController.addPoint(point);
}
},
onTap: (tapPosition, point) {
if (controller.mode.value != MapSurveyMode.fieldWalk) return;
if (controller.isMapEditing) return;
final polygonHit = controller.polygonHitNotifier.value;
if (polygonHit != null && polygonHit.hitValues.isNotEmpty) {
final id = polygonHit.hitValues.first;
controller.selectedNoteItem(id);
return;
}
final polylineHit = controller.polylineHitNotifier.value;
if (polylineHit != null && polylineHit.hitValues.isNotEmpty) {
final id = polylineHit.hitValues.first;
controller.selectedNoteItem(id);
return;
}
controller.clearNoteItemSelection();
},
layers: [
Obx(() =>
MarkerLayer(markers: controller.currentLocationMarker.toList())),
@@ -55,14 +72,6 @@ class MapSurveyView extends GetView<MapSurveyController> {
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();
@@ -75,7 +84,9 @@ class MapSurveyView extends GetView<MapSurveyController> {
return const SizedBox.shrink();
}
return PolylineLayer(polylines: [...controller.polylineNotes]);
return PolylineLayer(
hitNotifier: controller.polylineHitNotifier,
polylines: [...controller.polylineNotes]);
}),
Obx(() {
if (controller.mode.value != MapSurveyMode.fieldWalk) {
@@ -83,8 +94,56 @@ class MapSurveyView extends GetView<MapSurveyController> {
}
return PolygonLayer(
polygons: [...controller.polygonNotes], useAltRendering: true);
})
hitNotifier: controller.polygonHitNotifier,
polygons: [...controller.polygonNotes],
useAltRendering: true);
}),
Obx(() {
if (controller.mode.value != MapSurveyMode.fieldWalk) {
return const SizedBox.shrink();
}
final selectedId = controller.selectedNoteItemId.value;
if (selectedId == null) return const SizedBox.shrink();
// Polygon kiemelés
final selectedPolygon = controller.polygonNotes
.where((p) => p.hitValue == selectedId)
.firstOrNull;
if (selectedPolygon != null) {
return PolygonLayer(polygons: [
Polygon(
points: selectedPolygon.points,
color: Colors.transparent,
borderColor: Colors.white,
borderStrokeWidth: selectedPolygon.borderStrokeWidth + 3,
),
]);
}
// Polyline kiemelés
final selectedPolyline = controller.polylineNotes
.where((p) => p.hitValue == selectedId)
.firstOrNull;
if (selectedPolyline != null) {
return PolylineLayer(polylines: [
Polyline(
points: selectedPolyline.points,
color: Colors.white.withOpacity(0.6),
strokeWidth: selectedPolyline.strokeWidth + 4,
),
]);
}
return const SizedBox.shrink();
}),
Obx(() {
if (controller.mode.value != MapSurveyMode.fieldWalk) {
return const SizedBox.shrink();
}
return PolygonEditor(
controller: controller.polygonEditorController,
throttleDuration: Duration.zero);
}),
],
),
Positioned(