mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-06-02 21:21:35 +02:00
still not able to refine location
This commit is contained in:
@@ -20,14 +20,16 @@ class CameraTagSheet extends StatelessWidget {
|
||||
void _openEditSheet() {
|
||||
Navigator.pop(context); // Close this sheet first
|
||||
appState.startEditSession(node);
|
||||
final session = appState.editSession!;
|
||||
|
||||
// Show the edit sheet
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (_) => EditCameraSheet(session: session),
|
||||
showDragHandle: true,
|
||||
);
|
||||
// Show the edit sheet using a post-frame callback to ensure proper context
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final session = appState.editSession!;
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
builder: (_) => EditCameraSheet(session: session),
|
||||
showDragHandle: true,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return SafeArea(
|
||||
|
||||
@@ -13,6 +13,7 @@ class DirectionConesBuilder {
|
||||
required List<OsmCameraNode> cameras,
|
||||
required double zoom,
|
||||
AddCameraSession? session,
|
||||
EditCameraSession? editSession,
|
||||
}) {
|
||||
final overlays = <Polygon>[];
|
||||
|
||||
@@ -22,13 +23,25 @@ class DirectionConesBuilder {
|
||||
session.target!,
|
||||
session.directionDegrees,
|
||||
zoom,
|
||||
isSession: true,
|
||||
));
|
||||
}
|
||||
|
||||
// Add cones for cameras with direction
|
||||
// Add edit session cone if in edit-camera mode
|
||||
if (editSession != null) {
|
||||
overlays.add(_buildCone(
|
||||
editSession.target,
|
||||
editSession.directionDegrees,
|
||||
zoom,
|
||||
isSession: true,
|
||||
));
|
||||
}
|
||||
|
||||
// Add cones for cameras with direction (but exclude camera being edited)
|
||||
overlays.addAll(
|
||||
cameras
|
||||
.where(_isValidCameraWithDirection)
|
||||
.where((n) => _isValidCameraWithDirection(n) &&
|
||||
(editSession == null || n.id != editSession.originalNode.id))
|
||||
.map((n) => _buildCone(
|
||||
n.coord,
|
||||
n.directionDeg!,
|
||||
|
||||
@@ -309,6 +309,7 @@ class MapViewState extends State<MapView> {
|
||||
cameras: cameras,
|
||||
zoom: zoom,
|
||||
session: session,
|
||||
editSession: editSession,
|
||||
);
|
||||
|
||||
return Stack(
|
||||
|
||||
Reference in New Issue
Block a user