Compare commits

..

10 Commits

Author SHA1 Message Date
stopflock
e2830a189b Merge pull request #11 from stopflock/camera-edits
Everything But Camera Edits
2025-08-17 12:16:42 -05:00
stopflock
d9beeb9d83 Revert "Move tag camera and download buttons to a bar instead of floating"
This reverts commit 6aaddb4fe2.
2025-08-17 12:13:57 -05:00
stopflock
446b70eaff move buttons to fake bottom bar 2025-08-17 11:57:51 -05:00
stopflock
2829730705 add a really dumb script to build apk and ipa locally 2025-08-17 11:57:43 -05:00
stopflock
a131fb61e0 Merge pull request #10 from stopflock/camera-edits
Everything but camera edits
2025-08-16 22:17:02 -05:00
stopflock
6aaddb4fe2 Move tag camera and download buttons to a bar instead of floating 2025-08-16 20:55:55 -05:00
stopflock
e2adbf85ad Make default profile less specific 2025-08-16 20:00:19 -05:00
stopflock
6d079b3c34 forgot to import dev_config to uploader 2025-08-16 19:56:27 -05:00
stopflock
e293727ec8 Put version reported to OSM into dev_config 2025-08-16 19:53:47 -05:00
stopflock
9375f48a07 fix default upload dest (should be simulate) and add dev_config param for "tag camera" pin v. offset 2025-08-16 19:45:48 -05:00
8 changed files with 109 additions and 43 deletions

7
.gitignore vendored
View File

@@ -80,3 +80,10 @@ Thumbs.db
*.keystore
.env
# ───────────────────────────────
# For now - not targeting these
# ───────────────────────────────
linux/
macos/
web/
windows/

16
do_builds.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
appver=$(cat lib/dev_config.dart | grep "kClientVersion" | cut -d '=' -f 2 | tr -d ';' | tr -d "\'" | tr -d " ")
echo
echo "Building app version ${appver}..."
flutter build ios --no-codesign
flutter build apk
echo
echo "Converting .app to .ipa..."
./app2ipa.sh build/ios/iphoneos/Runner.app
echo
echo "Moving files..."
cp build/app/outputs/flutter-apk/app-release.apk ../flockmap_v${appver}.apk
mv Runner.ipa ../flockmap_v${appver}.ipa
echo
echo "Done."

View File

@@ -72,7 +72,7 @@ class AppState extends ChangeNotifier {
}
// Upload mode: production, sandbox, or simulate (in-memory, no uploads)
UploadMode _uploadMode = UploadMode.production;
UploadMode _uploadMode = UploadMode.simulate;
static const String _uploadModePrefsKey = 'upload_mode';
UploadMode get uploadMode => _uploadMode;
Future<void> setUploadMode(UploadMode mode) async {

View File

@@ -10,6 +10,21 @@ const double kTileEstimateKb = 25.0;
const double kDirectionConeHalfAngle = 20.0; // degrees
const double kDirectionConeBaseLength = 0.0012; // multiplier
// Margin (bottom) for positioning the floating bottom button bar
const double kBottomButtonBarMargin = 4.0;
// Map overlay (attribution, scale bar, zoom) vertical offset from bottom edge
const double kAttributionBottomOffset = 110.0;
const double kZoomIndicatorBottomOffset = 142.0;
const double kScaleBarBottomOffset = 170.0;
// Add Camera pin vertical offset (for pin tip to match coordinate on map)
const double kAddPinYOffset = -16.0;
// Client name and version for OSM uploads ("created_by" tag)
const String kClientName = 'FlockMap';
const String kClientVersion = '0.8.2';
// Marker/camera interaction
const int kCameraMinZoomLevel = 10; // Minimum zoom to show cameras or warning
const Duration kMarkerTapTimeout = Duration(milliseconds: 250);

View File

@@ -20,10 +20,7 @@ class CameraProfile {
name: 'Generic Flock',
tags: const {
'man_made': 'surveillance',
'surveillance': 'public',
'surveillance:zone': 'traffic',
'surveillance:type': 'ALPR', // left for backward compatibility — you may want to revisit per OSM best practice
'camera:type': 'fixed',
'surveillance:type': 'ALPR',
'manufacturer': 'Flock Safety',
'manufacturer:wikidata': 'Q108485435',
},

View File

@@ -59,38 +59,66 @@ class _HomeScreenState extends State<HomeScreen> {
),
],
),
body: MapView(
controller: _mapController,
followMe: _followMe,
onUserGesture: () {
if (_followMe) setState(() => _followMe = false);
},
body: Stack(
children: [
MapView(
controller: _mapController,
followMe: _followMe,
onUserGesture: () {
if (_followMe) setState(() => _followMe = false);
},
),
Align(
alignment: Alignment.bottomCenter,
child: Padding(
padding: EdgeInsets.only(
bottom: MediaQuery.of(context).padding.bottom + kBottomButtonBarMargin,
left: 8,
right: 8,
),
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16),
boxShadow: [BoxShadow(color: Colors.black26, blurRadius: 10, offset: Offset(0, -2))],
),
margin: EdgeInsets.only(bottom: kBottomButtonBarMargin),
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
child: Row(
children: [
Expanded(
child: ElevatedButton.icon(
icon: Icon(Icons.add_location_alt),
label: Text('Tag Camera'),
onPressed: _openAddCameraSheet,
style: ElevatedButton.styleFrom(
minimumSize: Size(0, 48),
textStyle: TextStyle(fontSize: 16),
),
),
),
SizedBox(width: 12),
Expanded(
child: ElevatedButton.icon(
icon: Icon(Icons.download_for_offline),
label: Text('Download'),
onPressed: () => showDialog(
context: context,
builder: (ctx) => DownloadAreaDialog(controller: _mapController),
),
style: ElevatedButton.styleFrom(
minimumSize: Size(0, 48),
textStyle: TextStyle(fontSize: 16),
),
),
),
],
),
),
),
),
],
),
floatingActionButton: appState.session == null
? Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
FloatingActionButton.extended(
onPressed: _openAddCameraSheet,
icon: const Icon(Icons.add_location_alt),
label: const Text('Tag Camera'),
heroTag: 'tag_camera_fab',
),
const SizedBox(height: 12),
FloatingActionButton.extended(
onPressed: () => showDialog(
context: context,
builder: (ctx) => DownloadAreaDialog(controller: _mapController),
),
icon: const Icon(Icons.download_for_offline),
label: const Text('Download'),
heroTag: 'download_fab',
),
],
)
: null,
floatingActionButtonLocation: FloatingActionButtonLocation.endFloat,
),
);
}

View File

@@ -2,7 +2,7 @@ import 'dart:async';
import 'package:http/http.dart' as http;
import '../models/pending_upload.dart';
import '../dev_config.dart';
import '../app_state.dart';
class Uploader {
@@ -20,7 +20,7 @@ class Uploader {
final csXml = '''
<osm>
<changeset>
<tag k="created_by" v="FlockMap 0.5"/>
<tag k="created_by" v="$kClientName $kClientVersion"/>
<tag k="comment" v="Add surveillance camera"/>
</changeset>
</osm>''';

View File

@@ -311,7 +311,7 @@ class _MapViewState extends State<MapView> {
// Built-in scale bar from flutter_map
Scalebar(
alignment: Alignment.bottomLeft,
padding: EdgeInsets.only(left: 8, bottom: 54), // above attribution
padding: EdgeInsets.only(left: 8, bottom: kScaleBarBottomOffset), // from dev_config
textStyle: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
lineColor: Colors.black,
strokeWidth: 3,
@@ -353,7 +353,7 @@ class _MapViewState extends State<MapView> {
// Zoom indicator, positioned above scale bar
Positioned(
left: 10,
bottom: 92,
bottom: kZoomIndicatorBottomOffset,
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 7, vertical: 2),
decoration: BoxDecoration(
@@ -377,7 +377,7 @@ class _MapViewState extends State<MapView> {
),
// Attribution overlay
Positioned(
bottom: 20,
bottom: kAttributionBottomOffset,
left: 10,
child: Container(
color: Colors.white70,
@@ -391,9 +391,12 @@ class _MapViewState extends State<MapView> {
// Fixed pin when adding camera
if (session != null)
const IgnorePointer(
IgnorePointer(
child: Center(
child: Icon(Icons.place, size: 40, color: Colors.redAccent),
child: Transform.translate(
offset: Offset(0, kAddPinYOffset),
child: Icon(Icons.place, size: 40, color: Colors.redAccent),
),
),
),
],