Aktuális pozíciót jelzésének javítása

This commit is contained in:
2026-06-20 00:15:41 +02:00
parent 0257beec38
commit a9316b9b8d
2 changed files with 146 additions and 22 deletions
@@ -9,6 +9,8 @@ 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';
import 'package:terepi_seged/pages/tracking/presentation/controllers/tracking_controller.dart';
import 'package:terepi_seged/services/gnss/gnss_device_service.dart';
import 'package:terepi_seged/services/gnss/gnss_service.dart';
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';
@@ -27,11 +29,24 @@ class MapSurveyView extends GetView<MapSurveyController> {
Widget build(BuildContext context) {
return Stack(children: [
SharedMapWidget(
controls: const MapControls(),
mapController: controller.mapController,
isFollowing: controller.isMapMoveToCenter,
initialCenter: LatLng(
// ← nem fix érték
controller.currentLatitude.value != 0.0
? controller.currentLatitude.value
: 47.5,
controller.currentLongitude.value != 0.0
? controller.currentLongitude.value
: 19.0,
),
initialZoom: controller.currentZoom.value,
currentZoom: controller.currentZoom,
onZoomIn: controller.mapZoomIn,
onZoomOut: controller.mapZoomOut,
onCenterOnGps: controller.isMapMoveToCenter,
onPositionChanged: controller.onMapPositionChanged,
onCenterOnGps: controller.setIsMapMoveToCenter,
onLongPress: (tapPosition, point) {
if (controller.activeEditTool.value == MapEditTool.point) {
controller.saveEditedPoint(point: point);
@@ -59,8 +74,15 @@ class MapSurveyView extends GetView<MapSurveyController> {
controller.clearNoteItemSelection();
},
layers: [
Obx(() =>
MarkerLayer(markers: controller.currentLocationMarker.toList())),
Obx(() {
final isGpsActive = GnssService.to.activeConnectionType.value !=
GnssConnectionType.none;
if (isGpsActive) {
return MarkerLayer(
markers: controller.currentLocationMarker.toList());
}
return const SizedBox.shrink();
}),
// Track polyline
Obx(() {