mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
Add WMS support and measurement functionality
- Implemented WMS layer handling for Slovenian aerial imagery and overlays for cadastral parcels and forest roads. - Added distance measurement feature allowing users to measure distances on the map with long press interactions. - Updated localization files for Croatian, Italian, and Slovenian languages to include new measurement and WMS-related strings. - Enhanced the map layer model to support WMS-specific properties. - Introduced a new tile provider for debugging WMS requests. - Updated the drawing toolbar to include measurement mode and clear measurement functionality. - Integrated SharedPreferences to persist overlay visibility states across app sessions. - Added utility functions for handling the Slovenian coordinate reference system (EPSG:3794).
This commit is contained in:
@@ -127,6 +127,18 @@ class DrawingToolbar extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(4),
|
||||
constraints: const BoxConstraints(),
|
||||
),
|
||||
// Clear measurement
|
||||
if (drawingProvider.drawingMode == DrawingMode.measure &&
|
||||
drawingProvider.measurementPoint1 != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.clear),
|
||||
onPressed: () => drawingProvider.clearMeasurement(),
|
||||
tooltip: AppLocalizations.of(context)!.clearMeasurement,
|
||||
color: Colors.orange,
|
||||
iconSize: 20,
|
||||
padding: const EdgeInsets.all(4),
|
||||
constraints: const BoxConstraints(),
|
||||
),
|
||||
// Complete line drawing
|
||||
if (drawingProvider.drawingMode == DrawingMode.line &&
|
||||
drawingProvider.currentLinePoints.length >= 2)
|
||||
@@ -207,6 +219,15 @@ class DrawingToolbar extends StatelessWidget {
|
||||
drawingProvider.setDrawingMode(DrawingMode.rectangle);
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.straighten),
|
||||
title: Text(AppLocalizations.of(sheetContext)!.measureDistance),
|
||||
subtitle: Text(AppLocalizations.of(sheetContext)!.measureDistanceDesc),
|
||||
onTap: () {
|
||||
Navigator.pop(sheetContext);
|
||||
drawingProvider.setDrawingMode(DrawingMode.measure);
|
||||
},
|
||||
),
|
||||
const Divider(),
|
||||
// Toggle received drawings visibility
|
||||
SwitchListTile(
|
||||
@@ -465,6 +486,8 @@ class DrawingToolbar extends StatelessWidget {
|
||||
return Icons.show_chart;
|
||||
case DrawingMode.rectangle:
|
||||
return Icons.crop_square;
|
||||
case DrawingMode.measure:
|
||||
return Icons.straighten;
|
||||
case DrawingMode.none:
|
||||
return Icons.edit;
|
||||
}
|
||||
@@ -477,6 +500,8 @@ class DrawingToolbar extends StatelessWidget {
|
||||
return AppLocalizations.of(context)!.drawLine;
|
||||
case DrawingMode.rectangle:
|
||||
return AppLocalizations.of(context)!.drawRectangle;
|
||||
case DrawingMode.measure:
|
||||
return AppLocalizations.of(context)!.measureDistance;
|
||||
case DrawingMode.none:
|
||||
return AppLocalizations.of(context)!.drawing;
|
||||
}
|
||||
@@ -489,6 +514,8 @@ class DrawingToolbar extends StatelessWidget {
|
||||
return 'Tap map to add points\nTap ✓ to finish';
|
||||
case DrawingMode.rectangle:
|
||||
return 'Tap start point, then end point';
|
||||
case DrawingMode.measure:
|
||||
return 'Long press two points to measure';
|
||||
case DrawingMode.none:
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user