From c64c356c1b424e1b9905551670e100560f4bd8ea Mon Sep 17 00:00:00 2001 From: Marc Rejohn Castillano Date: Thu, 19 Feb 2026 07:26:56 +0800 Subject: [PATCH] Adhere to OpenStreetMap's Policy to avoid blocked tiles --- lib/screens/admin/geofence_test_screen.dart | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/screens/admin/geofence_test_screen.dart b/lib/screens/admin/geofence_test_screen.dart index baa893d9..92de4a16 100644 --- a/lib/screens/admin/geofence_test_screen.dart +++ b/lib/screens/admin/geofence_test_screen.dart @@ -351,9 +351,12 @@ class _GeofenceTestScreenState extends ConsumerState { children: [ TileLayer( urlTemplate: - 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - // It's OK to leave default UA for dev; production - // should set `userAgentPackageName` per OSMTOS. + 'https://tile.openstreetmap.org/{z}/{x}/{y}.png', + // Per OSM tile usage policy: set a User-Agent that + // identifies this application. Use the Android + // applicationId so tile servers can contact the + // publisher if necessary. + userAgentPackageName: 'com.example.tasq', ), if (polygonPoints.isNotEmpty) polygonLayer, if (cfg?.hasCircle == true) circleLayer, @@ -427,6 +430,13 @@ class _GeofenceTestScreenState extends ConsumerState { ], ), ), + const SizedBox(height: 6), + Text( + 'Map tiles: © OpenStreetMap contributors', + style: Theme.of( + context, + ).textTheme.bodySmall, + ), ], ), ),