Compare commits

..

22 Commits

Author SHA1 Message Date
stopflock
3868236816 Improve subdomain notation, fix error catching for xyz in tile URL 2025-11-22 22:26:04 -06:00
stopflock
52af77e1ed Add bing sat imagery 2025-11-22 22:00:56 -06:00
stopflock
c150e3ccee Devibe changelog 2025-11-22 17:40:07 -06:00
stopflock
c6cc68c9b4 Add buttons to show welcome message and submission guide on command from about section of settings 2025-11-22 17:19:57 -06:00
stopflock
961465ebb5 Popup message before submitting first node 2025-11-22 14:56:05 -06:00
stopflock
7ff04851f4 Fix tile loading finally 2025-11-22 13:22:17 -06:00
stopflock
3baed3c328 Change suspected locations URL back to alprwatch 2025-11-22 10:42:32 -06:00
stopflock
3ade06eef1 todos, dev mode 2025-11-22 10:40:08 -06:00
stopflock
c7b70dddc4 De-vibe changelog 2025-11-22 00:27:46 -06:00
stopflock
d747c66990 Disallow new/edit nodes below zoom 15, disallow downloads below zoom 10. 2025-11-22 00:17:24 -06:00
stopflock
5673c2b627 Link to view progress in settings after starting an offline area download 2025-11-21 21:08:10 -06:00
stopflock
32a0ac17ad update readme roadmap order 2025-11-21 19:33:17 -06:00
stopflock
dec957790c devibe changelog 2025-11-21 19:26:32 -06:00
stopflock
9319bbda48 Support FOV range notation: 0-360, 90-270, 10-45;90-125 2025-11-21 19:25:34 -06:00
stopflock
ee26576c5e Update changelog 2025-11-21 16:51:35 -06:00
stopflock
d6419d5b7c Turn off dev mode 2025-11-21 16:43:40 -06:00
stopflock
026ece2e29 Update roadmap, bump version to 1.4.3, changelog still needs de-vibing 2025-11-21 15:42:32 -06:00
stopflock
3c996c78c9 Two nodes too close together warning 2025-11-21 15:35:12 -06:00
stopflock
492cf57520 Disable deletion of nodes attached to ways/relations, add option for visibility of WIP extraction feature 2025-11-20 21:17:06 -06:00
stopflock
c77ea96eaf Move OSM account settings and upload queue into their own sections, add "see my edits" button 2025-11-20 20:54:16 -06:00
stopflock
813a0f06da Change prox alerts default and max distance 2025-11-20 20:08:10 -06:00
stopflock
3fc74df616 update roadmap 2025-11-20 14:54:57 -06:00
40 changed files with 2151 additions and 179 deletions

View File

@@ -72,6 +72,7 @@ The app includes a comprehensive system for welcoming new users and notifying ex
### Components
- **ChangelogService**: Manages version tracking and changelog loading
- **WelcomeDialog**: First launch popup with privacy information and quick links
- **SubmissionGuideDialog**: One-time popup before first node submission with best practices
- **ChangelogDialog**: Update notification popup for version changes
- **ReleaseNotesScreen**: Settings page for viewing all changelog history
@@ -96,6 +97,7 @@ Changelog content is stored in `assets/changelog.json`:
### User Experience Flow
- **First Launch**: Welcome popup with "don't show again" option
- **First Submission**: Submission guide popup with best practices and resource links
- **Version Updates**: Changelog popup (only if content exists, no "don't show again")
- **Settings Access**: Complete changelog history available in Settings > About > Release Notes
@@ -123,7 +125,7 @@ The welcome popup explains that the app:
**Key methods:**
- `getNodes()`: Returns cache immediately, triggers pre-fetch if needed (spatial or temporal)
- `getTile()`: Tile fetching with enhanced retry strategy (6 attempts, 1-8s delays)
- `getTile()`: Tile fetching with unlimited retry strategy (retries until success)
- `_fetchRemoteNodes()`: Handles Overpass → OSM API fallback
**Smart caching flow:**
@@ -338,7 +340,36 @@ Most users should contribute to production; testing modes add complexity
bool get showUploadModeSelector => kDebugMode;
```
### 11. Navigation & Routing (Implemented, Awaiting Integration)
### 11. Tile Provider System & URL Templates
**Design approach:**
- **Flexible URL templates**: Support multiple coordinate systems and load-balancing patterns
- **Built-in providers**: Curated set of high-quality, reliable tile sources
- **Custom providers**: Users can add any tile service with full validation
- **API key management**: Secure storage with per-provider API keys
**Supported URL placeholders:**
```
{x}, {y}, {z} - Standard TMS tile coordinates
{quadkey} - Bing Maps quadkey format (alternative to x/y/z)
{0_3} - Subdomain 0-3 for load balancing
{1_4} - Subdomain 1-4 for providers using 1-based indexing
{api_key} - API key insertion point (optional)
```
**Built-in providers:**
- **OpenStreetMap**: Standard street map tiles, no API key required
- **Bing Maps**: High-quality satellite imagery using quadkey system, no API key required
- **Mapbox**: Satellite and street tiles, requires API key
- **OpenTopoMap**: Topographic maps, no API key required
**Validation logic:**
URL templates must contain either `{quadkey}` OR all of `{x}`, `{y}`, and `{z}`. This allows for both standard tile services and specialized formats like Bing Maps.
**Why this approach:**
Provides maximum flexibility while maintaining simplicity. Users can add any tile service without code changes, while built-in providers offer immediate functionality. The quadkey system enables access to high-quality satellite imagery without API key requirements.
### 12. Navigation & Routing (Implemented, Awaiting Integration)
**Current state:**
- **Search functionality**: Fully implemented and active

View File

@@ -21,7 +21,7 @@ A comprehensive Flutter app for mapping public surveillance infrastructure with
- **Map surveillance infrastructure** including cameras, ALPRs, gunshot detectors, and more with precise location, direction, and manufacturer details
- **Upload to OpenStreetMap** with OAuth2 integration (live or sandbox modes)
- **Work completely offline** with downloadable map areas and device data, plus upload queue
- **Multiple map types** including satellite imagery from USGS, Esri, Mapbox, and topographic maps from OpenTopoMap, plus custom map tile provider support
- **Multiple map types** including satellite imagery from Bing Maps, USGS, Esri, Mapbox, and topographic maps from OpenTopoMap, plus custom map tile provider support
- **Editing Ability** to update existing device locations and properties
- **Built-in device profiles** for Flock Safety, Motorola, Genetec, Leonardo, and other major manufacturers, plus custom profiles for more specific tag sets
@@ -30,7 +30,7 @@ A comprehensive Flutter app for mapping public surveillance infrastructure with
## Key Features
### Map & Navigation
- **Multi-source tiles**: Switch between OpenStreetMap, USGS imagery, Esri imagery, Mapbox, OpenTopoMap, and any custom providers
- **Multi-source tiles**: Switch between OpenStreetMap, Bing satellite imagery, USGS imagery, Esri imagery, Mapbox, OpenTopoMap, and any custom providers
- **Offline-first design**: Download a region for complete offline operation
- **Smooth UX**: Intuitive controls, follow-me mode with GPS rotation, compass indicator with north-lock, and gesture-friendly interactions
- **Device visualization**: Color-coded markers showing real devices (blue), pending uploads (purple), pending edits (grey), devices being edited (orange), and pending deletions (red)
@@ -66,7 +66,7 @@ A comprehensive Flutter app for mapping public surveillance infrastructure with
1. **Install** the app on iOS or Android - a welcome popup will guide you through key information
2. **Enable location** permissions
3. **Log into OpenStreetMap**: Choose upload mode and get OAuth2 credentials
4. **Add your first device**: Tap the "New Node" button, position the pin, set direction(s), select a profile, and tap submit
4. **Add your first device**: Tap the "New Node" button, position the pin, set direction(s), select a profile, and tap submit - a guidance popup will help you with best practices on your first submission
5. **Edit or delete devices**: Tap any device marker to view details, then use Edit or Delete buttons
**New to OpenStreetMap?** Visit [deflock.me](https://deflock.me) for complete setup instructions and community guidelines.
@@ -98,16 +98,22 @@ cp lib/keys.dart.example lib/keys.dart
## Roadmap
### Needed Bugfixes
- Update node cache to reflect cleared queue entries
- Are offline areas preferred for fast loading even when online? Check working.
- Fix network indicator - only done when fetch queue is empty!
### Current Development
- Add some builtin satellite tile provider
- Option to pull in profiles from NSI (man_made=surveillance only)
- Persistent cache for MY submissions: clean up when we see that node appear in overpass results or when older than 24h
- Dropdown on "refine tags" page to select acceptable options for camera:mount=
- Tutorial / info guide before submitting first node
- Link to "my changes" on osm (username edit history)
- Decide what to do for extracting nodes attached to a way/relation:
- Auto extract (how?)
- Leave it alone (wrong answer unless user chooses intentionally)
- Manual cleanup (cognitive load for users)
- Delete the old one (also wrong answer unless user chooses intentionally)
- Give multiple of these options??
- Nav start+end too close together error (warning + disable submit button?)
- Persistent cache for MY submissions: assume submissions worked, cache,clean up when we see that node appear in overpass/OSM results or when older than 24h
- Dropdown on "refine tags" page to select acceptable options for camera:mount= (is this a boolean property of a profile?)
- Tutorial / info guide before submitting first node, info and links before creating first profile
- Option to pull in profiles from NSI (man_made=surveillance only?)
### On Pause
- Suspected locations expansion to more regions
@@ -119,6 +125,7 @@ cp lib/keys.dart.example lib/keys.dart
### Future Features & Wishlist
- Update offline area nodes while browsing?
- Offline navigation (pending vector map tiles)
- Android Auto / CarPlay
### Maybes
- Yellow ring for devices missing specific tag details

View File

@@ -1,18 +1,59 @@
{
"1.5.1": {
"content": [
"• NEW: Bing satellite imagery - high-quality satellite tiles used by the iD editor, no API key required",
"• IMPROVED: Enhanced tile provider system with quadkey format support (for Bing Maps and similar providers)",
"• IMPROVED: Flexible subdomain patterns - supports both 0-3 and 1-4 subdomain ranges for load balancing",
"• IMPROVED: Tile URL validation now accepts either {quadkey} or {x}/{y}/{z} coordinate systems"
]
},
"1.5.0": {
"content": [
"• NEW: First-submission guide popup - provides essential guidance and links before your first device submission",
"• NEW: Manual access to dialogs in Settings > About - view welcome message and submission guide anytime"
]
},
"1.4.6": {
"content": [
"• IMPROVED: Tile fetching reliability - removed retry limits so visible tiles always load eventually",
"• FIXED: Queue management - cancel requests for off-screen tiles, ongoing requests continue normally"
]
},
"1.4.5": {
"content": [
"• NEW: Minimum zoom level (Z15) enforced for adding and editing surveillance nodes to ensure precise positioning",
"• NEW: Minimum zoom level (Z10) enforced for offline area downloads to prevent insanely large areas",
"• IMPROVED: Offline area download confirmation now shows as popup with 'View Progress in Settings' button instead of snackbar"
]
},
"1.4.4": {
"content": [
"• FOV range notation parsing - now supports OSM data like '90-270' (180° FOV centered at 180°)",
"• Complex range notation support: 'ESE;90-125;290' displays multiple FOV cones correctly",
"• Profiles now support optional specific FOV values",
"• Smart cone rendering - variable FOV widths, 360° cameras show full circles"
]
},
"1.4.3": {
"content": [
"• NEW: Proximity warning when placing nodes too close together - prevents accidental duplicate submissions"
]
},
"1.4.2": {
"content": [
"• NEW: Dedicated 'Upload Queue' page - queue items are now shown in a proper list view instead of a popup",
"• NEW: 'OpenStreetMap Account' page for managing OSM login and account settings",
"• NEW: 'View My Edits on OSM' button takes you directly to your edit history on OpenStreetMap"
]
},
"1.4.1": {
"content": [
"• NEW: 'Extract node from way/relation' option for constrained nodes",
"• When editing nodes that are part of ways or relations, you can now check 'Extract node from way' to create a new node with the same tags at a new location",
"• This preserves the original node in its way/relation while creating an independent copy that can be moved freely",
"• Useful for cases where surveillance equipment has been relocated but the original node must remain for mapping accuracy",
"• Extraction creates a separate OSM changeset and node, leaving the original node untouched"
"• NEW: 'Extract node from way/relation' option for constrained nodes (currently disabled while we decide what that means)"
]
},
"1.4.0": {
"content": [
"• IMPROVED: Advanced editing options now only show apps available on your platform (iOS/Android)",
"• IMPROVED: When an OSM editor app isn't installed, automatically redirect to the appropriate app store",
"• IMPROVED: Better error handling for external editor launches with app store fallback",
"• Supported editors: Vespucci (Android), StreetComplete (Android), EveryDoor (both), Go Map!! (iOS)",
"• Web editors (iD, RapiD) remain available on all platforms as before"
]
@@ -21,27 +62,17 @@
"content": [
"• NEW: 'Pause Upload Queue' toggle in Offline Settings - stops uploads while keeping live data access",
"• Useful for metered connections or when you want to batch uploads later",
"• Upload queue is now disabled if either full offline mode OR pause queue processing is enabled",
"• FIXED: Sheet buttons now remain visible when rotating from portrait to landscape mode",
"• FIXED: Sheets now properly resize when rotating between orientations without requiring user interaction",
"• IMPROVED: Tag list height adapts automatically for landscape orientation to prevent covering map",
"• IMPROVED: Sheets with few tags now shrink to appropriate size rather than maintaining fixed height",
"• IMPROVED: More reliable sheet layout using proper flexible height constraints",
"• CLEANED: Fixed minor code formatting inconsistencies"
"• FIXED: Sheets now resize when rotating between orientations"
]
},
"1.3.3": {
"content": [
"• UX: Edits re-enabled. Only nodes which are part of ways/relations cannot be moved",
"• NEW: Added builtin surveillance device profiles for Rekor and Axis Communications ALPR cameras",
"• Both profiles include proper OSM tags for manufacturer identification and require direction setting",
"• NEW: Advanced editing options - access iD Editor, RapiD, Vespucci, StreetComplete, and other OSM editors",
"• NEW: 'View on OSM' links to see nodes directly on OpenStreetMap website",
"• UX: Constrained nodes (part of ways/relations) cannot be moved to prevent data corruption",
"• UX: Auto-clickable URLs in all tag values - any URL becomes a tappable link",
"• UX: Tag lists now scroll with max height to keep buttons and map visible",
"• UX: Improved button layout on mobile with two rows for better accessibility",
"• UX: Localized network status messages in all supported languages",
"• FIXED: Duplicate changelog service calls eliminated"
"• UX: Tag lists now scroll with max height to keep buttons and map visible"
]
},
"1.3.2": {

View File

@@ -17,6 +17,8 @@ import 'services/changelog_service.dart';
import 'services/operator_profile_service.dart';
import 'services/profile_service.dart';
import 'widgets/camera_provider_with_cache.dart';
import 'widgets/proximity_warning_dialog.dart';
import 'dev_config.dart';
import 'state/auth_state.dart';
import 'state/navigation_state.dart';
import 'state/operator_profile_state.dart';

View File

@@ -54,10 +54,10 @@ const String kClientName = 'DeFlock';
// Note: Version is now dynamically retrieved from VersionService
// Suspected locations CSV URL
const String kSuspectedLocationsCsvUrl = 'https://stopflock.com/app/flock_utilities_mini_latest.csv';
const String kSuspectedLocationsCsvUrl = 'https://alprwatch.org/suspected-locations/deflock-latest.csv';
// Development/testing features - set to false for production builds
const bool kEnableDevelopmentModes = true; // Set to false to hide sandbox/simulate modes and force production mode
const bool kEnableDevelopmentModes = false; // Set to false to hide sandbox/simulate modes and force production mode
// Navigation features - set to false to hide navigation UI elements while in development
const bool kEnableNavigationFeatures = kEnableDevelopmentModes; // Hide navigation until fully implemented
@@ -65,6 +65,9 @@ const bool kEnableNavigationFeatures = kEnableDevelopmentModes; // Hide navigati
// Node editing features - set to false to temporarily disable editing
const bool kEnableNodeEdits = true; // Set to false to temporarily disable node editing
// Node extraction features - set to false to hide extract functionality for constrained nodes
const bool kEnableNodeExtraction = false; // Set to true to enable extract from way/relation feature (WIP)
/// Navigation availability: only dev builds, and only when online
bool enableNavigationFeatures({required bool offlineMode}) {
if (!kEnableDevelopmentModes) {
@@ -77,6 +80,8 @@ bool enableNavigationFeatures({required bool offlineMode}) {
// Marker/node interaction
const int kNodeMinZoomLevel = 10; // Minimum zoom to show nodes (Overpass)
const int kOsmApiMinZoomLevel = 13; // Minimum zoom for OSM API bbox queries (sandbox mode)
const int kMinZoomForNodeEditingSheets = 15; // Minimum zoom to open add/edit node sheets
const int kMinZoomForOfflineDownload = 10; // Minimum zoom to download offline areas (prevents large area crashes)
const Duration kMarkerTapTimeout = Duration(milliseconds: 250);
const Duration kDebounceCameraRefresh = Duration(milliseconds: 500);
@@ -104,11 +109,14 @@ double getTagListHeightRatio(BuildContext context) {
}
// Proximity alerts configuration
const int kProximityAlertDefaultDistance = 200; // meters
const int kProximityAlertDefaultDistance = 400; // meters
const int kProximityAlertMinDistance = 50; // meters
const int kProximityAlertMaxDistance = 1000; // meters
const int kProximityAlertMaxDistance = 1600; // meters
const Duration kProximityAlertCooldown = Duration(minutes: 10); // Cooldown between alerts for same node
// Node proximity warning configuration (for new/edited nodes that are too close to existing ones)
const double kNodeProximityWarningDistance = 15.0; // meters - distance threshold to show warning
// Map interaction configuration
const double kNodeDoubleTapZoomDelta = 1.0; // How much to zoom in when double-tapping nodes (was 1.0)
const double kScrollWheelVelocity = 0.01; // Mouse scroll wheel zoom speed (default 0.005)
@@ -116,12 +124,13 @@ const double kPinchZoomThreshold = 0.2; // How much pinch required to start zoom
const double kPinchMoveThreshold = 30.0; // How much drag required for two-finger pan (default 40.0)
const double kRotationThreshold = 6.0; // Degrees of rotation required before map actually rotates (Google Maps style)
// Tile fetch retry parameters (configurable backoff system)
const int kTileFetchMaxAttempts = 16; // Number of retry attempts before giving up
const int kTileFetchInitialDelayMs = 500; // Base delay for first retry (1 second)
// Tile fetch configuration (brutalist approach: simple, configurable, unlimited retries)
const int kTileFetchConcurrentThreads = 10; // Number of simultaneous tile downloads
const int kTileFetchInitialDelayMs = 200; // Base delay for first retry (500ms)
const double kTileFetchBackoffMultiplier = 1.5; // Multiply delay by this each attempt
const int kTileFetchMaxDelayMs = 10000; // Cap delays at this value (8 seconds max)
const int kTileFetchRandomJitterMs = 250; // Random fuzz to add (0 to 500ms)
const int kTileFetchMaxDelayMs = 5000; // Cap delays at this value (10 seconds max)
const int kTileFetchRandomJitterMs = 100; // Random fuzz to add (0 to 250ms)
// Note: Removed max attempts - tiles retry indefinitely until they succeed or are canceled
// User download max zoom span (user can download up to kMaxUserDownloadZoomSpan zooms above min)
const int kMaxUserDownloadZoomSpan = 7;

View File

@@ -21,6 +21,24 @@
"advanced": "Erweitert",
"useAdvancedEditor": "Erweiterten Editor verwenden"
},
"proximityWarning": {
"title": "Knoten sehr nah an vorhandenem Gerät",
"message": "Dieser Knoten ist nur {} Meter von einem vorhandenen Überwachungsgerät entfernt.",
"suggestion": "Wenn mehrere Geräte am selben Mast sind, verwenden Sie bitte mehrere Richtungen auf einem einzigen Knoten, anstatt separate Knoten zu erstellen.",
"nearbyNodes": "Nahegelegene Gerät(e) gefunden ({}):",
"nodeInfo": "Knoten #{} - {}",
"andMore": "...und {} weitere",
"goBack": "Zurück",
"submitAnyway": "Trotzdem senden",
"nodeType": {
"alpr": "ALPR/ANPR Kamera",
"publicCamera": "Öffentliche Überwachungskamera",
"camera": "Überwachungskamera",
"amenity": "{}",
"device": "{} Gerät",
"unknown": "Unbekanntes Gerät"
}
},
"followMe": {
"off": "Verfolgung aktivieren",
"follow": "Verfolgung aktivieren (Rotation)",
@@ -100,6 +118,7 @@
"enableSubmittableProfile": "Aktivieren Sie ein übertragbares Profil in den Einstellungen, um Knoten zu bearbeiten.",
"profileViewOnlyWarning": "Dieses Profil ist nur zum Anzeigen der Karte gedacht. Bitte wählen Sie ein übertragbares Profil aus, um Knoten zu bearbeiten.",
"cannotMoveConstrainedNode": "Kann diese Kamera nicht verschieben - sie ist mit einem anderen Kartenelement verbunden (OSM-Weg/Relation). Sie können trotzdem ihre Tags und Richtung bearbeiten.",
"zoomInRequiredMessage": "Zoomen Sie auf mindestens Stufe {} heran, um Überwachungsknoten hinzuzufügen oder zu bearbeiten. Dies gewährleistet eine präzise Positionierung für genaues Kartieren.",
"extractFromWay": "Knoten aus Weg/Relation extrahieren",
"extractFromWaySubtitle": "Neuen Knoten mit gleichen Tags erstellen, Verschieben an neuen Ort ermöglichen",
"refineTags": "Tags Verfeinern",
@@ -115,9 +134,16 @@
"withinTileLimit": "Innerhalb {} Kachel-Limit",
"exceedsTileLimit": "Aktuelle Auswahl überschreitet {} Kachel-Limit",
"offlineModeWarning": "Downloads im Offline-Modus deaktiviert. Deaktivieren Sie den Offline-Modus, um neue Bereiche herunterzuladen.",
"areaTooBigMessage": "Zoomen Sie auf mindestens Stufe {} heran, um Offline-Bereiche herunterzuladen. Downloads großer Gebiete können die App zum Absturz bringen.",
"downloadStarted": "Download gestartet! Lade Kacheln und Knoten...",
"downloadFailed": "Download konnte nicht gestartet werden: {}"
},
"downloadStarted": {
"title": "Download gestartet",
"message": "Download gestartet! Lade Kacheln und Knoten...",
"ok": "OK",
"viewProgress": "Fortschritt in Einstellungen anzeigen"
},
"uploadMode": {
"title": "Upload-Ziel",
"subtitle": "Wählen Sie, wohin Kameras hochgeladen werden",
@@ -129,6 +155,8 @@
"simulateDescription": "Uploads simulieren (kontaktiert OSM-Server nicht)"
},
"auth": {
"osmAccountTitle": "OpenStreetMap-Konto",
"osmAccountSubtitle": "Ihr OSM-Login verwalten und Ihre Beiträge einsehen",
"loggedInAs": "Angemeldet als {}",
"loginToOSM": "Bei OpenStreetMap anmelden",
"tapToLogout": "Zum Abmelden antippen",
@@ -138,6 +166,11 @@
"testConnectionSubtitle": "OSM-Anmeldedaten überprüfen",
"connectionOK": "Verbindung OK - Anmeldedaten sind gültig",
"connectionFailed": "Verbindung fehlgeschlagen - bitte erneut anmelden",
"viewMyEdits": "Meine Änderungen bei OSM Anzeigen",
"viewMyEditsSubtitle": "Ihr Bearbeitungsverlauf bei OpenStreetMap einsehen",
"aboutOSM": "Über OpenStreetMap",
"aboutOSMDescription": "OpenStreetMap ist ein gemeinschaftliches Open-Source-Kartenprojekt, bei dem Mitwirkende eine kostenlose, bearbeitbare Karte der Welt erstellen und pflegen. Ihre Beiträge zu Überwachungsgeräten helfen dabei, diese Infrastruktur sichtbar und durchsuchbar zu machen.",
"visitOSM": "OpenStreetMap Besuchen",
"deleteAccount": "OSM-Konto Löschen",
"deleteAccountSubtitle": "Ihr OpenStreetMap-Konto verwalten",
"deleteAccountExplanation": "Um Ihr OpenStreetMap-Konto zu löschen, müssen Sie die OpenStreetMap-Website besuchen. Dies entfernt dauerhaft Ihr OSM-Konto und alle zugehörigen Daten.",
@@ -145,7 +178,11 @@
"goToOSM": "Zu OpenStreetMap gehen"
},
"queue": {
"title": "Upload-Warteschlange",
"subtitle": "Ausstehende Überwachungsgeräte-Uploads verwalten",
"pendingUploads": "Ausstehende Uploads: {}",
"pendingItemsCount": "Ausstehende Elemente: {}",
"nothingInQueue": "Warteschlange ist leer",
"simulateModeEnabled": "Simulationsmodus aktiviert Uploads simuliert",
"sandboxMode": "Sandbox-Modus Uploads gehen an OSM Sandbox",
"tapToViewQueue": "Zum Anzeigen der Warteschlange antippen",
@@ -198,7 +235,7 @@
"urlTemplate": "URL-Vorlage",
"urlTemplateHint": "https://beispiel.com/{z}/{x}/{y}.png",
"urlTemplateRequired": "URL-Vorlage ist erforderlich",
"urlTemplatePlaceholders": "URL muss {z}, {x} und {y} Platzhalter enthalten",
"urlTemplatePlaceholders": "URL muss entweder {quadkey} oder {z}, {x} und {y} Platzhalter enthalten",
"attribution": "Zuschreibung",
"attributionHint": "© Karten-Anbieter",
"attributionRequired": "Zuschreibung ist erforderlich",
@@ -236,6 +273,10 @@
"profileNameRequired": "Profil-Name ist erforderlich",
"requiresDirection": "Benötigt Richtung",
"requiresDirectionSubtitle": "Ob Kameras dieses Typs ein Richtungs-Tag benötigen",
"fov": "Sichtfeld",
"fovHint": "Sichtfeld in Grad (leer lassen für Standard)",
"fovSubtitle": "Kamera-Sichtfeld - verwendet für Kegelbreite und Bereichsübertragungsformat",
"fovInvalid": "Sichtfeld muss zwischen 1 und 360 Grad liegen",
"submittable": "Übertragbar",
"submittableSubtitle": "Ob dieses Profil für Kamera-Übertragungen verwendet werden kann",
"osmTags": "OSM-Tags",
@@ -351,7 +392,10 @@
"description": "DeFlock ist eine datenschutzorientierte mobile App zur Kartierung öffentlicher Überwachungsinfrastruktür mit OpenStreetMap. Dokumentieren Sie Kameras, ALPRs, Schussdetektoren und andere Überwachungsgeräte in Ihrer Gemeinde, um diese Infrastruktur sichtbar und durchsuchbar zu machen.",
"features": "• Offline-fähige Kartierung mit herunterladbaren Bereichen\n• Direkter Upload zu OpenStreetMap mit OAuth2\n• Integrierte Profile für große Hersteller\n• Datenschutzfreundlich - keine Nutzerdaten gesammelt\n• Multiple Kartenanbieter (OSM, Satellitenbilder)",
"initiative": "Teil der breiteren DeFlock-Initiative zur Förderung von Überwachungstransparenz.",
"footer": "Besuchen Sie: deflock.me\nGebaut mit Flutter • Open Source"
"footer": "Besuchen Sie: deflock.me\nGebaut mit Flutter • Open Source",
"showWelcome": "Willkommensnachricht anzeigen",
"showSubmissionGuide": "Einreichungsleitfaden anzeigen",
"viewReleaseNotes": "Release-Notizen anzeigen"
},
"welcome": {
"title": "Willkommen bei DeFlock",
@@ -364,6 +408,17 @@
"dontShowAgain": "Diese Willkommensnachricht nicht mehr anzeigen",
"getStarted": "Los geht's mit DeFlocking!"
},
"submissionGuide": {
"title": "Einreichungs-Richtlinien",
"description": "Bevor Sie Ihr erstes Überwachungsgerät einreichen, lesen Sie bitte diese wichtigen Richtlinien für qualitativ hochwertige Beiträge zu OpenStreetMap.",
"bestPractices": "• Nur Geräte erfassen, die Sie persönlich beobachtet haben\n• Zeit nehmen für genaue Identifikation von Typ und Hersteller\n• Präzise Positionierung - nah heranzoomen vor Markierung\n• Richtungsinformationen angeben, falls zutreffend\n• Tag-Auswahl vor dem Senden überprüfen",
"placementNote": "Denken Sie daran: Genaue, persönlich verifizierte Daten sind essentiell für die DeFlock-Community und das OpenStreetMap-Projekt.",
"moreInfo": "Für detaillierte Anleitungen zur Geräteerkennung und Kartierung:",
"identificationGuide": "Identifikationsleitfaden",
"osmWiki": "OpenStreetMap Wiki",
"dontShowAgain": "Diese Anleitung nicht mehr anzeigen",
"gotIt": "Verstanden!"
},
"navigation": {
"searchLocation": "Ort suchen",
"searchPlaceholder": "Orte oder Koordinaten suchen...",

View File

@@ -10,7 +10,10 @@
"description": "DeFlock is a privacy-focused mobile app for mapping public surveillance infrastructure using OpenStreetMap. Document cameras, ALPRs, gunshot detectors, and other surveillance devices in your community to make this infrastructure visible and searchable.",
"features": "• Offline-capable mapping with downloadable areas\n• Upload directly to OpenStreetMap with OAuth2\n• Built-in profiles for major manufacturers\n• Privacy-respecting - no user data collected\n• Multiple map tile providers (OSM, satellite imagery)",
"initiative": "Part of the broader DeFlock initiative to promote surveillance transparency.",
"footer": "Visit: deflock.me\nBuilt with Flutter • Open Source"
"footer": "Visit: deflock.me\nBuilt with Flutter • Open Source",
"showWelcome": "Show Welcome Message",
"showSubmissionGuide": "Show Submission Guide",
"viewReleaseNotes": "View Release Notes"
},
"welcome": {
"title": "Welcome to DeFlock",
@@ -23,6 +26,17 @@
"dontShowAgain": "Don't show this welcome message again",
"getStarted": "Let's Get DeFlocking!"
},
"submissionGuide": {
"title": "Submission Best Practices",
"description": "Before submitting your first surveillance device, please take a moment to review these important guidelines to ensure high-quality contributions to OpenStreetMap.",
"bestPractices": "• Only map devices you've personally observed firsthand\n• Take time to accurately identify the device type and manufacturer\n• Use precise positioning - zoom in close before placing the marker\n• Include direction information when applicable\n• Double-check your tag selections before submitting",
"placementNote": "Remember: Accurate, first-hand data is essential for the DeFlock community and OpenStreetMap project.",
"moreInfo": "For detailed guidance on device identification and mapping best practices:",
"identificationGuide": "Identification Guide",
"osmWiki": "OpenStreetMap Wiki",
"dontShowAgain": "Don't show this guide again",
"gotIt": "Got It!"
},
"actions": {
"tagNode": "New Node",
"download": "Download",
@@ -39,6 +53,24 @@
"advanced": "Advanced",
"useAdvancedEditor": "Use Advanced Editor"
},
"proximityWarning": {
"title": "Node Very Close to Existing Device",
"message": "This node is only {} meters from an existing surveillance device.",
"suggestion": "If multiple devices are on the same pole, please use multiple directions on a single node instead of creating separate nodes.",
"nearbyNodes": "Nearby device(s) found ({}):",
"nodeInfo": "Node #{} - {}",
"andMore": "...and {} more",
"goBack": "Go Back",
"submitAnyway": "Submit Anyway",
"nodeType": {
"alpr": "ALPR/ANPR Camera",
"publicCamera": "Public Surveillance Camera",
"camera": "Surveillance Camera",
"amenity": "{}",
"device": "{} Device",
"unknown": "Unknown Device"
}
},
"followMe": {
"off": "Enable follow-me",
"follow": "Enable follow-me (rotating)",
@@ -118,6 +150,7 @@
"enableSubmittableProfile": "Enable a submittable profile in Settings to edit nodes.",
"profileViewOnlyWarning": "This profile is for map viewing only. Please select a submittable profile to edit nodes.",
"cannotMoveConstrainedNode": "Cannot move this camera - it's connected to another map element (OSM way/relation). You can still edit its tags and direction.",
"zoomInRequiredMessage": "Zoom in to at least level {} to add or edit surveillance nodes. This ensures precise positioning for accurate mapping.",
"extractFromWay": "Extract node from way/relation",
"extractFromWaySubtitle": "Create new node with same tags, allow moving to new location",
"refineTags": "Refine Tags",
@@ -133,9 +166,16 @@
"withinTileLimit": "Within {} tile limit",
"exceedsTileLimit": "Current selection exceeds {} tile limit",
"offlineModeWarning": "Downloads disabled while in offline mode. Disable offline mode to download new areas.",
"areaTooBigMessage": "Zoom in to at least level {} to download offline areas. Large area downloads can cause the app to become unresponsive.",
"downloadStarted": "Download started! Fetching tiles and nodes...",
"downloadFailed": "Failed to start download: {}"
},
"downloadStarted": {
"title": "Download Started",
"message": "Download started! Fetching tiles and nodes...",
"ok": "OK",
"viewProgress": "View Progress in Settings"
},
"uploadMode": {
"title": "Upload Destination",
"subtitle": "Choose where cameras are uploaded",
@@ -147,6 +187,8 @@
"simulateDescription": "Simulate uploads (does not contact OSM servers)"
},
"auth": {
"osmAccountTitle": "OpenStreetMap Account",
"osmAccountSubtitle": "Manage your OSM login and view your contributions",
"loggedInAs": "Logged in as {}",
"loginToOSM": "Log in to OpenStreetMap",
"tapToLogout": "Tap to logout",
@@ -156,6 +198,11 @@
"testConnectionSubtitle": "Verify OSM credentials are working",
"connectionOK": "Connection OK - credentials are valid",
"connectionFailed": "Connection failed - please re-login",
"viewMyEdits": "View My Edits on OSM",
"viewMyEditsSubtitle": "See your edit history on OpenStreetMap",
"aboutOSM": "About OpenStreetMap",
"aboutOSMDescription": "OpenStreetMap is a collaborative, open-source mapping project where contributors create and maintain a free, editable map of the world. Your surveillance device contributions help make this infrastructure visible and searchable.",
"visitOSM": "Visit OpenStreetMap",
"deleteAccount": "Delete OSM Account",
"deleteAccountSubtitle": "Manage your OpenStreetMap account",
"deleteAccountExplanation": "To delete your OpenStreetMap account, you'll need to visit the OpenStreetMap website. This will permanently remove your OSM account and all associated data.",
@@ -163,7 +210,11 @@
"goToOSM": "Go to OpenStreetMap"
},
"queue": {
"title": "Upload Queue",
"subtitle": "Manage pending surveillance device uploads",
"pendingUploads": "Pending uploads: {}",
"pendingItemsCount": "Pending Items: {}",
"nothingInQueue": "Nothing in queue",
"simulateModeEnabled": "Simulate mode enabled uploads simulated",
"sandboxMode": "Sandbox mode uploads go to OSM Sandbox",
"tapToViewQueue": "Tap to view queue",
@@ -216,7 +267,7 @@
"urlTemplate": "URL Template",
"urlTemplateHint": "https://example.com/{z}/{x}/{y}.png",
"urlTemplateRequired": "URL template is required",
"urlTemplatePlaceholders": "URL must contain {z}, {x}, and {y} placeholders",
"urlTemplatePlaceholders": "URL must contain either {quadkey} or {z}, {x}, and {y} placeholders",
"attribution": "Attribution",
"attributionHint": "© Map Provider",
"attributionRequired": "Attribution is required",
@@ -254,6 +305,10 @@
"profileNameRequired": "Profile name is required",
"requiresDirection": "Requires Direction",
"requiresDirectionSubtitle": "Whether cameras of this type need a direction tag",
"fov": "Field of View",
"fovHint": "FOV in degrees (leave empty for default)",
"fovSubtitle": "Camera field of view - used for cone width and range submission format",
"fovInvalid": "FOV must be between 1 and 360 degrees",
"submittable": "Submittable",
"submittableSubtitle": "Whether this profile can be used for camera submissions",
"osmTags": "OSM Tags",

View File

@@ -10,7 +10,10 @@
"description": "DeFlock es una aplicación móvil enfocada en la privacidad para mapear infraestructura de vigilancia pública usando OpenStreetMap. Documenta cámaras, ALPRs, detectores de disparos y otros dispositivos de vigilancia en tu comunidad para hacer visible y consultable esta infraestructura.",
"features": "• Mapeo con capacidad offline con áreas descargables\n• Subida directa a OpenStreetMap con OAuth2\n• Perfiles integrados para fabricantes principales\n• Respeta la privacidad - no se recopilan datos del usuario\n• Múltiples proveedores de mapas (OSM, imágenes satelitales)",
"initiative": "Parte de la iniciativa más amplia DeFlock para promover la transparencia en vigilancia.",
"footer": "Visita: deflock.me\nConstruido con Flutter • Código Abierto"
"footer": "Visita: deflock.me\nConstruido con Flutter • Código Abierto",
"showWelcome": "Mostrar Mensaje de Bienvenida",
"showSubmissionGuide": "Mostrar Guía de Envío",
"viewReleaseNotes": "Ver Notas de Lanzamiento"
},
"welcome": {
"title": "Bienvenido a DeFlock",
@@ -23,6 +26,17 @@
"dontShowAgain": "No mostrar este mensaje de bienvenida otra vez",
"getStarted": "¡Comencemos con DeFlock!"
},
"submissionGuide": {
"title": "Mejores Prácticas de Envío",
"description": "Antes de enviar su primer dispositivo de vigilancia, tómese un momento para revisar estas pautas importantes para contribuciones de alta calidad a OpenStreetMap.",
"bestPractices": "• Solo mapee dispositivos que haya observado personalmente\n• Tómese tiempo para identificar con precisión el tipo y fabricante\n• Use posicionamiento preciso - acerque antes de colocar el marcador\n• Incluya información de dirección cuando sea aplicable\n• Verifique sus selecciones de etiquetas antes de enviar",
"placementNote": "Recuerde: Los datos precisos y de primera mano son esenciales para la comunidad DeFlock y el proyecto OpenStreetMap.",
"moreInfo": "Para orientación detallada sobre identificación de dispositivos y mejores prácticas de mapeo:",
"identificationGuide": "Guía de Identificación",
"osmWiki": "Wiki de OpenStreetMap",
"dontShowAgain": "No mostrar esta guía otra vez",
"gotIt": "¡Entendido!"
},
"actions": {
"tagNode": "Nuevo Nodo",
"download": "Descargar",
@@ -39,6 +53,24 @@
"advanced": "Avanzado",
"useAdvancedEditor": "Usar Editor Avanzado"
},
"proximityWarning": {
"title": "Nodo Muy Cerca de Dispositivo Existente",
"message": "Este nodo está a solo {} metros de un dispositivo de vigilancia existente.",
"suggestion": "Si hay múltiples dispositivos en el mismo poste, use múltiples direcciones en un solo nodo en lugar de crear nodos separados.",
"nearbyNodes": "Dispositivo(s) cercano(s) encontrado(s) ({}):",
"nodeInfo": "Nodo #{} - {}",
"andMore": "...y {} más",
"goBack": "Volver",
"submitAnyway": "Enviar de Todas Formas",
"nodeType": {
"alpr": "Cámara ALPR/ANPR",
"publicCamera": "Cámara de Vigilancia Pública",
"camera": "Cámara de Vigilancia",
"amenity": "{}",
"device": "Dispositivo {}",
"unknown": "Dispositivo Desconocido"
}
},
"followMe": {
"off": "Activar seguimiento",
"follow": "Activar seguimiento (rotación)",
@@ -118,6 +150,7 @@
"enableSubmittableProfile": "Habilite un perfil envíable en Configuración para editar nodos.",
"profileViewOnlyWarning": "Este perfil es solo para visualización del mapa. Por favor, seleccione un perfil envíable para editar nodos.",
"cannotMoveConstrainedNode": "No se puede mover esta cámara - está conectada a otro elemento del mapa (OSM way/relation). Aún puede editar sus etiquetas y dirección.",
"zoomInRequiredMessage": "Amplíe al menos al nivel {} para agregar o editar nodos de vigilancia. Esto garantiza un posicionamiento preciso para un mapeo exacto.",
"extractFromWay": "Extraer nodo de way/relation",
"extractFromWaySubtitle": "Crear nuevo nodo con las mismas etiquetas, permitir mover a nueva ubicación",
"refineTags": "Refinar Etiquetas",
@@ -133,9 +166,16 @@
"withinTileLimit": "Dentro del límite de {} mosaicos",
"exceedsTileLimit": "La selección actual excede el límite de {} mosaicos",
"offlineModeWarning": "Descargas deshabilitadas en modo sin conexión. Deshabilite el modo sin conexión para descargar nuevas áreas.",
"areaTooBigMessage": "Amplíe al menos al nivel {} para descargar áreas sin conexión. Las descargas de áreas grandes pueden hacer que la aplicación deje de responder.",
"downloadStarted": "¡Descarga iniciada! Obteniendo mosaicos y nodos...",
"downloadFailed": "Error al iniciar la descarga: {}"
},
"downloadStarted": {
"title": "Descarga Iniciada",
"message": "¡Descarga iniciada! Obteniendo mosaicos y nodos...",
"ok": "OK",
"viewProgress": "Ver Progreso en Configuración"
},
"uploadMode": {
"title": "Destino de Subida",
"subtitle": "Elige dónde se suben las cámaras",
@@ -147,6 +187,8 @@
"simulateDescription": "Simular subidas (no contacta servidores OSM)"
},
"auth": {
"osmAccountTitle": "Cuenta de OpenStreetMap",
"osmAccountSubtitle": "Gestionar tu login de OSM y ver tus contribuciones",
"loggedInAs": "Conectado como {}",
"loginToOSM": "Iniciar sesión en OpenStreetMap",
"tapToLogout": "Toque para cerrar sesión",
@@ -156,6 +198,11 @@
"testConnectionSubtitle": "Verificar que las credenciales de OSM funcionen",
"connectionOK": "Conexión OK - las credenciales son válidas",
"connectionFailed": "Conexión falló - por favor, inicie sesión nuevamente",
"viewMyEdits": "Ver Mis Ediciones en OSM",
"viewMyEditsSubtitle": "Ver tu historial de ediciones en OpenStreetMap",
"aboutOSM": "Acerca de OpenStreetMap",
"aboutOSMDescription": "OpenStreetMap es un proyecto de mapeo colaborativo de código abierto donde los contribuyentes crean y mantienen un mapa gratuito y editable del mundo. Tus contribuciones de dispositivos de vigilancia ayudan a hacer visible y buscable esta infraestructura.",
"visitOSM": "Visitar OpenStreetMap",
"deleteAccount": "Eliminar Cuenta OSM",
"deleteAccountSubtitle": "Gestiona tu cuenta de OpenStreetMap",
"deleteAccountExplanation": "Para eliminar tu cuenta de OpenStreetMap, necesitarás visitar el sitio web de OpenStreetMap. Esto eliminará permanentemente tu cuenta OSM y todos los datos asociados.",
@@ -163,7 +210,11 @@
"goToOSM": "Ir a OpenStreetMap"
},
"queue": {
"title": "Cola de Subida",
"subtitle": "Gestionar subidas pendientes de dispositivos de vigilancia",
"pendingUploads": "Subidas pendientes: {}",
"pendingItemsCount": "Elementos Pendientes: {}",
"nothingInQueue": "No hay nada en la cola",
"simulateModeEnabled": "Modo simulación activado subidas simuladas",
"sandboxMode": "Modo sandbox subidas van al Sandbox OSM",
"tapToViewQueue": "Toque para ver cola",
@@ -216,7 +267,7 @@
"urlTemplate": "Plantilla de URL",
"urlTemplateHint": "https://ejemplo.com/{z}/{x}/{y}.png",
"urlTemplateRequired": "La plantilla de URL es requerida",
"urlTemplatePlaceholders": "La URL debe contener marcadores {z}, {x} y {y}",
"urlTemplatePlaceholders": "La URL debe contener marcadores {quadkey} o {z}, {x} y {y}",
"attribution": "Atribución",
"attributionHint": "© Proveedor de Mapas",
"attributionRequired": "La atribución es requerida",
@@ -254,6 +305,10 @@
"profileNameRequired": "El nombre del perfil es requerido",
"requiresDirection": "Requiere Dirección",
"requiresDirectionSubtitle": "Si las cámaras de este tipo necesitan una etiqueta de dirección",
"fov": "Campo de Visión",
"fovHint": "Campo de visión en grados (dejar vacío para el predeterminado)",
"fovSubtitle": "Campo de visión de la cámara - usado para el ancho del cono y formato de envío por rango",
"fovInvalid": "El campo de visión debe estar entre 1 y 360 grados",
"submittable": "Envíable",
"submittableSubtitle": "Si este perfil puede usarse para envíos de cámaras",
"osmTags": "Etiquetas OSM",

View File

@@ -10,7 +10,10 @@
"description": "DeFlock est une application mobile axée sur la confidentialité pour cartographier l'infrastructure de surveillance publique en utilisant OpenStreetMap. Documentez les caméras, ALPRs, détecteurs de coups de feu et autres dispositifs de surveillance dans votre communauté pour rendre cette infrastructure visible et consultable.",
"features": "• Cartographie hors ligne avec zones téléchargeables\n• Upload direct vers OpenStreetMap avec OAuth2\n• Profils intégrés pour les principaux fabricants\n• Respectueux de la confidentialité - aucune donnée utilisateur collectée\n• Multiples fournisseurs de cartes (OSM, imagerie satellite)",
"initiative": "Partie de l'initiative plus large DeFlock pour promouvoir la transparence de la surveillance.",
"footer": "Visitez : deflock.me\nConstruit avec Flutter • Source Ouverte"
"footer": "Visitez : deflock.me\nConstruit avec Flutter • Source Ouverte",
"showWelcome": "Afficher le Message de Bienvenue",
"showSubmissionGuide": "Afficher le Guide de Soumission",
"viewReleaseNotes": "Voir les Notes de Version"
},
"welcome": {
"title": "Bienvenue dans DeFlock",
@@ -23,6 +26,17 @@
"dontShowAgain": "Ne plus afficher ce message de bienvenue",
"getStarted": "Commençons le DeFlock !"
},
"submissionGuide": {
"title": "Meilleures Pratiques de Soumission",
"description": "Avant de soumettre votre premier dispositif de surveillance, prenez un moment pour examiner ces directives importantes pour des contributions de haute qualité à OpenStreetMap.",
"bestPractices": "• Ne cartographiez que les dispositifs que vous avez observés personnellement\n• Prenez le temps d'identifier avec précision le type et le fabricant\n• Utilisez un positionnement précis - zoomez avant de placer le marqueur\n• Incluez les informations de direction quand c'est applicable\n• Vérifiez vos sélections d'étiquettes avant de soumettre",
"placementNote": "Rappelez-vous : Des données précises et de première main sont essentielles pour la communauté DeFlock et le projet OpenStreetMap.",
"moreInfo": "Pour des conseils détaillés sur l'identification des dispositifs et les meilleures pratiques de cartographie :",
"identificationGuide": "Guide d'Identification",
"osmWiki": "Wiki OpenStreetMap",
"dontShowAgain": "Ne plus afficher ce guide",
"gotIt": "Compris !"
},
"actions": {
"tagNode": "Nouveau Nœud",
"download": "Télécharger",
@@ -39,6 +53,24 @@
"advanced": "Avancé",
"useAdvancedEditor": "Utiliser l'Éditeur Avancé"
},
"proximityWarning": {
"title": "Nœud Très Proche d'un Dispositif Existant",
"message": "Ce nœud n'est qu'à {} mètres d'un dispositif de surveillance existant.",
"suggestion": "Si plusieurs dispositifs se trouvent sur le même poteau, veuillez utiliser plusieurs directions sur un seul nœud au lieu de créer des nœuds séparés.",
"nearbyNodes": "Dispositif(s) proche(s) trouvé(s) ({}) :",
"nodeInfo": "Nœud #{} - {}",
"andMore": "...et {} de plus",
"goBack": "Retour",
"submitAnyway": "Soumettre Quand Même",
"nodeType": {
"alpr": "Caméra ALPR/ANPR",
"publicCamera": "Caméra de Surveillance Publique",
"camera": "Caméra de Surveillance",
"amenity": "{}",
"device": "Dispositif {}",
"unknown": "Dispositif Inconnu"
}
},
"followMe": {
"off": "Activer le suivi",
"follow": "Activer le suivi (rotation)",
@@ -118,6 +150,7 @@
"enableSubmittableProfile": "Activez un profil soumissible dans les Paramètres pour modifier les nœuds.",
"profileViewOnlyWarning": "Ce profil est uniquement pour la visualisation de la carte. Veuillez sélectionner un profil soumissible pour modifier les nœuds.",
"cannotMoveConstrainedNode": "Impossible de déplacer cette caméra - elle est connectée à un autre élément de carte (OSM way/relation). Vous pouvez toujours modifier ses balises et sa direction.",
"zoomInRequiredMessage": "Zoomez au moins au niveau {} pour ajouter ou modifier des nœuds de surveillance. Cela garantit un positionnement précis pour une cartographie exacte.",
"extractFromWay": "Extraire le nœud du way/relation",
"extractFromWaySubtitle": "Créer un nouveau nœud avec les mêmes balises, permettre le déplacement vers un nouvel emplacement",
"refineTags": "Affiner Balises",
@@ -133,9 +166,16 @@
"withinTileLimit": "Dans la limite de {} tuiles",
"exceedsTileLimit": "La sélection actuelle dépasse la limite de {} tuiles",
"offlineModeWarning": "Téléchargements désactivés en mode hors ligne. Désactivez le mode hors ligne pour télécharger de nouvelles zones.",
"downloadStarted": "Téléchargement démarré! Récupération des tuiles et nœuds...",
"areaTooBigMessage": "Zoomez au moins au niveau {} pour télécharger des zones hors ligne. Les téléchargements de grandes zones peuvent rendre l'application non réactive.",
"downloadStarted": "Téléchargement démarré ! Récupération des tuiles et nœuds...",
"downloadFailed": "Échec du démarrage du téléchargement: {}"
},
"downloadStarted": {
"title": "Téléchargement Démarré",
"message": "Téléchargement démarré! Récupération des tuiles et nœuds...",
"ok": "OK",
"viewProgress": "Voir le Progrès dans Paramètres"
},
"uploadMode": {
"title": "Destination de Téléchargement",
"subtitle": "Choisir où les caméras sont téléchargées",
@@ -147,6 +187,8 @@
"simulateDescription": "Simuler les téléchargements (ne contacte pas les serveurs OSM)"
},
"auth": {
"osmAccountTitle": "Compte OpenStreetMap",
"osmAccountSubtitle": "Gérer votre connexion OSM et voir vos contributions",
"loggedInAs": "Connecté en tant que {}",
"loginToOSM": "Se connecter à OpenStreetMap",
"tapToLogout": "Appuyer pour se déconnecter",
@@ -156,6 +198,11 @@
"testConnectionSubtitle": "Vérifier que les identifiants OSM fonctionnent",
"connectionOK": "Connexion OK - les identifiants sont valides",
"connectionFailed": "Connexion échouée - veuillez vous reconnecter",
"viewMyEdits": "Voir Mes Modifications sur OSM",
"viewMyEditsSubtitle": "Voir votre historique de modifications sur OpenStreetMap",
"aboutOSM": "À Propos d'OpenStreetMap",
"aboutOSMDescription": "OpenStreetMap est un projet cartographique collaboratif open source où les contributeurs créent et maintiennent une carte gratuite et modifiable du monde. Vos contributions de dispositifs de surveillance aident à rendre cette infrastructure visible et consultable.",
"visitOSM": "Visiter OpenStreetMap",
"deleteAccount": "Supprimer Compte OSM",
"deleteAccountSubtitle": "Gérez votre compte OpenStreetMap",
"deleteAccountExplanation": "Pour supprimer votre compte OpenStreetMap, vous devrez visiter le site web OpenStreetMap. Cela supprimera définitivement votre compte OSM et toutes les données associées.",
@@ -163,7 +210,11 @@
"goToOSM": "Aller à OpenStreetMap"
},
"queue": {
"title": "File de Téléchargement",
"subtitle": "Gérer les téléchargements de dispositifs de surveillance en attente",
"pendingUploads": "Téléchargements en attente: {}",
"pendingItemsCount": "Éléments en Attente: {}",
"nothingInQueue": "Rien dans la file",
"simulateModeEnabled": "Mode simulation activé téléchargements simulés",
"sandboxMode": "Mode sandbox téléchargements vont vers OSM Sandbox",
"tapToViewQueue": "Appuyer pour voir la file",
@@ -216,7 +267,7 @@
"urlTemplate": "Modèle d'URL",
"urlTemplateHint": "https://exemple.com/{z}/{x}/{y}.png",
"urlTemplateRequired": "Le modèle d'URL est requis",
"urlTemplatePlaceholders": "L'URL doit contenir les marqueurs {z}, {x} et {y}",
"urlTemplatePlaceholders": "L'URL doit contenir soit {quadkey} soit les marqueurs {z}, {x} et {y}",
"attribution": "Attribution",
"attributionHint": "© Fournisseur de Cartes",
"attributionRequired": "L'attribution est requise",
@@ -254,6 +305,10 @@
"profileNameRequired": "Le nom du profil est requis",
"requiresDirection": "Nécessite Direction",
"requiresDirectionSubtitle": "Si les caméras de ce type ont besoin d'une balise de direction",
"fov": "Champ de Vision",
"fovHint": "Champ de vision en degrés (laisser vide pour la valeur par défaut)",
"fovSubtitle": "Champ de vision de la caméra - utilisé pour la largeur du cône et le format de soumission par plage",
"fovInvalid": "Le champ de vision doit être entre 1 et 360 degrés",
"submittable": "Soumissible",
"submittableSubtitle": "Si ce profil peut être utilisé pour les soumissions de caméras",
"osmTags": "Balises OSM",

View File

@@ -10,7 +10,10 @@
"description": "DeFlock è un'app mobile orientata alla privacy per mappare l'infrastruttura di sorveglianza pubblica utilizzando OpenStreetMap. Documenta telecamere, ALPR, rilevatori di spari e altri dispositivi di sorveglianza nella tua comunità per rendere questa infrastruttura visibile e ricercabile.",
"features": "• Mappatura con capacità offline con aree scaricabili\n• Upload diretto su OpenStreetMap con OAuth2\n• Profili integrati per i principali produttori\n• Rispettoso della privacy - nessun dato utente raccolto\n• Multipli fornitori di mappe (OSM, immagini satellitari)",
"initiative": "Parte della più ampia iniziativa DeFlock per promuovere la trasparenza della sorveglianza.",
"footer": "Visita: deflock.me\nCostruito con Flutter • Open Source"
"footer": "Visita: deflock.me\nCostruito con Flutter • Open Source",
"showWelcome": "Mostra Messaggio di Benvenuto",
"showSubmissionGuide": "Mostra Guida di Invio",
"viewReleaseNotes": "Visualizza Note di Rilascio"
},
"welcome": {
"title": "Benvenuto in DeFlock",
@@ -23,6 +26,17 @@
"dontShowAgain": "Non mostrare più questo messaggio di benvenuto",
"getStarted": "Iniziamo con DeFlock!"
},
"submissionGuide": {
"title": "Migliori Pratiche di Invio",
"description": "Prima di inviare il tuo primo dispositivo di sorveglianza, prenditi un momento per rivedere queste linee guida importanti per contributi di alta qualità a OpenStreetMap.",
"bestPractices": "• Mappa solo dispositivi che hai osservato personalmente\n• Prenditi tempo per identificare accuratamente tipo e produttore\n• Usa posizionamento preciso - ingrandisci prima di piazzare il marcatore\n• Includi informazioni sulla direzione quando applicabile\n• Controlla le tue selezioni di tag prima di inviare",
"placementNote": "Ricorda: Dati accurati e di prima mano sono essenziali per la comunità DeFlock e il progetto OpenStreetMap.",
"moreInfo": "Per una guida dettagliata sull'identificazione dei dispositivi e le migliori pratiche di mappatura:",
"identificationGuide": "Guida di Identificazione",
"osmWiki": "Wiki OpenStreetMap",
"dontShowAgain": "Non mostrare più questa guida",
"gotIt": "Capito!"
},
"actions": {
"tagNode": "Nuovo Nodo",
"download": "Scarica",
@@ -39,6 +53,24 @@
"advanced": "Avanzato",
"useAdvancedEditor": "Usa Editor Avanzato"
},
"proximityWarning": {
"title": "Nodo Molto Vicino a Dispositivo Esistente",
"message": "Questo nodo è a soli {} metri da un dispositivo di sorveglianza esistente.",
"suggestion": "Se ci sono più dispositivi sullo stesso palo, utilizzare più direzioni su un singolo nodo invece di creare nodi separati.",
"nearbyNodes": "Dispositivo/i vicino/i trovato/i ({}):",
"nodeInfo": "Nodo #{} - {}",
"andMore": "...e altri {}",
"goBack": "Torna Indietro",
"submitAnyway": "Invia Comunque",
"nodeType": {
"alpr": "Telecamera ALPR/ANPR",
"publicCamera": "Telecamera di Sorveglianza Pubblica",
"camera": "Telecamera di Sorveglianza",
"amenity": "{}",
"device": "Dispositivo {}",
"unknown": "Dispositivo Sconosciuto"
}
},
"followMe": {
"off": "Attiva seguimi",
"follow": "Attiva seguimi (rotazione)",
@@ -118,6 +150,7 @@
"enableSubmittableProfile": "Abilita un profilo inviabile nelle Impostazioni per modificare i nodi.",
"profileViewOnlyWarning": "Questo profilo è solo per la visualizzazione della mappa. Per favore seleziona un profilo inviabile per modificare i nodi.",
"cannotMoveConstrainedNode": "Impossibile spostare questa telecamera - è collegata a un altro elemento della mappa (OSM way/relation). Puoi ancora modificare i suoi tag e direzione.",
"zoomInRequiredMessage": "Ingrandisci almeno al livello {} per aggiungere o modificare nodi di sorveglianza. Questo garantisce un posizionamento preciso per una mappatura accurata.",
"extractFromWay": "Estrai nodo da way/relation",
"extractFromWaySubtitle": "Crea nuovo nodo con gli stessi tag, consenti spostamento in nuova posizione",
"refineTags": "Affina Tag",
@@ -133,9 +166,16 @@
"withinTileLimit": "Entro il limite di {} tile",
"exceedsTileLimit": "La selezione corrente supera il limite di {} tile",
"offlineModeWarning": "Download disabilitati in modalità offline. Disabilita la modalità offline per scaricare nuove aree.",
"areaTooBigMessage": "Ingrandisci almeno al livello {} per scaricare aree offline. I download di aree grandi possono rendere l'app non reattiva.",
"downloadStarted": "Download avviato! Recupero tile e nodi...",
"downloadFailed": "Impossibile avviare il download: {}"
},
"downloadStarted": {
"title": "Download Avviato",
"message": "Download avviato! Recupero tile e nodi...",
"ok": "OK",
"viewProgress": "Visualizza Progresso in Impostazioni"
},
"uploadMode": {
"title": "Destinazione Upload",
"subtitle": "Scegli dove vengono caricate le telecamere",
@@ -147,6 +187,8 @@
"simulateDescription": "Simula upload (non contatta i server OSM)"
},
"auth": {
"osmAccountTitle": "Account OpenStreetMap",
"osmAccountSubtitle": "Gestisci il tuo login OSM e visualizza i tuoi contributi",
"loggedInAs": "Loggato come {}",
"loginToOSM": "Accedi a OpenStreetMap",
"tapToLogout": "Tocca per disconnetterti",
@@ -156,6 +198,11 @@
"testConnectionSubtitle": "Verifica che le credenziali OSM funzionino",
"connectionOK": "Connessione OK - le credenziali sono valide",
"connectionFailed": "Connessione fallita - per favore accedi di nuovo",
"viewMyEdits": "Visualizza le Mie Modifiche su OSM",
"viewMyEditsSubtitle": "Visualizza la cronologia delle tue modifiche su OpenStreetMap",
"aboutOSM": "Informazioni su OpenStreetMap",
"aboutOSMDescription": "OpenStreetMap è un progetto cartografico collaborativo open source dove i contributori creano e mantengono una mappa gratuita e modificabile del mondo. I tuoi contributi sui dispositivi di sorveglianza aiutano a rendere visibile e ricercabile questa infrastruttura.",
"visitOSM": "Visita OpenStreetMap",
"deleteAccount": "Elimina Account OSM",
"deleteAccountSubtitle": "Gestisci il tuo account OpenStreetMap",
"deleteAccountExplanation": "Per eliminare il tuo account OpenStreetMap, dovrai visitare il sito web di OpenStreetMap. Questo rimuoverà permanentemente il tuo account OSM e tutti i dati associati.",
@@ -163,7 +210,11 @@
"goToOSM": "Vai a OpenStreetMap"
},
"queue": {
"title": "Coda di Upload",
"subtitle": "Gestisci gli upload di dispositivi di sorveglianza in sospeso",
"pendingUploads": "Upload in sospeso: {}",
"pendingItemsCount": "Elementi in Sospeso: {}",
"nothingInQueue": "Niente in coda",
"simulateModeEnabled": "Modalità simulazione abilitata upload simulati",
"sandboxMode": "Modalità sandbox upload vanno alla Sandbox OSM",
"tapToViewQueue": "Tocca per vedere la coda",
@@ -216,7 +267,7 @@
"urlTemplate": "Template URL",
"urlTemplateHint": "https://esempio.com/{z}/{x}/{y}.png",
"urlTemplateRequired": "Il template URL è obbligatorio",
"urlTemplatePlaceholders": "L'URL deve contenere i segnaposto {z}, {x} e {y}",
"urlTemplatePlaceholders": "L'URL deve contenere o {quadkey} o i segnaposto {z}, {x} e {y}",
"attribution": "Attribuzione",
"attributionHint": "© Fornitore Mappe",
"attributionRequired": "L'attribuzione è obbligatoria",
@@ -254,6 +305,10 @@
"profileNameRequired": "Il nome del profilo è obbligatorio",
"requiresDirection": "Richiede Direzione",
"requiresDirectionSubtitle": "Se le telecamere di questo tipo necessitano di un tag direzione",
"fov": "Campo Visivo",
"fovHint": "Campo visivo in gradi (lasciare vuoto per il valore predefinito)",
"fovSubtitle": "Campo visivo della telecamera - utilizzato per la larghezza del cono e il formato di invio per intervallo",
"fovInvalid": "Il campo visivo deve essere tra 1 e 360 gradi",
"submittable": "Inviabile",
"submittableSubtitle": "Se questo profilo può essere usato per invii di telecamere",
"osmTags": "Tag OSM",

View File

@@ -10,7 +10,10 @@
"description": "DeFlock é um aplicativo móvel focado na privacidade para mapear infraestrutura de vigilância pública usando OpenStreetMap. Documente câmeras, ALPRs, detectores de tiros e outros dispositivos de vigilância em sua comunidade para tornar essa infraestrutura visível e pesquisável.",
"features": "• Mapeamento com capacidade offline com áreas para download\n• Upload direto para OpenStreetMap com OAuth2\n• Perfis integrados para principais fabricantes\n• Respeitoso à privacidade - nenhum dado do usuário coletado\n• Múltiplos provedores de mapas (OSM, imagens de satélite)",
"initiative": "Parte da iniciativa mais ampla DeFlock para promover transparência na vigilância.",
"footer": "Visite: deflock.me\nConstruído com Flutter • Código Aberto"
"footer": "Visite: deflock.me\nConstruído com Flutter • Código Aberto",
"showWelcome": "Mostrar Mensagem de Boas-vindas",
"showSubmissionGuide": "Mostrar Guia de Submissão",
"viewReleaseNotes": "Ver Notas de Lançamento"
},
"welcome": {
"title": "Bem-vindo ao DeFlock",
@@ -23,6 +26,17 @@
"dontShowAgain": "Não mostrar esta mensagem de boas-vindas novamente",
"getStarted": "Vamos começar com o DeFlock!"
},
"submissionGuide": {
"title": "Melhores Práticas de Submissão",
"description": "Antes de submeter seu primeiro dispositivo de vigilância, dedique um momento para revisar estas diretrizes importantes para contribuições de alta qualidade ao OpenStreetMap.",
"bestPractices": "• Mapear apenas dispositivos que você observou pessoalmente\n• Dedicar tempo para identificar com precisão tipo e fabricante\n• Usar posicionamento preciso - aproximar antes de colocar o marcador\n• Incluir informações de direção quando aplicável\n• Verificar suas seleções de tags antes de submeter",
"placementNote": "Lembre-se: Dados precisos e de primeira mão são essenciais para a comunidade DeFlock e o projeto OpenStreetMap.",
"moreInfo": "Para orientação detalhada sobre identificação de dispositivos e melhores práticas de mapeamento:",
"identificationGuide": "Guia de Identificação",
"osmWiki": "Wiki OpenStreetMap",
"dontShowAgain": "Não mostrar este guia novamente",
"gotIt": "Entendi!"
},
"actions": {
"tagNode": "Novo Nó",
"download": "Baixar",
@@ -39,6 +53,24 @@
"advanced": "Avançado",
"useAdvancedEditor": "Usar Editor Avançado"
},
"proximityWarning": {
"title": "Nó Muito Próximo de Dispositivo Existente",
"message": "Este nó está a apenas {} metros de um dispositivo de vigilância existente.",
"suggestion": "Se vários dispositivos estão no mesmo poste, use várias direções em um único nó em vez de criar nós separados.",
"nearbyNodes": "Dispositivo(s) próximo(s) encontrado(s) ({}):",
"nodeInfo": "Nó #{} - {}",
"andMore": "...e mais {}",
"goBack": "Voltar",
"submitAnyway": "Enviar Mesmo Assim",
"nodeType": {
"alpr": "Câmera ALPR/ANPR",
"publicCamera": "Câmera de Vigilância Pública",
"camera": "Câmera de Vigilância",
"amenity": "{}",
"device": "Dispositivo {}",
"unknown": "Dispositivo Desconhecido"
}
},
"followMe": {
"off": "Ativar seguir-me",
"follow": "Ativar seguir-me (rotação)",
@@ -118,6 +150,7 @@
"enableSubmittableProfile": "Ative um perfil enviável nas Configurações para editar nós.",
"profileViewOnlyWarning": "Este perfil é apenas para visualização do mapa. Por favor, selecione um perfil enviável para editar nós.",
"cannotMoveConstrainedNode": "Não é possível mover esta câmera - ela está conectada a outro elemento do mapa (OSM way/relation). Você ainda pode editar suas tags e direção.",
"zoomInRequiredMessage": "Amplie para pelo menos o nível {} para adicionar ou editar nós de vigilância. Isto garante um posicionamento preciso para mapeamento exato.",
"extractFromWay": "Extrair nó do way/relation",
"extractFromWaySubtitle": "Criar novo nó com as mesmas tags, permitir mover para nova localização",
"refineTags": "Refinar Tags",
@@ -133,9 +166,16 @@
"withinTileLimit": "Dentro do limite de {} tiles",
"exceedsTileLimit": "A seleção atual excede o limite de {} tiles",
"offlineModeWarning": "Downloads desabilitados no modo offline. Desative o modo offline para baixar novas áreas.",
"areaTooBigMessage": "Amplie para pelo menos o nível {} para baixar áreas offline. Downloads de áreas grandes podem tornar o aplicativo não responsivo.",
"downloadStarted": "Download iniciado! Buscando tiles e nós...",
"downloadFailed": "Falha ao iniciar o download: {}"
},
"downloadStarted": {
"title": "Download Iniciado",
"message": "Download iniciado! Buscando tiles e nós...",
"ok": "OK",
"viewProgress": "Ver Progresso nas Configurações"
},
"uploadMode": {
"title": "Destino do Upload",
"subtitle": "Escolha onde as câmeras são enviadas",
@@ -147,6 +187,8 @@
"simulateDescription": "Simular uploads (não contacta servidores OSM)"
},
"auth": {
"osmAccountTitle": "Conta OpenStreetMap",
"osmAccountSubtitle": "Gerencie seu login OSM e visualize suas contribuições",
"loggedInAs": "Logado como {}",
"loginToOSM": "Fazer login no OpenStreetMap",
"tapToLogout": "Toque para sair",
@@ -156,6 +198,11 @@
"testConnectionSubtitle": "Verificar se as credenciais OSM estão funcionando",
"connectionOK": "Conexão OK - credenciais são válidas",
"connectionFailed": "Conexão falhou - por favor, faça login novamente",
"viewMyEdits": "Ver Minhas Edições no OSM",
"viewMyEditsSubtitle": "Ver seu histórico de edições no OpenStreetMap",
"aboutOSM": "Sobre OpenStreetMap",
"aboutOSMDescription": "OpenStreetMap é um projeto de mapeamento colaborativo de código aberto onde os contribuintes criam e mantêm um mapa gratuito e editável do mundo. Suas contribuições de dispositivos de vigilância ajudam a tornar esta infraestrutura visível e pesquisável.",
"visitOSM": "Visitar OpenStreetMap",
"deleteAccount": "Excluir Conta OSM",
"deleteAccountSubtitle": "Gerencie sua conta OpenStreetMap",
"deleteAccountExplanation": "Para excluir sua conta OpenStreetMap, você precisará visitar o site do OpenStreetMap. Isso removerá permanentemente sua conta OSM e todos os dados associados.",
@@ -163,7 +210,11 @@
"goToOSM": "Ir para OpenStreetMap"
},
"queue": {
"title": "Fila de Upload",
"subtitle": "Gerenciar uploads pendentes de dispositivos de vigilância",
"pendingUploads": "Uploads pendentes: {}",
"pendingItemsCount": "Itens Pendentes: {}",
"nothingInQueue": "Nada na fila",
"simulateModeEnabled": "Modo simulação ativado uploads simulados",
"sandboxMode": "Modo sandbox uploads vão para o Sandbox OSM",
"tapToViewQueue": "Toque para ver a fila",
@@ -216,7 +267,7 @@
"urlTemplate": "Modelo de URL",
"urlTemplateHint": "https://exemplo.com/{z}/{x}/{y}.png",
"urlTemplateRequired": "Modelo de URL é obrigatório",
"urlTemplatePlaceholders": "URL deve conter os marcadores {z}, {x} e {y}",
"urlTemplatePlaceholders": "URL deve conter {quadkey} ou os marcadores {z}, {x} e {y}",
"attribution": "Atribuição",
"attributionHint": "© Provedor de Mapas",
"attributionRequired": "Atribuição é obrigatória",
@@ -254,6 +305,10 @@
"profileNameRequired": "Nome do perfil é obrigatório",
"requiresDirection": "Requer Direção",
"requiresDirectionSubtitle": "Se câmeras deste tipo precisam de uma tag de direção",
"fov": "Campo de Visão",
"fovHint": "Campo de visão em graus (deixar vazio para o padrão)",
"fovSubtitle": "Campo de visão da câmera - usado para largura do cone e formato de envio por intervalo",
"fovInvalid": "Campo de visão deve estar entre 1 e 360 graus",
"submittable": "Enviável",
"submittableSubtitle": "Se este perfil pode ser usado para envios de câmeras",
"osmTags": "Tags OSM",

View File

@@ -10,7 +10,10 @@
"description": "DeFlock 是一款注重隐私的移动应用,使用 OpenStreetMap 绘制公共监控基础设施。记录您社区中的摄像头、车牌识别系统、枪击探测器和其他监控设备,使这些基础设施可见且可搜索。",
"features": "• 具有可下载区域的离线映射功能\n• 使用 OAuth2 直接上传到 OpenStreetMap\n• 主要制造商的内置配置文件\n• 尊重隐私 - 不收集用户数据\n• 多个地图提供商OSM、卫星图像",
"initiative": "DeFlock 更广泛倡议的一部分,旨在促进监控透明化。",
"footer": "访问deflock.me\n使用 Flutter 构建 • 开源"
"footer": "访问deflock.me\n使用 Flutter 构建 • 开源",
"showWelcome": "显示欢迎消息",
"showSubmissionGuide": "显示提交指南",
"viewReleaseNotes": "查看发布说明"
},
"welcome": {
"title": "欢迎使用 DeFlock",
@@ -23,6 +26,17 @@
"dontShowAgain": "不再显示此欢迎消息",
"getStarted": "开始使用 DeFlock"
},
"submissionGuide": {
"title": "提交最佳实践",
"description": "在提交您的第一个监控设备之前,请花点时间查看这些重要指南,以确保对 OpenStreetMap 的高质量贡献。",
"bestPractices": "• 只映射您亲自观察到的设备\n• 花时间准确识别设备类型和制造商\n• 使用精确定位 - 放置标记前请放大\n• 在适用时包含方向信息\n• 提交前请检查您的标签选择",
"placementNote": "请记住:准确的第一手数据对 DeFlock 社区和 OpenStreetMap 项目至关重要。",
"moreInfo": "有关设备识别和映射最佳实践的详细指导:",
"identificationGuide": "识别指南",
"osmWiki": "OpenStreetMap Wiki",
"dontShowAgain": "不再显示此指南",
"gotIt": "明白了!"
},
"actions": {
"tagNode": "新建节点",
"download": "下载",
@@ -39,6 +53,24 @@
"advanced": "高级",
"useAdvancedEditor": "使用高级编辑器"
},
"proximityWarning": {
"title": "节点过于靠近现有设备",
"message": "此节点距离现有监控设备仅 {} 米。",
"suggestion": "如果同一根杆上有多个设备,请在单个节点上使用多个方向,而不是创建单独的节点。",
"nearbyNodes": "发现附近设备 ({})",
"nodeInfo": "节点 #{} - {}",
"andMore": "...还有 {} 个",
"goBack": "返回",
"submitAnyway": "仍然提交",
"nodeType": {
"alpr": "ALPR/ANPR 摄像头",
"publicCamera": "公共监控摄像头",
"camera": "监控摄像头",
"amenity": "{}",
"device": "{} 设备",
"unknown": "未知设备"
}
},
"followMe": {
"off": "启用跟随模式",
"follow": "启用跟随模式(旋转)",
@@ -118,6 +150,7 @@
"enableSubmittableProfile": "在设置中启用可提交的配置文件以编辑节点。",
"profileViewOnlyWarning": "此配置文件仅用于地图查看。请选择可提交的配置文件来编辑节点。",
"cannotMoveConstrainedNode": "无法移动此相机 - 它连接到另一个地图元素OSM way/relation。您仍可以编辑其标签和方向。",
"zoomInRequiredMessage": "请放大至至少第{}级来添加或编辑监控节点。这确保精确定位以便准确制图。",
"extractFromWay": "从way/relation中提取节点",
"extractFromWaySubtitle": "创建具有相同标签的新节点,允许移动到新位置",
"refineTags": "细化标签",
@@ -133,9 +166,16 @@
"withinTileLimit": "在 {} 瓦片限制内",
"exceedsTileLimit": "当前选择超出 {} 瓦片限制",
"offlineModeWarning": "离线模式下禁用下载。禁用离线模式以下载新区域。",
"areaTooBigMessage": "请放大至至少第{}级来下载离线区域。下载大区域可能导致应用程序无响应。",
"downloadStarted": "下载已开始!正在获取瓦片和节点...",
"downloadFailed": "启动下载失败:{}"
},
"downloadStarted": {
"title": "下载已开始",
"message": "下载已开始!正在获取瓦片和节点...",
"ok": "确定",
"viewProgress": "在设置中查看进度"
},
"uploadMode": {
"title": "上传目标",
"subtitle": "选择摄像头上传位置",
@@ -147,6 +187,8 @@
"simulateDescription": "模拟上传(不联系 OSM 服务器)"
},
"auth": {
"osmAccountTitle": "OpenStreetMap 账户",
"osmAccountSubtitle": "管理您的 OSM 登录并查看您的贡献",
"loggedInAs": "已登录为 {}",
"loginToOSM": "登录 OpenStreetMap",
"tapToLogout": "点击登出",
@@ -156,6 +198,11 @@
"testConnectionSubtitle": "验证 OSM 凭据是否有效",
"connectionOK": "连接正常 - 凭据有效",
"connectionFailed": "连接失败 - 请重新登录",
"viewMyEdits": "在 OSM 上查看我的编辑",
"viewMyEditsSubtitle": "查看您在 OpenStreetMap 上的编辑历史",
"aboutOSM": "关于 OpenStreetMap",
"aboutOSMDescription": "OpenStreetMap 是一个协作的开源地图项目,贡献者创建和维护一个免费的、可编辑的世界地图。您的监控设备贡献有助于使这种基础设施可见和可搜索。",
"visitOSM": "访问 OpenStreetMap",
"deleteAccount": "删除 OSM 账户",
"deleteAccountSubtitle": "管理您的 OpenStreetMap 账户",
"deleteAccountExplanation": "要删除您的 OpenStreetMap 账户,您需要访问 OpenStreetMap 网站。这将永久删除您的 OSM 账户和所有相关数据。",
@@ -163,7 +210,11 @@
"goToOSM": "前往 OpenStreetMap"
},
"queue": {
"title": "上传队列",
"subtitle": "管理待上传的监控设备",
"pendingUploads": "待上传:{}",
"pendingItemsCount": "待处理项目:{}",
"nothingInQueue": "队列中没有内容",
"simulateModeEnabled": "模拟模式已启用 上传已模拟",
"sandboxMode": "沙盒模式 上传到 OSM 沙盒",
"tapToViewQueue": "点击查看队列",
@@ -216,7 +267,7 @@
"urlTemplate": "URL 模板",
"urlTemplateHint": "https://example.com/{z}/{x}/{y}.png",
"urlTemplateRequired": "URL 模板为必填项",
"urlTemplatePlaceholders": "URL 必须包含 {z}、{x} 和 {y} 占位符",
"urlTemplatePlaceholders": "URL 必须包含 {quadkey} 或 {z}、{x} 和 {y} 占位符",
"attribution": "归属",
"attributionHint": "© 地图提供商",
"attributionRequired": "归属为必填项",
@@ -254,6 +305,10 @@
"profileNameRequired": "配置文件名称为必填项",
"requiresDirection": "需要方向",
"requiresDirectionSubtitle": "此类型的摄像头是否需要方向标签",
"fov": "视场角",
"fovHint": "视场角度数(留空使用默认值)",
"fovSubtitle": "摄像头视场角 - 用于锥体宽度和范围提交格式",
"fovInvalid": "视场角必须在1到360度之间",
"submittable": "可提交",
"submittableSubtitle": "此配置文件是否可用于摄像头提交",
"osmTags": "OSM 标签",

View File

@@ -11,6 +11,8 @@ import 'screens/advanced_settings_screen.dart';
import 'screens/language_settings_screen.dart';
import 'screens/about_screen.dart';
import 'screens/release_notes_screen.dart';
import 'screens/osm_account_screen.dart';
import 'screens/upload_queue_screen.dart';
import 'services/localization_service.dart';
import 'services/version_service.dart';
@@ -69,6 +71,8 @@ class DeFlockApp extends StatelessWidget {
routes: {
'/': (context) => const HomeScreen(),
'/settings': (context) => const SettingsScreen(),
'/settings/osm-account': (context) => const OSMAccountScreen(),
'/settings/queue': (context) => const UploadQueueScreen(),
'/settings/profiles': (context) => const ProfilesSettingsScreen(),
'/settings/navigation': (context) => const NavigationSettingsScreen(),
'/settings/offline': (context) => const OfflineSettingsScreen(),

View File

@@ -0,0 +1,24 @@
/// Represents a direction with its associated field-of-view (FOV) cone.
class DirectionFov {
/// The center direction in degrees (0-359, where 0 is north)
final double centerDegrees;
/// The field-of-view width in degrees (e.g., 35, 90, 180, 360)
final double fovDegrees;
DirectionFov(this.centerDegrees, this.fovDegrees);
@override
String toString() => 'DirectionFov(center: ${centerDegrees}°, fov: ${fovDegrees}°)';
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is DirectionFov &&
runtimeType == other.runtimeType &&
centerDegrees == other.centerDegrees &&
fovDegrees == other.fovDegrees;
@override
int get hashCode => centerDegrees.hashCode ^ fovDegrees.hashCode;
}

View File

@@ -9,6 +9,7 @@ class NodeProfile {
final bool requiresDirection;
final bool submittable;
final bool editable;
final double? fov; // Field-of-view in degrees (null means use dev_config default)
NodeProfile({
required this.id,
@@ -18,6 +19,7 @@ class NodeProfile {
this.requiresDirection = true,
this.submittable = true,
this.editable = true,
this.fov,
});
/// Get all built-in default node profiles
@@ -50,6 +52,7 @@ class NodeProfile {
requiresDirection: true,
submittable: true,
editable: true,
fov: 45.0, // Flock cameras typically have narrow FOV
),
NodeProfile(
id: 'builtin-motorola',
@@ -67,6 +70,7 @@ class NodeProfile {
requiresDirection: true,
submittable: true,
editable: true,
fov: 60.0, // Motorola cameras typically have moderate FOV
),
NodeProfile(
id: 'builtin-genetec',
@@ -84,6 +88,7 @@ class NodeProfile {
requiresDirection: true,
submittable: true,
editable: true,
fov: 50.0, // Genetec cameras typically have moderate FOV
),
NodeProfile(
id: 'builtin-leonardo',
@@ -101,6 +106,7 @@ class NodeProfile {
requiresDirection: true,
submittable: true,
editable: true,
fov: 55.0, // Leonardo cameras typically have moderate FOV
),
NodeProfile(
id: 'builtin-neology',
@@ -150,6 +156,7 @@ class NodeProfile {
requiresDirection: true,
submittable: true,
editable: true,
fov: 90.0, // Axis cameras can have wider FOV
),
NodeProfile(
id: 'builtin-generic-gunshot',
@@ -208,6 +215,7 @@ class NodeProfile {
bool? requiresDirection,
bool? submittable,
bool? editable,
double? fov,
}) =>
NodeProfile(
id: id ?? this.id,
@@ -217,6 +225,7 @@ class NodeProfile {
requiresDirection: requiresDirection ?? this.requiresDirection,
submittable: submittable ?? this.submittable,
editable: editable ?? this.editable,
fov: fov ?? this.fov,
);
Map<String, dynamic> toJson() => {
@@ -227,6 +236,7 @@ class NodeProfile {
'requiresDirection': requiresDirection,
'submittable': submittable,
'editable': editable,
'fov': fov,
};
factory NodeProfile.fromJson(Map<String, dynamic> j) => NodeProfile(
@@ -237,6 +247,7 @@ class NodeProfile {
requiresDirection: j['requiresDirection'] ?? true, // Default to true for backward compatibility
submittable: j['submittable'] ?? true, // Default to true for backward compatibility
editable: j['editable'] ?? true, // Default to true for backward compatibility
fov: j['fov']?.toDouble(), // Can be null for backward compatibility
);
@override

View File

@@ -1,4 +1,6 @@
import 'package:latlong2/latlong.dart';
import 'direction_fov.dart';
import '../dev_config.dart';
class OsmNode {
final int id;
@@ -36,9 +38,10 @@ class OsmNode {
);
}
bool get hasDirection => directionDeg.isNotEmpty;
bool get hasDirection => directionFovPairs.isNotEmpty;
List<double> get directionDeg {
/// Get direction and FOV pairs, supporting range notation like "90-270" or "10-45;90-125;290"
List<DirectionFov> get directionFovPairs {
final raw = tags['direction'] ?? tags['camera:direction'];
if (raw == null) return [];
@@ -50,17 +53,35 @@ class OsmNode {
'W': 270.0, 'WNW': 292.5, 'NW': 315.0, 'NNW': 337.5,
};
// Split on semicolons and parse each direction
final directions = <double>[];
final directionFovList = <DirectionFov>[];
final parts = raw.split(';');
for (final part in parts) {
final trimmed = part.trim().toUpperCase();
final trimmed = part.trim();
if (trimmed.isEmpty) continue;
// Check if this part contains a range (e.g., "90-270")
if (trimmed.contains('-') && RegExp(r'^\d+\.?\d*-\d+\.?\d*$').hasMatch(trimmed)) {
final rangeParts = trimmed.split('-');
if (rangeParts.length == 2) {
final start = double.tryParse(rangeParts[0]);
final end = double.tryParse(rangeParts[1]);
if (start != null && end != null) {
final normalized = _calculateRangeCenter(start, end);
directionFovList.add(normalized);
continue;
}
}
}
// Not a range, handle as single direction
final trimmedUpper = trimmed.toUpperCase();
// First try compass direction lookup
if (compassDirections.containsKey(trimmed)) {
directions.add(compassDirections[trimmed]!);
if (compassDirections.containsKey(trimmedUpper)) {
final degrees = compassDirections[trimmedUpper]!;
directionFovList.add(DirectionFov(degrees, kDirectionConeHalfAngle * 2));
continue;
}
@@ -74,9 +95,35 @@ class OsmNode {
// Normalize: wrap negative or >360 into 0359 range
final normalized = ((val % 360) + 360) % 360;
directions.add(normalized);
directionFovList.add(DirectionFov(normalized, kDirectionConeHalfAngle * 2));
}
return directions;
return directionFovList;
}
/// Calculate center and width for a range like "90-270" or "270-90"
DirectionFov _calculateRangeCenter(double start, double end) {
// Normalize start and end to 0-359 range
start = ((start % 360) + 360) % 360;
end = ((end % 360) + 360) % 360;
double width, center;
if (start > end) {
// Wrapping case: 270-90
width = (end + 360) - start;
center = ((start + end + 360) / 2) % 360;
} else {
// Normal case: 90-270
width = end - start;
center = (start + end) / 2;
}
return DirectionFov(center, width);
}
/// Legacy getter for backward compatibility - returns just center directions
List<double> get directionDeg {
return directionFovPairs.map((df) => df.centerDegrees).toList();
}
}

View File

@@ -20,8 +20,35 @@ class TileType {
});
/// Create URL for a specific tile, replacing template variables
///
/// Supported placeholders:
/// - {x}, {y}, {z}: Standard tile coordinates
/// - {quadkey}: Bing Maps quadkey format (alternative to x/y/z)
/// - {0_3}: Subdomain 0-3 for load balancing
/// - {1_4}: Subdomain 1-4 for providers that use 1-based indexing
/// - {api_key}: API key placeholder (optional)
String getTileUrl(int z, int x, int y, {String? apiKey}) {
String url = urlTemplate
String url = urlTemplate;
// Handle Bing Maps quadkey conversion
if (url.contains('{quadkey}')) {
final quadkey = _convertToQuadkey(x, y, z);
url = url.replaceAll('{quadkey}', quadkey);
}
// Handle subdomains for load balancing
if (url.contains('{0_3}')) {
final subdomain = (x + y) % 4; // 0, 1, 2, 3
url = url.replaceAll('{0_3}', subdomain.toString());
}
if (url.contains('{1_4}')) {
final subdomain = ((x + y) % 4) + 1; // 1, 2, 3, 4
url = url.replaceAll('{1_4}', subdomain.toString());
}
// Standard x/y/z replacement
url = url
.replaceAll('{z}', z.toString())
.replaceAll('{x}', x.toString())
.replaceAll('{y}', y.toString());
@@ -33,6 +60,19 @@ class TileType {
return url;
}
/// Convert x, y, z to Bing Maps quadkey format
String _convertToQuadkey(int x, int y, int z) {
final quadkey = StringBuffer();
for (int i = z; i > 0; i--) {
int digit = 0;
final mask = 1 << (i - 1);
if ((x & mask) != 0) digit++;
if ((y & mask) != 0) digit += 2;
quadkey.write(digit);
}
return quadkey.toString();
}
/// Check if this tile type needs an API key
bool get requiresApiKey => urlTemplate.contains('{api_key}');
@@ -161,6 +201,19 @@ class DefaultTileProviders {
),
],
),
TileProvider(
id: 'bing',
name: 'Bing Maps',
tileTypes: [
TileType(
id: 'bing_satellite',
name: 'Satellite',
urlTemplate: 'https://ecn.t{0_3}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=1&n=z',
attribution: '© Microsoft Corporation',
maxZoom: 20,
),
],
),
TileProvider(
id: 'mapbox',
name: 'Mapbox',

View File

@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import '../services/localization_service.dart';
import '../widgets/welcome_dialog.dart';
import '../widgets/submission_guide_dialog.dart';
class AboutScreen extends StatelessWidget {
const AboutScreen({super.key});
@@ -74,16 +76,8 @@ class AboutScreen extends StatelessWidget {
textAlign: TextAlign.center,
),
const SizedBox(height: 24),
// Release Notes button
Center(
child: OutlinedButton.icon(
onPressed: () {
Navigator.pushNamed(context, '/settings/release-notes');
},
icon: const Icon(Icons.article_outlined),
label: const Text('View Release Notes'),
),
),
// Information dialogs section
_buildDialogButtons(context),
const SizedBox(height: 24),
_buildHelpLinks(context),
],
@@ -190,4 +184,50 @@ class AboutScreen extends StatelessWidget {
),
);
}
Widget _buildDialogButtons(BuildContext context) {
final locService = LocalizationService.instance;
return Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
// Welcome Message button
OutlinedButton.icon(
onPressed: () {
showDialog<void>(
context: context,
barrierDismissible: false,
builder: (context) => const WelcomeDialog(showDontShowAgain: false),
);
},
icon: const Icon(Icons.waving_hand_outlined),
label: Text(locService.t('about.showWelcome')),
),
const SizedBox(height: 8),
// Submission Guide button
OutlinedButton.icon(
onPressed: () {
showDialog<void>(
context: context,
barrierDismissible: false,
builder: (context) => const SubmissionGuideDialog(showDontShowAgain: false),
);
},
icon: const Icon(Icons.info_outline),
label: Text(locService.t('about.showSubmissionGuide')),
),
const SizedBox(height: 8),
// Release Notes button
OutlinedButton.icon(
onPressed: () {
Navigator.pushNamed(context, '/settings/release-notes');
},
icon: const Icon(Icons.article_outlined),
label: Text(locService.t('about.viewReleaseNotes')),
),
],
);
}
}

View File

@@ -103,6 +103,21 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
void _openAddNodeSheet() {
final appState = context.read<AppState>();
// Check minimum zoom level before opening sheet
final currentZoom = _mapController.mapController.camera.zoom;
if (currentZoom < kMinZoomForNodeEditingSheets) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
LocalizationService.instance.t('editNode.zoomInRequiredMessage',
params: [kMinZoomForNodeEditingSheets.toString()])
),
),
);
return;
}
// Disable follow-me when adding a camera so the map doesn't jump around
appState.setFollowMeMode(FollowMeMode.off);
@@ -532,6 +547,20 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: NodeTagSheet(
node: node,
onEditPressed: () {
// Check minimum zoom level before starting edit session
final currentZoom = _mapController.mapController.camera.zoom;
if (currentZoom < kMinZoomForNodeEditingSheets) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
LocalizationService.instance.t('editNode.zoomInRequiredMessage',
params: [kMinZoomForNodeEditingSheets.toString()])
),
),
);
return;
}
final appState = context.read<AppState>();
appState.startEditSession(node);
// This will trigger _openEditNodeSheet via the existing auto-show logic
@@ -760,10 +789,26 @@ class _HomeScreenState extends State<HomeScreen> with TickerProviderStateMixin {
child: ElevatedButton.icon(
icon: Icon(Icons.download_for_offline),
label: Text(LocalizationService.instance.download),
onPressed: () => showDialog(
context: context,
builder: (ctx) => DownloadAreaDialog(controller: _mapController.mapController),
),
onPressed: () {
// Check minimum zoom level before opening download dialog
final currentZoom = _mapController.mapController.camera.zoom;
if (currentZoom < kMinZoomForOfflineDownload) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
LocalizationService.instance.t('download.areaTooBigMessage',
params: [kMinZoomForOfflineDownload.toString()])
),
),
);
return;
}
showDialog(
context: context,
builder: (ctx) => DownloadAreaDialog(controller: _mapController.mapController),
);
},
style: ElevatedButton.styleFrom(
minimumSize: Size(0, 48),
textStyle: TextStyle(fontSize: 16),

View File

@@ -0,0 +1,176 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
import '../app_state.dart';
import '../services/localization_service.dart';
import '../dev_config.dart';
import '../state/settings_state.dart';
import '../screens/settings/sections/upload_mode_section.dart';
class OSMAccountScreen extends StatelessWidget {
const OSMAccountScreen({super.key});
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: LocalizationService.instance,
builder: (context, child) {
final locService = LocalizationService.instance;
final appState = context.watch<AppState>();
return Scaffold(
appBar: AppBar(
title: Text(locService.t('auth.osmAccountTitle')),
),
body: ListView(
padding: EdgeInsets.fromLTRB(
16,
16,
16,
16 + MediaQuery.of(context).padding.bottom,
),
children: [
// Login/Account Status Section
Card(
child: Column(
children: [
ListTile(
leading: Icon(
appState.isLoggedIn ? Icons.person : Icons.login,
color: appState.isLoggedIn ? Colors.green : null,
),
title: Text(appState.isLoggedIn
? locService.t('auth.loggedInAs', params: [appState.username])
: locService.t('auth.loginToOSM')),
subtitle: appState.isLoggedIn
? Text(locService.t('auth.tapToLogout'))
: Text(locService.t('auth.requiredToSubmit')),
onTap: () async {
if (appState.isLoggedIn) {
await appState.logout();
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(locService.t('auth.loggedOut')),
backgroundColor: Colors.grey,
),
);
}
} else {
// Start login flow - the user will be redirected to browser
await appState.forceLogin();
// Don't show immediate feedback - the UI will update automatically
// when the OAuth callback completes and notifyListeners() is called
}
},
),
if (appState.isLoggedIn) ...[
const Divider(),
ListTile(
leading: const Icon(Icons.wifi_protected_setup),
title: Text(locService.t('auth.testConnection')),
subtitle: Text(locService.t('auth.testConnectionSubtitle')),
onTap: () async {
final isValid = await appState.validateToken();
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(isValid
? locService.t('auth.connectionOK')
: locService.t('auth.connectionFailed')),
backgroundColor: isValid ? Colors.green : Colors.red,
),
);
}
if (!isValid) {
await appState.logout();
}
},
),
const Divider(),
ListTile(
leading: const Icon(Icons.history),
title: Text(locService.t('auth.viewMyEdits')),
subtitle: Text(locService.t('auth.viewMyEditsSubtitle')),
trailing: const Icon(Icons.open_in_new),
onTap: () async {
final url = Uri.parse('https://openstreetmap.org/user/${Uri.encodeComponent(appState.username)}/history');
if (await canLaunchUrl(url)) {
await launchUrl(url, mode: LaunchMode.externalApplication);
} else {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(locService.t('advancedEdit.couldNotOpenOSMWebsite'))),
);
}
}
},
),
],
],
),
),
const SizedBox(height: 16),
// Upload Mode Section (only show in development builds)
if (kEnableDevelopmentModes) ...[
Card(
child: const Padding(
padding: EdgeInsets.all(16.0),
child: UploadModeSection(),
),
),
const SizedBox(height: 16),
],
// Information Section
Card(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
locService.t('auth.aboutOSM'),
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 8),
Text(
locService.t('auth.aboutOSMDescription'),
style: Theme.of(context).textTheme.bodyMedium,
),
const SizedBox(height: 16),
SizedBox(
width: double.infinity,
child: OutlinedButton.icon(
onPressed: () async {
final url = Uri.parse('https://openstreetmap.org');
if (await canLaunchUrl(url)) {
await launchUrl(url, mode: LaunchMode.externalApplication);
} else {
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(locService.t('advancedEdit.couldNotOpenOSMWebsite'))),
);
}
}
},
icon: const Icon(Icons.open_in_new),
label: Text(locService.t('auth.visitOSM')),
),
),
],
),
),
),
],
),
);
},
);
}
}

View File

@@ -20,6 +20,7 @@ class _ProfileEditorState extends State<ProfileEditor> {
late List<MapEntry<String, String>> _tags;
late bool _requiresDirection;
late bool _submittable;
late TextEditingController _fovCtrl;
static const _defaultTags = [
MapEntry('man_made', 'surveillance'),
@@ -38,6 +39,7 @@ class _ProfileEditorState extends State<ProfileEditor> {
_nameCtrl = TextEditingController(text: widget.profile.name);
_requiresDirection = widget.profile.requiresDirection;
_submittable = widget.profile.submittable;
_fovCtrl = TextEditingController(text: widget.profile.fov?.toString() ?? '');
if (widget.profile.tags.isEmpty) {
// New profile → start with sensible defaults
@@ -50,6 +52,7 @@ class _ProfileEditorState extends State<ProfileEditor> {
@override
void dispose() {
_nameCtrl.dispose();
_fovCtrl.dispose();
super.dispose();
}
@@ -91,6 +94,21 @@ class _ProfileEditorState extends State<ProfileEditor> {
onChanged: (value) => setState(() => _requiresDirection = value ?? true),
controlAffinity: ListTileControlAffinity.leading,
),
if (_requiresDirection) Padding(
padding: const EdgeInsets.only(left: 16, right: 16, bottom: 8),
child: TextField(
controller: _fovCtrl,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: locService.t('profileEditor.fov'),
hintText: locService.t('profileEditor.fovHint'),
helperText: locService.t('profileEditor.fovSubtitle'),
errorText: _validateFov(),
suffixText: '°',
),
onChanged: (value) => setState(() {}), // Trigger validation
),
),
CheckboxListTile(
title: Text(locService.t('profileEditor.submittable')),
subtitle: Text(locService.t('profileEditor.submittableSubtitle')),
@@ -181,6 +199,17 @@ class _ProfileEditorState extends State<ProfileEditor> {
});
}
String? _validateFov() {
final text = _fovCtrl.text.trim();
if (text.isEmpty) return null; // Optional field
final fov = double.tryParse(text);
if (fov == null || fov <= 0 || fov > 360) {
return LocalizationService.instance.t('profileEditor.fovInvalid');
}
return null;
}
void _save() {
final locService = LocalizationService.instance;
final name = _nameCtrl.text.trim();
@@ -190,6 +219,15 @@ class _ProfileEditorState extends State<ProfileEditor> {
.showSnackBar(SnackBar(content: Text(locService.t('profileEditor.profileNameRequired'))));
return;
}
// Validate FOV if provided
if (_validateFov() != null) {
return; // Don't save if FOV validation fails
}
// Parse FOV
final fovText = _fovCtrl.text.trim();
final fov = fovText.isEmpty ? null : double.tryParse(fovText);
final tagMap = <String, String>{};
for (final e in _tags) {
@@ -211,6 +249,7 @@ class _ProfileEditorState extends State<ProfileEditor> {
requiresDirection: _requiresDirection,
submittable: _submittable,
editable: true, // All custom profiles are editable by definition
fov: fov,
);
context.read<AppState>().addOrUpdateProfile(newProfile);

View File

@@ -1,7 +1,4 @@
import 'package:flutter/material.dart';
import 'settings/sections/auth_section.dart';
import 'settings/sections/upload_mode_section.dart';
import 'settings/sections/queue_section.dart';
import '../services/localization_service.dart';
import '../services/version_service.dart';
import '../dev_config.dart';
@@ -25,14 +22,24 @@ class SettingsScreen extends StatelessWidget {
16 + MediaQuery.of(context).padding.bottom,
),
children: [
// Only show upload mode section in development builds
if (kEnableDevelopmentModes) ...[
const UploadModeSection(),
const Divider(),
],
const AuthSection(),
// OpenStreetMap Account
_buildNavigationTile(
context,
icon: Icons.account_circle,
title: locService.t('auth.osmAccountTitle'),
subtitle: locService.t('auth.osmAccountSubtitle'),
onTap: () => Navigator.pushNamed(context, '/settings/osm-account'),
),
const Divider(),
const QueueSection(),
// Upload Queue
_buildNavigationTile(
context,
icon: Icons.queue,
title: locService.t('queue.title'),
subtitle: locService.t('queue.subtitle'),
onTap: () => Navigator.pushNamed(context, '/settings/queue'),
),
const Divider(),
// Navigation to sub-pages

View File

@@ -318,9 +318,15 @@ class _TileTypeDialogState extends State<_TileTypeDialog> {
),
validator: (value) {
if (value?.trim().isEmpty == true) return locService.t('tileTypeEditor.urlTemplateRequired');
if (!value!.contains('{z}') || !value.contains('{x}') || !value.contains('{y}')) {
// Check for either quadkey OR x+y+z placeholders
final hasQuadkey = value!.contains('{quadkey}');
final hasXYZ = value.contains('{x}') && value.contains('{y}') && value.contains('{z}');
if (!hasQuadkey && !hasXYZ) {
return locService.t('tileTypeEditor.urlTemplatePlaceholders');
}
return null;
},
),
@@ -403,11 +409,20 @@ class _TileTypeDialogState extends State<_TileTypeDialog> {
});
try {
// Use a sample tile from configured preview location
final url = _urlController.text
.replaceAll('{z}', kPreviewTileZoom.toString())
.replaceAll('{x}', kPreviewTileX.toString())
.replaceAll('{y}', kPreviewTileY.toString());
// Create a temporary TileType to use the getTileUrl method
final tempTileType = TileType(
id: 'preview',
name: 'Preview',
urlTemplate: _urlController.text.trim(),
attribution: 'Preview',
);
final url = tempTileType.getTileUrl(
kPreviewTileZoom,
kPreviewTileX,
kPreviewTileY,
apiKey: null, // Don't use API key for preview
);
final response = await http.get(Uri.parse(url));

View File

@@ -0,0 +1,189 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../app_state.dart';
import '../services/localization_service.dart';
import '../state/settings_state.dart';
class UploadQueueScreen extends StatelessWidget {
const UploadQueueScreen({super.key});
String _getUploadModeDisplayName(UploadMode mode) {
final locService = LocalizationService.instance;
switch (mode) {
case UploadMode.production:
return locService.t('uploadMode.production');
case UploadMode.sandbox:
return locService.t('uploadMode.sandbox');
case UploadMode.simulate:
return locService.t('uploadMode.simulate');
}
}
Color _getUploadModeColor(UploadMode mode) {
switch (mode) {
case UploadMode.production:
return Colors.green; // Green for production (real)
case UploadMode.sandbox:
return Colors.orange; // Orange for sandbox (testing)
case UploadMode.simulate:
return Colors.grey; // Grey for simulate (fake)
}
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: LocalizationService.instance,
builder: (context, child) {
final locService = LocalizationService.instance;
final appState = context.watch<AppState>();
return Scaffold(
appBar: AppBar(
title: Text(locService.t('queue.title')),
),
body: ListView(
padding: EdgeInsets.fromLTRB(
16,
16,
16,
16 + MediaQuery.of(context).padding.bottom,
),
children: [
// Clear Upload Queue button - always visible
SizedBox(
width: double.infinity,
child: ElevatedButton.icon(
onPressed: appState.pendingCount > 0 ? () {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(locService.t('queue.clearQueueTitle')),
content: Text(locService.t('queue.clearQueueConfirm', params: [appState.pendingCount.toString()])),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(locService.cancel),
),
TextButton(
onPressed: () {
appState.clearQueue();
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(locService.t('queue.queueCleared'))),
);
},
child: Text(locService.t('actions.clear')),
),
],
),
);
} : null,
icon: const Icon(Icons.clear_all),
label: Text(locService.t('queue.clearUploadQueue')),
style: ElevatedButton.styleFrom(
backgroundColor: appState.pendingCount > 0 ? null : Theme.of(context).disabledColor.withOpacity(0.1),
),
),
),
const SizedBox(height: 16),
const Divider(),
const SizedBox(height: 8),
// Queue list or empty message
if (appState.pendingUploads.isEmpty) ...[
Center(
child: Padding(
padding: const EdgeInsets.all(32.0),
child: Column(
children: [
Icon(
Icons.check_circle_outline,
size: 64,
color: Theme.of(context).textTheme.bodySmall?.color?.withOpacity(0.4),
),
const SizedBox(height: 16),
Text(
locService.t('queue.nothingInQueue'),
style: Theme.of(context).textTheme.titleMedium?.copyWith(
color: Theme.of(context).textTheme.bodySmall?.color?.withOpacity(0.6),
),
textAlign: TextAlign.center,
),
],
),
),
),
] else ...[
Text(
locService.t('queue.pendingItemsCount', params: [appState.pendingCount.toString()]),
style: Theme.of(context).textTheme.titleMedium,
),
const SizedBox(height: 16),
// Queue items
...appState.pendingUploads.asMap().entries.map((entry) {
final index = entry.key;
final upload = entry.value;
return Card(
margin: const EdgeInsets.only(bottom: 8),
child: ListTile(
leading: Icon(
upload.error ? Icons.error : Icons.camera_alt,
color: upload.error
? Colors.red
: _getUploadModeColor(upload.uploadMode),
),
title: Text(
locService.t('queue.cameraWithIndex', params: [(index + 1).toString()]) +
(upload.error ? locService.t('queue.error') : "") +
(upload.completing ? locService.t('queue.completing') : "")
),
subtitle: Text(
locService.t('queue.destination', params: [_getUploadModeDisplayName(upload.uploadMode)]) + '\n' +
locService.t('queue.latitude', params: [upload.coord.latitude.toStringAsFixed(6)]) + '\n' +
locService.t('queue.longitude', params: [upload.coord.longitude.toStringAsFixed(6)]) + '\n' +
locService.t('queue.direction', params: [
upload.direction is String
? upload.direction.toString()
: upload.direction.round().toString()
]) + '\n' +
locService.t('queue.attempts', params: [upload.attempts.toString()]) +
(upload.error ? "\n${locService.t('queue.uploadFailedRetry')}" : "")
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
children: [
if (upload.error && !upload.completing)
IconButton(
icon: const Icon(Icons.refresh),
color: Colors.orange,
tooltip: locService.t('queue.retryUpload'),
onPressed: () {
appState.retryUpload(upload);
},
),
if (upload.completing)
const Icon(Icons.check_circle, color: Colors.green)
else
IconButton(
icon: const Icon(Icons.delete),
onPressed: () {
appState.removeFromQueue(upload);
},
),
],
),
),
);
}),
],
],
),
);
},
);
}
}

View File

@@ -13,6 +13,7 @@ class ChangelogService {
static const String _lastSeenVersionKey = 'last_seen_version';
static const String _hasSeenWelcomeKey = 'has_seen_welcome';
static const String _hasSeenSubmissionGuideKey = 'has_seen_submission_guide';
Map<String, dynamic>? _changelogData;
bool _initialized = false;
@@ -67,6 +68,18 @@ class ChangelogService {
await prefs.setBool(_hasSeenWelcomeKey, true);
}
/// Check if user has seen the submission guide popup
Future<bool> hasSeenSubmissionGuide() async {
final prefs = await SharedPreferences.getInstance();
return prefs.getBool(_hasSeenSubmissionGuideKey) ?? false;
}
/// Mark that user has seen the submission guide popup
Future<void> markSubmissionGuideSeen() async {
final prefs = await SharedPreferences.getInstance();
await prefs.setBool(_hasSeenSubmissionGuideKey, true);
}
/// Check if app version has changed since last launch
Future<bool> hasVersionChanged() async {
final prefs = await SharedPreferences.getInstance();

View File

@@ -9,7 +9,7 @@ import 'package:deflockapp/dev_config.dart';
import '../network_status.dart';
/// Global semaphore to limit simultaneous tile fetches
final _tileFetchSemaphore = _SimpleSemaphore(4); // Max 4 concurrent
final _tileFetchSemaphore = _SimpleSemaphore(kTileFetchConcurrentThreads);
/// Clear queued tile requests when map view changes significantly
void clearRemoteTileQueue() {
@@ -93,15 +93,15 @@ bool _isTileVisible(int z, int x, int y, LatLngBounds viewBounds) {
/// Fetches a tile from any remote provider, with in-memory retries/backoff, and global concurrency limit.
/// Returns tile image bytes, or throws on persistent failure.
/// Fetches a tile from any remote provider with unlimited retries.
/// Returns tile image bytes. Retries forever until success.
/// Brutalist approach: Keep trying until it works - no arbitrary retry limits.
Future<List<int>> fetchRemoteTile({
required int z,
required int x,
required int y,
required String url,
}) async {
const int maxAttempts = kTileFetchMaxAttempts;
int attempt = 0;
final random = Random();
final hostInfo = Uri.parse(url).host; // For logging
@@ -109,20 +109,23 @@ Future<List<int>> fetchRemoteTile({
while (true) {
await _tileFetchSemaphore.acquire(z: z, x: x, y: y);
try {
// Only log on first attempt or errors
if (attempt == 1) {
// Only log on first attempt
if (attempt == 0) {
debugPrint('[fetchRemoteTile] Fetching $z/$x/$y from $hostInfo');
}
attempt++;
final resp = await http.get(Uri.parse(url));
if (resp.statusCode == 200 && resp.bodyBytes.isNotEmpty) {
// Success - no logging for normal operation
NetworkStatus.instance.reportOsmTileSuccess(); // Generic tile server reporting
// Success!
if (attempt > 1) {
debugPrint('[fetchRemoteTile] SUCCESS $z/$x/$y from $hostInfo after $attempt attempts');
}
NetworkStatus.instance.reportOsmTileSuccess();
return resp.bodyBytes;
} else {
debugPrint('[fetchRemoteTile] FAIL $z/$x/$y from $hostInfo: code=${resp.statusCode}, bytes=${resp.bodyBytes.length}');
NetworkStatus.instance.reportOsmTileIssue(); // Generic tile server reporting
NetworkStatus.instance.reportOsmTileIssue();
throw HttpException('Failed to fetch tile $z/$x/$y from $hostInfo: status ${resp.statusCode}');
}
} catch (e) {
@@ -130,17 +133,16 @@ Future<List<int>> fetchRemoteTile({
if (e.toString().contains('Connection refused') ||
e.toString().contains('Connection timed out') ||
e.toString().contains('Connection reset')) {
NetworkStatus.instance.reportOsmTileIssue(); // Generic tile server reporting
}
if (attempt >= maxAttempts) {
debugPrint("[fetchRemoteTile] Failed for $z/$x/$y from $hostInfo after $attempt attempts: $e");
rethrow;
NetworkStatus.instance.reportOsmTileIssue();
}
// Calculate delay and retry (no attempt limit - keep trying forever)
final delay = _calculateRetryDelay(attempt, random);
if (attempt == 1) {
debugPrint("[fetchRemoteTile] Attempt $attempt for $z/$x/$y from $hostInfo failed: $e. Retrying in ${delay}ms.");
} else if (attempt % 10 == 0) {
// Log every 10th attempt to show we're still working
debugPrint("[fetchRemoteTile] Still trying $z/$x/$y from $hostInfo (attempt $attempt). Retrying in ${delay}ms.");
}
await Future.delayed(Duration(milliseconds: delay));
} finally {

View File

@@ -2,6 +2,8 @@ import 'package:latlong2/latlong.dart';
import '../models/osm_node.dart';
import 'package:flutter_map/flutter_map.dart' show LatLngBounds;
const Distance _distance = Distance();
class NodeCache {
// Singleton instance
static final NodeCache instance = NodeCache._internal();
@@ -103,6 +105,34 @@ class NodeCache {
(coord1.longitude - coord2.longitude).abs() < tolerance;
}
/// Find nodes within the specified distance (in meters) of the given coordinate
/// Excludes nodes with the excludeNodeId (useful when checking proximity for edited nodes)
List<OsmNode> findNodesWithinDistance(LatLng coord, double distanceMeters, {int? excludeNodeId}) {
final nearbyNodes = <OsmNode>[];
for (final node in _nodes.values) {
// Skip the excluded node (typically the node being edited)
if (excludeNodeId != null && node.id == excludeNodeId) {
continue;
}
// Skip temporary nodes (negative IDs) with pending upload/edit/deletion markers
if (node.id < 0 && (
node.tags.containsKey('_pending_upload') ||
node.tags.containsKey('_pending_edit') ||
node.tags.containsKey('_pending_deletion'))) {
continue;
}
final distance = _distance.as(LengthUnit.Meter, coord, node.coord);
if (distance <= distanceMeters) {
nearbyNodes.add(node);
}
}
return nearbyNodes;
}
/// Utility: point-in-bounds for coordinates
bool _inBounds(LatLng coord, LatLngBounds bounds) {
return coord.latitude >= bounds.southWest.latitude &&

View File

@@ -30,7 +30,7 @@ class UploadQueueState extends ChangeNotifier {
void addFromSession(AddNodeSession session, {required UploadMode uploadMode}) {
final upload = PendingUpload(
coord: session.target!,
direction: _formatDirectionsAsString(session.directions),
direction: _formatDirectionsForSubmission(session.directions, session.profile),
profile: session.profile!, // Safe to use ! because commitSession() checks for null
operatorProfile: session.operatorProfile,
uploadMode: uploadMode,
@@ -82,7 +82,7 @@ class UploadQueueState extends ChangeNotifier {
final upload = PendingUpload(
coord: coordToUse,
direction: _formatDirectionsAsString(session.directions),
direction: _formatDirectionsForSubmission(session.directions, session.profile),
profile: session.profile!, // Safe to use ! because commitEditSession() checks for null
operatorProfile: session.operatorProfile,
uploadMode: uploadMode,
@@ -330,13 +330,33 @@ class UploadQueueState extends ChangeNotifier {
}
}
// Helper method to format multiple directions as a string or number
dynamic _formatDirectionsAsString(List<double> directions) {
// Helper method to format multiple directions for submission, supporting profile FOV
dynamic _formatDirectionsForSubmission(List<double> directions, NodeProfile? profile) {
if (directions.isEmpty) return 0.0;
// If profile has FOV, convert center directions to range notation
if (profile?.fov != null && profile!.fov! > 0) {
final ranges = directions.map((center) =>
_formatDirectionWithFov(center, profile.fov!)
).toList();
return ranges.length == 1 ? ranges.first : ranges.join(';');
}
// No profile FOV: use original format (single number or semicolon-separated)
if (directions.length == 1) return directions.first;
return directions.map((d) => d.round().toString()).join(';');
}
// Convert a center direction and FOV to range notation (e.g., 180° center with 90° FOV -> "135-225")
String _formatDirectionWithFov(double center, double fov) {
final halfFov = fov / 2;
final start = (center - halfFov + 360) % 360;
final end = (center + halfFov) % 360;
return '${start.round()}-${end.round()}';
}
// ---------- Queue persistence ----------
Future<void> _saveQueue() async {
final prefs = await SharedPreferences.getInstance();

View File

@@ -6,13 +6,81 @@ import '../dev_config.dart';
import '../models/node_profile.dart';
import '../models/operator_profile.dart';
import '../services/localization_service.dart';
import '../services/node_cache.dart';
import '../services/changelog_service.dart';
import 'refine_tags_sheet.dart';
import 'proximity_warning_dialog.dart';
import 'submission_guide_dialog.dart';
class AddNodeSheet extends StatelessWidget {
const AddNodeSheet({super.key, required this.session});
final AddNodeSession session;
void _checkProximityAndCommit(BuildContext context, AppState appState, LocalizationService locService) {
_checkSubmissionGuideAndProceed(context, appState, locService);
}
void _checkSubmissionGuideAndProceed(BuildContext context, AppState appState, LocalizationService locService) async {
// Check if user has seen the submission guide
final hasSeenGuide = await ChangelogService().hasSeenSubmissionGuide();
if (!hasSeenGuide) {
// Show submission guide dialog first
await showDialog<void>(
context: context,
barrierDismissible: false,
builder: (context) => const SubmissionGuideDialog(),
);
}
// Now proceed with proximity check
_checkProximityOnly(context, appState, locService);
}
void _checkProximityOnly(BuildContext context, AppState appState, LocalizationService locService) {
// Only check proximity if we have a target location
if (session.target == null) {
_commitWithoutCheck(context, appState, locService);
return;
}
// Check for nearby nodes within the configured distance
final nearbyNodes = NodeCache.instance.findNodesWithinDistance(
session.target!,
kNodeProximityWarningDistance,
);
if (nearbyNodes.isNotEmpty) {
// Show proximity warning dialog
showDialog<void>(
context: context,
builder: (context) => ProximityWarningDialog(
nearbyNodes: nearbyNodes,
distance: kNodeProximityWarningDistance,
onGoBack: () {
Navigator.of(context).pop(); // Close dialog
},
onSubmitAnyway: () {
Navigator.of(context).pop(); // Close dialog
_commitWithoutCheck(context, appState, locService);
},
),
);
} else {
// No nearby nodes, proceed with commit
_commitWithoutCheck(context, appState, locService);
}
}
void _commitWithoutCheck(BuildContext context, AppState appState, LocalizationService locService) {
appState.commitSession();
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(locService.t('node.queuedForUpload'))),
);
}
Widget _buildDirectionControls(BuildContext context, AppState appState, AddNodeSession session, LocalizationService locService) {
final requiresDirection = session.profile != null && session.profile!.requiresDirection;
@@ -144,11 +212,7 @@ class AddNodeSheet extends StatelessWidget {
final appState = context.watch<AppState>();
void _commit() {
appState.commitSession();
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(locService.t('node.queuedForUpload'))),
);
_checkProximityAndCommit(context, appState, locService);
}
void _cancel() {

View File

@@ -9,6 +9,7 @@ import '../dev_config.dart';
import '../services/localization_service.dart';
import '../services/offline_area_service.dart';
import '../services/offline_areas/offline_tile_utils.dart';
import 'download_started_dialog.dart';
class DownloadAreaDialog extends StatefulWidget {
final MapController controller;
@@ -275,16 +276,29 @@ class _DownloadAreaDialogState extends State<DownloadAreaDialog> {
tileTypeName: selectedTileType?.name,
);
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(locService.t('download.downloadStarted')),
),
showDialog(
context: context,
builder: (context) => const DownloadStartedDialog(),
);
} catch (e) {
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Row(
children: [
const Icon(Icons.error, color: Colors.red),
const SizedBox(width: 10),
Text(locService.t('download.title')),
],
),
content: Text(locService.t('download.downloadFailed', params: [e.toString()])),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(locService.t('actions.ok')),
),
],
),
);
}

View File

@@ -0,0 +1,40 @@
import 'package:flutter/material.dart';
import '../services/localization_service.dart';
class DownloadStartedDialog extends StatelessWidget {
const DownloadStartedDialog({super.key});
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: LocalizationService.instance,
builder: (context, child) {
final locService = LocalizationService.instance;
return AlertDialog(
title: Row(
children: [
const Icon(Icons.download_for_offline, color: Colors.green),
const SizedBox(width: 10),
Text(locService.t('downloadStarted.title')),
],
),
content: Text(locService.t('downloadStarted.message')),
actions: [
TextButton(
onPressed: () => Navigator.pop(context),
child: Text(locService.t('downloadStarted.ok')),
),
ElevatedButton(
onPressed: () {
Navigator.pop(context);
Navigator.pushNamed(context, '/settings/offline');
},
child: Text(locService.t('downloadStarted.viewProgress')),
),
],
);
},
);
}
}

View File

@@ -6,15 +6,78 @@ import '../dev_config.dart';
import '../models/node_profile.dart';
import '../models/operator_profile.dart';
import '../services/localization_service.dart';
import '../services/node_cache.dart';
import '../services/changelog_service.dart';
import '../state/settings_state.dart';
import 'refine_tags_sheet.dart';
import 'advanced_edit_options_sheet.dart';
import 'proximity_warning_dialog.dart';
import 'submission_guide_dialog.dart';
class EditNodeSheet extends StatelessWidget {
const EditNodeSheet({super.key, required this.session});
final EditNodeSession session;
void _checkProximityAndCommit(BuildContext context, AppState appState, LocalizationService locService) {
_checkSubmissionGuideAndProceed(context, appState, locService);
}
void _checkSubmissionGuideAndProceed(BuildContext context, AppState appState, LocalizationService locService) async {
// Check if user has seen the submission guide
final hasSeenGuide = await ChangelogService().hasSeenSubmissionGuide();
if (!hasSeenGuide) {
// Show submission guide dialog first
await showDialog<void>(
context: context,
barrierDismissible: false,
builder: (context) => const SubmissionGuideDialog(),
);
}
// Now proceed with proximity check
_checkProximityOnly(context, appState, locService);
}
void _checkProximityOnly(BuildContext context, AppState appState, LocalizationService locService) {
// Check for nearby nodes within the configured distance, excluding the node being edited
final nearbyNodes = NodeCache.instance.findNodesWithinDistance(
session.target,
kNodeProximityWarningDistance,
excludeNodeId: session.originalNode.id,
);
if (nearbyNodes.isNotEmpty) {
// Show proximity warning dialog
showDialog<void>(
context: context,
builder: (context) => ProximityWarningDialog(
nearbyNodes: nearbyNodes,
distance: kNodeProximityWarningDistance,
onGoBack: () {
Navigator.of(context).pop(); // Close dialog
},
onSubmitAnyway: () {
Navigator.of(context).pop(); // Close dialog
_commitWithoutCheck(context, appState, locService);
},
),
);
} else {
// No nearby nodes, proceed with commit
_commitWithoutCheck(context, appState, locService);
}
}
void _commitWithoutCheck(BuildContext context, AppState appState, LocalizationService locService) {
appState.commitEditSession();
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(locService.t('node.editQueuedForUpload'))),
);
}
Widget _buildDirectionControls(BuildContext context, AppState appState, EditNodeSession session, LocalizationService locService) {
final requiresDirection = session.profile != null && session.profile!.requiresDirection;
@@ -146,11 +209,7 @@ class EditNodeSheet extends StatelessWidget {
final appState = context.watch<AppState>();
void _commit() {
appState.commitEditSession();
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(locService.t('node.editQueuedForUpload'))),
);
_checkProximityAndCommit(context, appState, locService);
}
void _cancel() {
@@ -219,20 +278,22 @@ class EditNodeSheet extends StatelessWidget {
padding: const EdgeInsets.fromLTRB(16, 0, 16, 12),
child: Column(
children: [
// Extract from way checkbox
CheckboxListTile(
title: Text(locService.t('editNode.extractFromWay')),
subtitle: Text(locService.t('editNode.extractFromWaySubtitle')),
value: session.extractFromWay,
onChanged: (value) {
appState.updateEditSession(extractFromWay: value);
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.zero,
),
const SizedBox(height: 8),
// Constraint info message (only show if extract is not checked)
if (!session.extractFromWay) ...[
// Extract from way checkbox (only show if enabled in dev config)
if (kEnableNodeExtraction) ...[
CheckboxListTile(
title: Text(locService.t('editNode.extractFromWay')),
subtitle: Text(locService.t('editNode.extractFromWaySubtitle')),
value: session.extractFromWay,
onChanged: (value) {
appState.updateEditSession(extractFromWay: value);
},
controlAffinity: ListTileControlAffinity.leading,
contentPadding: EdgeInsets.zero,
),
const SizedBox(height: 8),
],
// Constraint info message (only show if extract is not checked or not enabled)
if (!kEnableNodeExtraction || !session.extractFromWay) ...[
Row(
children: [
const Icon(Icons.info_outline, size: 20),

View File

@@ -6,6 +6,7 @@ import 'package:latlong2/latlong.dart';
import '../../app_state.dart';
import '../../dev_config.dart';
import '../../models/osm_node.dart';
import '../../models/direction_fov.dart';
/// Helper class to build direction cone polygons for cameras
class DirectionConesBuilder {
@@ -20,10 +21,13 @@ class DirectionConesBuilder {
// Add session cones if in add-camera mode and profile requires direction
if (session != null && session.target != null && session.profile?.requiresDirection == true) {
final sessionFov = session.profile?.fov ?? (kDirectionConeHalfAngle * 2);
// Add current working direction (full opacity)
overlays.add(_buildCone(
overlays.add(_buildConeWithFov(
session.target!,
session.directionDegrees,
sessionFov,
zoom,
context: context,
isSession: true,
@@ -33,9 +37,10 @@ class DirectionConesBuilder {
// Add other directions (reduced opacity)
for (int i = 0; i < session.directions.length; i++) {
if (i != session.currentDirectionIndex) {
overlays.add(_buildCone(
overlays.add(_buildConeWithFov(
session.target!,
session.directions[i],
sessionFov,
zoom,
context: context,
isSession: true,
@@ -47,10 +52,13 @@ class DirectionConesBuilder {
// Add edit session cones if in edit-camera mode and profile requires direction
if (editSession != null && editSession.profile?.requiresDirection == true) {
final sessionFov = editSession.profile?.fov ?? (kDirectionConeHalfAngle * 2);
// Add current working direction (full opacity)
overlays.add(_buildCone(
overlays.add(_buildConeWithFov(
editSession.target,
editSession.directionDegrees,
sessionFov,
zoom,
context: context,
isSession: true,
@@ -60,9 +68,10 @@ class DirectionConesBuilder {
// Add other directions (reduced opacity)
for (int i = 0; i < editSession.directions.length; i++) {
if (i != editSession.currentDirectionIndex) {
overlays.add(_buildCone(
overlays.add(_buildConeWithFov(
editSession.target,
editSession.directions[i],
sessionFov,
zoom,
context: context,
isSession: true,
@@ -76,11 +85,12 @@ class DirectionConesBuilder {
for (final node in cameras) {
if (_isValidCameraWithDirection(node) &&
(editSession == null || node.id != editSession.originalNode.id)) {
// Build a cone for each direction
for (final direction in node.directionDeg) {
overlays.add(_buildCone(
// Build a cone for each direction+fov pair
for (final directionFov in node.directionFovPairs) {
overlays.add(_buildConeWithFov(
node.coord,
direction,
directionFov.centerDegrees,
directionFov.fovDegrees,
zoom,
context: context,
));
@@ -103,6 +113,30 @@ class DirectionConesBuilder {
node.tags['_pending_upload'] == 'true';
}
/// Build cone with variable FOV width - new method for range notation support
static Polygon _buildConeWithFov(
LatLng origin,
double bearingDeg,
double fovDegrees,
double zoom, {
required BuildContext context,
bool isPending = false,
bool isSession = false,
bool isActiveDirection = true,
}) {
return _buildConeInternal(
origin: origin,
bearingDeg: bearingDeg,
halfAngleDeg: fovDegrees / 2,
zoom: zoom,
context: context,
isPending: isPending,
isSession: isSession,
isActiveDirection: isActiveDirection,
);
}
/// Legacy method for backward compatibility - uses dev_config FOV
static Polygon _buildCone(
LatLng origin,
double bearingDeg,
@@ -112,7 +146,39 @@ class DirectionConesBuilder {
bool isSession = false,
bool isActiveDirection = true,
}) {
final halfAngle = kDirectionConeHalfAngle;
return _buildConeInternal(
origin: origin,
bearingDeg: bearingDeg,
halfAngleDeg: kDirectionConeHalfAngle,
zoom: zoom,
context: context,
isPending: isPending,
isSession: isSession,
isActiveDirection: isActiveDirection,
);
}
/// Internal cone building method that handles the actual rendering
static Polygon _buildConeInternal({
required LatLng origin,
required double bearingDeg,
required double halfAngleDeg,
required double zoom,
required BuildContext context,
bool isPending = false,
bool isSession = false,
bool isActiveDirection = true,
}) {
// Handle full circle case (360-degree FOV)
if (halfAngleDeg >= 180) {
return _buildFullCircle(
origin: origin,
zoom: zoom,
context: context,
isSession: isSession,
isActiveDirection: isActiveDirection,
);
}
// Calculate pixel-based radii
final outerRadiusPx = kNodeIconDiameter + (kNodeIconDiameter * kDirectionConeBaseLength);
@@ -124,7 +190,9 @@ class DirectionConesBuilder {
final innerRadius = innerRadiusPx * pixelToCoordinate;
// Number of points for the outer arc (within our directional range)
const int arcPoints = 12;
// Scale arc points based on FOV width for better rendering
final baseArcPoints = 12;
final arcPoints = math.max(6, (baseArcPoints * halfAngleDeg / 45).round());
LatLng project(double deg, double distance) {
final rad = deg * math.pi / 180;
@@ -139,13 +207,13 @@ class DirectionConesBuilder {
// Add outer arc points from left to right (counterclockwise for proper polygon winding)
for (int i = 0; i <= arcPoints; i++) {
final angle = bearingDeg - halfAngle + (i * 2 * halfAngle / arcPoints);
final angle = bearingDeg - halfAngleDeg + (i * 2 * halfAngleDeg / arcPoints);
points.add(project(angle, outerRadius));
}
// Add inner arc points from right to left (to close the donut shape)
for (int i = arcPoints; i >= 0; i--) {
final angle = bearingDeg - halfAngle + (i * 2 * halfAngle / arcPoints);
final angle = bearingDeg - halfAngleDeg + (i * 2 * halfAngleDeg / arcPoints);
points.add(project(angle, innerRadius));
}
@@ -162,4 +230,59 @@ class DirectionConesBuilder {
borderStrokeWidth: getDirectionConeBorderWidth(context),
);
}
/// Build a full circle for 360-degree FOV cases
static Polygon _buildFullCircle({
required LatLng origin,
required double zoom,
required BuildContext context,
bool isSession = false,
bool isActiveDirection = true,
}) {
// Calculate pixel-based radii
final outerRadiusPx = kNodeIconDiameter + (kNodeIconDiameter * kDirectionConeBaseLength);
final innerRadiusPx = kNodeIconDiameter + (2 * getNodeRingThickness(context));
// Convert pixels to coordinate distances with zoom scaling
final pixelToCoordinate = 0.00001 * math.pow(2, 15 - zoom);
final outerRadius = outerRadiusPx * pixelToCoordinate;
final innerRadius = innerRadiusPx * pixelToCoordinate;
// Create full circle with many points for smooth rendering
const int circlePoints = 36;
final points = <LatLng>[];
LatLng project(double deg, double distance) {
final rad = deg * math.pi / 180;
final dLat = distance * math.cos(rad);
final dLon =
distance * math.sin(rad) / math.cos(origin.latitude * math.pi / 180);
return LatLng(origin.latitude + dLat, origin.longitude + dLon);
}
// Add outer circle points
for (int i = 0; i < circlePoints; i++) {
final angle = i * 360.0 / circlePoints;
points.add(project(angle, outerRadius));
}
// Add inner circle points in reverse order to create donut
for (int i = circlePoints - 1; i >= 0; i--) {
final angle = i * 360.0 / circlePoints;
points.add(project(angle, innerRadius));
}
// Adjust opacity based on direction state
double opacity = kDirectionConeOpacity;
if (isSession && !isActiveDirection) {
opacity = kDirectionConeOpacity * 0.4;
}
return Polygon(
points: points,
color: kDirectionConeColor.withOpacity(opacity),
borderColor: kDirectionConeColor,
borderStrokeWidth: getDirectionConeBorderWidth(context),
);
}
}

View File

@@ -597,6 +597,18 @@ class MapViewState extends State<MapView> {
widget.onUserGesture();
}
// Enforce minimum zoom level for add/edit node sheets (but not tag sheet)
if ((session != null || editSession != null) && pos.zoom < kMinZoomForNodeEditingSheets) {
// User tried to zoom out below minimum - snap back to minimum zoom
_controller.animateTo(
dest: pos.center,
zoom: kMinZoomForNodeEditingSheets.toDouble(),
duration: const Duration(milliseconds: 200),
curve: Curves.easeOut,
);
return; // Don't process other position updates
}
if (session != null) {
appState.updateSession(target: pos.center);
}

View File

@@ -209,12 +209,12 @@ class NodeTagSheet extends StatelessWidget {
),
const SizedBox(width: 8),
ElevatedButton.icon(
onPressed: _deleteNode,
onPressed: node.isConstrained ? null : _deleteNode,
icon: const Icon(Icons.delete, size: 18),
label: Text(locService.t('actions.delete')),
style: ElevatedButton.styleFrom(
minimumSize: const Size(0, 36),
foregroundColor: Colors.red,
foregroundColor: node.isConstrained ? null : Colors.red,
),
),
const SizedBox(width: 12),

View File

@@ -0,0 +1,126 @@
import 'package:flutter/material.dart';
import 'package:latlong2/latlong.dart';
import '../models/osm_node.dart';
import '../services/localization_service.dart';
class ProximityWarningDialog extends StatelessWidget {
final List<OsmNode> nearbyNodes;
final double distance;
final VoidCallback onGoBack;
final VoidCallback onSubmitAnyway;
const ProximityWarningDialog({
super.key,
required this.nearbyNodes,
required this.distance,
required this.onGoBack,
required this.onSubmitAnyway,
});
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: LocalizationService.instance,
builder: (context, child) {
final locService = LocalizationService.instance;
return AlertDialog(
icon: const Icon(
Icons.warning_amber_rounded,
color: Colors.orange,
size: 32,
),
title: Text(locService.t('proximityWarning.title')),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
locService.t('proximityWarning.message',
params: [distance.toStringAsFixed(1)]),
style: Theme.of(context).textTheme.bodyMedium,
),
const SizedBox(height: 16),
Text(
locService.t('proximityWarning.suggestion'),
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontStyle: FontStyle.italic,
),
),
const SizedBox(height: 16),
Text(
locService.t('proximityWarning.nearbyNodes',
params: [nearbyNodes.length.toString()]),
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontWeight: FontWeight.bold,
),
),
const SizedBox(height: 8),
...nearbyNodes.take(3).map((node) => Padding(
padding: const EdgeInsets.only(left: 8.0, bottom: 4.0),
child: Text(
'${locService.t('proximityWarning.nodeInfo', params: [
node.id.toString(),
_getNodeTypeDescription(node, locService),
])}',
style: Theme.of(context).textTheme.bodySmall,
),
)),
if (nearbyNodes.length > 3)
Padding(
padding: const EdgeInsets.only(left: 8.0, top: 4.0),
child: Text(
locService.t('proximityWarning.andMore',
params: [(nearbyNodes.length - 3).toString()]),
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontStyle: FontStyle.italic,
),
),
),
],
),
actions: [
TextButton(
onPressed: onGoBack,
child: Text(locService.t('proximityWarning.goBack')),
),
ElevatedButton(
onPressed: onSubmitAnyway,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.orange,
foregroundColor: Colors.white,
),
child: Text(locService.t('proximityWarning.submitAnyway')),
),
],
);
},
);
}
String _getNodeTypeDescription(OsmNode node, LocalizationService locService) {
// Try to get a meaningful description from the node's tags
final manMade = node.tags['man_made'];
final amenity = node.tags['amenity'];
final surveillance = node.tags['surveillance'];
final surveillanceType = node.tags['surveillance:type'];
final manufacturer = node.tags['manufacturer'];
if (manMade == 'surveillance') {
if (surveillanceType == 'ALPR' || surveillanceType == 'ANPR') {
return locService.t('proximityWarning.nodeType.alpr');
} else if (surveillance == 'public') {
return locService.t('proximityWarning.nodeType.publicCamera');
} else {
return locService.t('proximityWarning.nodeType.camera');
}
} else if (amenity != null) {
return locService.t('proximityWarning.nodeType.amenity', params: [amenity]);
} else if (manufacturer != null) {
return locService.t('proximityWarning.nodeType.device', params: [manufacturer]);
} else {
return locService.t('proximityWarning.nodeType.unknown');
}
}
}

View File

@@ -0,0 +1,185 @@
import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import '../services/changelog_service.dart';
import '../services/localization_service.dart';
class SubmissionGuideDialog extends StatefulWidget {
const SubmissionGuideDialog({super.key, this.showDontShowAgain = true});
final bool showDontShowAgain;
@override
State<SubmissionGuideDialog> createState() => _SubmissionGuideDialogState();
}
class _SubmissionGuideDialogState extends State<SubmissionGuideDialog> {
bool _dontShowAgain = false;
bool _isInitialized = false;
Future<void> _launchUrl(String url) async {
final uri = Uri.parse(url);
if (await canLaunchUrl(uri)) {
await launchUrl(uri, mode: LaunchMode.externalApplication);
}
}
@override
void initState() {
super.initState();
_loadCurrentState();
}
Future<void> _loadCurrentState() async {
if (!widget.showDontShowAgain) {
// When manually opened, show the actual current state
final hasSeenSubmissionGuide = await ChangelogService().hasSeenSubmissionGuide();
setState(() {
_dontShowAgain = hasSeenSubmissionGuide;
_isInitialized = true;
});
} else {
setState(() {
_isInitialized = true;
});
}
}
void _onClose() async {
if (_dontShowAgain && widget.showDontShowAgain) {
await ChangelogService().markSubmissionGuideSeen();
}
if (mounted) {
Navigator.of(context).pop();
}
}
@override
Widget build(BuildContext context) {
final locService = LocalizationService.instance;
return AnimatedBuilder(
animation: LocalizationService.instance,
builder: (context, child) => AlertDialog(
title: Text(locService.t('submissionGuide.title')),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Scrollable content
Flexible(
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
locService.t('submissionGuide.description'),
style: const TextStyle(fontSize: 14),
),
const SizedBox(height: 12),
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: Colors.blue.withOpacity(0.1),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: Colors.blue.withOpacity(0.3)),
),
child: Text(
locService.t('submissionGuide.bestPractices'),
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w500),
),
),
const SizedBox(height: 12),
Text(
locService.t('submissionGuide.placementNote'),
style: const TextStyle(fontSize: 13, fontStyle: FontStyle.italic),
),
const SizedBox(height: 16),
Text(
locService.t('submissionGuide.moreInfo'),
style: const TextStyle(fontSize: 13),
),
const SizedBox(height: 16),
// Resource links row
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
_buildLinkButton(
locService.t('submissionGuide.identificationGuide'),
'https://deflock.me/identify'
),
_buildLinkButton(
locService.t('submissionGuide.osmWiki'),
'https://wiki.openstreetmap.org/wiki/Tag:man_made%3Dsurveillance'
),
],
),
],
),
),
),
const SizedBox(height: 16),
// Always visible checkbox, but disabled when manually opened
if (_isInitialized)
Row(
children: [
Checkbox(
value: _dontShowAgain,
onChanged: widget.showDontShowAgain ? (value) {
setState(() {
_dontShowAgain = value ?? false;
});
} : null,
),
Expanded(
child: Text(
locService.t('submissionGuide.dontShowAgain'),
style: TextStyle(
fontSize: 13,
color: widget.showDontShowAgain
? null
: Theme.of(context).disabledColor,
),
),
),
],
),
],
),
actions: [
TextButton(
onPressed: _onClose,
child: Text(locService.t('submissionGuide.gotIt')),
),
],
),
);
}
Widget _buildLinkButton(String text, String url) {
return Flexible(
child: GestureDetector(
onTap: () => _launchUrl(url),
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.primary.withOpacity(0.1),
borderRadius: BorderRadius.circular(4),
border: Border.all(
color: Theme.of(context).colorScheme.primary.withOpacity(0.3),
),
),
child: Text(
text,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.primary,
),
textAlign: TextAlign.center,
),
),
),
);
}
}

View File

@@ -4,7 +4,9 @@ import '../services/changelog_service.dart';
import '../services/localization_service.dart';
class WelcomeDialog extends StatefulWidget {
const WelcomeDialog({super.key});
const WelcomeDialog({super.key, this.showDontShowAgain = true});
final bool showDontShowAgain;
@override
State<WelcomeDialog> createState() => _WelcomeDialogState();
@@ -12,6 +14,7 @@ class WelcomeDialog extends StatefulWidget {
class _WelcomeDialogState extends State<WelcomeDialog> {
bool _dontShowAgain = false;
bool _isInitialized = false;
Future<void> _launchUrl(String url) async {
final uri = Uri.parse(url);
@@ -20,8 +23,29 @@ class _WelcomeDialogState extends State<WelcomeDialog> {
}
}
@override
void initState() {
super.initState();
_loadCurrentState();
}
Future<void> _loadCurrentState() async {
if (!widget.showDontShowAgain) {
// When manually opened, show the actual current state
final hasSeenWelcome = await ChangelogService().hasSeenWelcome();
setState(() {
_dontShowAgain = hasSeenWelcome;
_isInitialized = true;
});
} else {
setState(() {
_isInitialized = true;
});
}
}
void _onClose() async {
if (_dontShowAgain) {
if (_dontShowAgain && widget.showDontShowAgain) {
await ChangelogService().markWelcomeSeen();
}
@@ -103,25 +127,31 @@ class _WelcomeDialogState extends State<WelcomeDialog> {
),
),
const SizedBox(height: 16),
// Always visible checkbox at the bottom
Row(
children: [
Checkbox(
value: _dontShowAgain,
onChanged: (value) {
setState(() {
_dontShowAgain = value ?? false;
});
},
),
Expanded(
child: Text(
locService.t('welcome.dontShowAgain'),
style: const TextStyle(fontSize: 13),
// Always visible checkbox, but disabled when manually opened
if (_isInitialized)
Row(
children: [
Checkbox(
value: _dontShowAgain,
onChanged: widget.showDontShowAgain ? (value) {
setState(() {
_dontShowAgain = value ?? false;
});
} : null,
),
),
],
),
Expanded(
child: Text(
locService.t('welcome.dontShowAgain'),
style: TextStyle(
fontSize: 13,
color: widget.showDontShowAgain
? null
: Theme.of(context).disabledColor,
),
),
),
],
),
],
),
actions: [

View File

@@ -1,7 +1,7 @@
name: deflockapp
description: Map public surveillance infrastructure with OpenStreetMap
publish_to: "none"
version: 1.4.1+14 # The thing after the + is the version code, incremented with each release
version: 1.5.1+19 # The thing after the + is the version code, incremented with each release
environment:
sdk: ">=3.5.0 <4.0.0" # oauth2_client 4.x needs Dart 3.5+

View File

@@ -0,0 +1,137 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:flock_map_app/models/tile_provider.dart';
void main() {
group('TileType', () {
test('getTileUrl handles standard x/y/z replacement', () {
final tileType = TileType(
id: 'test',
name: 'Test',
urlTemplate: 'https://example.com/{z}/{x}/{y}.png',
attribution: 'Test',
);
final url = tileType.getTileUrl(3, 2, 1);
expect(url, 'https://example.com/3/2/1.png');
});
test('getTileUrl handles subdomain patterns', () {
final tileType0_3 = TileType(
id: 'test_0_3',
name: 'Test 0-3',
urlTemplate: 'https://s{0_3}.example.com/{z}/{x}/{y}.png',
attribution: 'Test',
);
final tileType1_4 = TileType(
id: 'test_1_4',
name: 'Test 1-4',
urlTemplate: 'https://s{1_4}.example.com/{z}/{x}/{y}.png',
attribution: 'Test',
);
// Test 0-3 range
final url_0_3_a = tileType0_3.getTileUrl(1, 0, 0);
final url_0_3_b = tileType0_3.getTileUrl(1, 3, 0);
expect(url_0_3_a, contains('s0.example.com'));
expect(url_0_3_b, contains('s3.example.com'));
// Test 1-4 range
final url_1_4_a = tileType1_4.getTileUrl(1, 0, 0);
final url_1_4_b = tileType1_4.getTileUrl(1, 3, 0);
expect(url_1_4_a, contains('s1.example.com'));
expect(url_1_4_b, contains('s4.example.com'));
// Test consistency
final url1 = tileType0_3.getTileUrl(1, 2, 3);
final url2 = tileType0_3.getTileUrl(1, 2, 3);
expect(url1, url2); // Same input should give same output
});
test('getTileUrl handles Bing Maps quadkey conversion', () {
final tileType = TileType(
id: 'bing_test',
name: 'Bing Test',
urlTemplate: 'https://ecn.t{subdomain}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=1&n=z',
attribution: 'Microsoft',
);
// Test some known quadkey conversions
// x=0, y=0, z=1 should give quadkey "0"
final url1 = tileType.getTileUrl(1, 0, 0);
expect(url1, contains('a0.jpeg'));
// x=1, y=0, z=1 should give quadkey "1"
final url2 = tileType.getTileUrl(1, 1, 0);
expect(url2, contains('a1.jpeg'));
// x=0, y=1, z=1 should give quadkey "2"
final url3 = tileType.getTileUrl(1, 0, 1);
expect(url3, contains('a2.jpeg'));
// x=1, y=1, z=1 should give quadkey "3"
final url4 = tileType.getTileUrl(1, 1, 1);
expect(url4, contains('a3.jpeg'));
// More complex example: x=3, y=5, z=3 should give quadkey "213"
final url5 = tileType.getTileUrl(3, 3, 5);
expect(url5, contains('a213.jpeg'));
});
test('getTileUrl handles API key replacement', () {
final tileType = TileType(
id: 'test',
name: 'Test',
urlTemplate: 'https://api.example.com/{z}/{x}/{y}?key={api_key}',
attribution: 'Test',
);
final url = tileType.getTileUrl(1, 2, 3, apiKey: 'mykey123');
expect(url, 'https://api.example.com/1/2/3?key=mykey123');
});
test('requiresApiKey detects API key requirement correctly', () {
final tileTypeWithKey = TileType(
id: 'test1',
name: 'Test 1',
urlTemplate: 'https://api.example.com/{z}/{x}/{y}?key={api_key}',
attribution: 'Test',
);
final tileTypeWithoutKey = TileType(
id: 'test2',
name: 'Test 2',
urlTemplate: 'https://example.com/{z}/{x}/{y}.png',
attribution: 'Test',
);
expect(tileTypeWithKey.requiresApiKey, isTrue);
expect(tileTypeWithoutKey.requiresApiKey, isFalse);
});
});
group('DefaultTileProviders', () {
test('contains Bing satellite provider', () {
final providers = DefaultTileProviders.createDefaults();
final bingProvider = providers.firstWhere((p) => p.id == 'bing');
expect(bingProvider.name, 'Bing Maps');
expect(bingProvider.tileTypes, hasLength(1));
final satelliteType = bingProvider.tileTypes.first;
expect(satelliteType.id, 'bing_satellite');
expect(satelliteType.name, 'Satellite');
expect(satelliteType.urlTemplate, contains('quadkey'));
expect(satelliteType.urlTemplate, contains('0_3'));
expect(satelliteType.requiresApiKey, isFalse);
expect(satelliteType.attribution, '© Microsoft Corporation');
});
test('all default providers are usable', () {
final providers = DefaultTileProviders.createDefaults();
for (final provider in providers) {
expect(provider.isUsable, isTrue, reason: '${provider.name} should be usable');
}
});
});
}