mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-09-30 21:19:42 +02:00
more debug logging
This commit is contained in:
1 parent
3dca7d5751
commit
7f91d5aec4
3 files changed
+6
-2
No files matched your search
@@ -53,6 +53,7 @@ class MapDataProvider {
|
|||||||
required int y,
|
required int y,
|
||||||
MapSource source = MapSource.auto,
|
MapSource source = MapSource.auto,
|
||||||
}) async {
|
}) async {
|
||||||
|
print('[MapDataProvider] getTile called for $z/$x/$y');
|
||||||
if (_offlineMode && source != MapSource.local) {
|
if (_offlineMode && source != MapSource.local) {
|
||||||
throw OfflineModeException("Cannot fetch remote tiles in offline mode.");
|
throw OfflineModeException("Cannot fetch remote tiles in offline mode.");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ Future<List<int>> fetchOSMTile({
|
|||||||
];
|
];
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
|
print('[fetchOSMTile] FETCH $z/$x/$y');
|
||||||
attempt++;
|
attempt++;
|
||||||
final resp = await http.get(Uri.parse(url));
|
final resp = await http.get(Uri.parse(url));
|
||||||
if (resp.statusCode == 200) {
|
if (resp.statusCode == 200) {
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import 'camera_tag_sheet.dart';
|
|||||||
class DataProviderTileProvider extends TileProvider {
|
class DataProviderTileProvider extends TileProvider {
|
||||||
@override
|
@override
|
||||||
ImageProvider getImage(TileCoordinates coords, TileLayer options) {
|
ImageProvider getImage(TileCoordinates coords, TileLayer options) {
|
||||||
|
print('[DataProviderTileProvider] getImage called for \\${coords.z}/\\${coords.x}/\\${coords.y}');
|
||||||
return DataProviderImage(coords, options);
|
return DataProviderImage(coords, options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -51,9 +52,10 @@ class DataProviderImage extends ImageProvider<DataProviderImage> {
|
|||||||
final z = key.coords.z;
|
final z = key.coords.z;
|
||||||
final x = key.coords.x;
|
final x = key.coords.x;
|
||||||
final y = key.coords.y;
|
final y = key.coords.y;
|
||||||
|
print('[_loadAsync] Called for $z/$x/$y');
|
||||||
try {
|
try {
|
||||||
final bytes = await MapDataProvider().getTile(z: z, x: x, y: y);
|
final bytes = await MapDataProvider().getTile(z: z, x: x, y: y);
|
||||||
|
print('[_loadAsync] Got bytes for $z/$x/$y: length=\\${bytes.length}');
|
||||||
if (bytes.isEmpty) throw Exception("Empty image bytes for $z/$x/$y");
|
if (bytes.isEmpty) throw Exception("Empty image bytes for $z/$x/$y");
|
||||||
return await decode(Uint8List.fromList(bytes));
|
return await decode(Uint8List.fromList(bytes));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
@@ -291,7 +293,7 @@ class _MapViewState extends State<MapView> {
|
|||||||
children: [
|
children: [
|
||||||
TileLayer(
|
TileLayer(
|
||||||
tileProvider: DataProviderTileProvider(),
|
tileProvider: DataProviderTileProvider(),
|
||||||
urlTemplate: '', // Not used by custom provider
|
urlTemplate: 'unused-{z}-{x}-{y}', // Required by flutter_map for tile addressing
|
||||||
tileSize: 256,
|
tileSize: 256,
|
||||||
// Any other TileLayer customization as needed
|
// Any other TileLayer customization as needed
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in new issue
Block a user