fix(train): the maps stop at zoom 18, beyond which they drew nothing

vector_map_tiles draws its tiles as pictures and stops at zoom 18, while
the maps let people zoom further, onto a grey map.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
Tizian 「ティツィアーン」 2026-10-30 23:00:49 +01:00
commit 32c94aa601
Signed by: raisondetredev
GPG key ID: 07F6FCF405488B64

View file

@ -21,6 +21,7 @@ import 'package:halkyon_train_flutter/src/feature/loop/data/polar_loop.dart';
import 'package:halkyon_train_flutter/src/feature/loop/model/loop_figures.dart';
import 'package:halkyon_train_flutter/src/feature/map/data/map_source_repository.dart';
import 'package:halkyon_train_flutter/src/feature/map/data/offline_maps.dart';
import 'package:halkyon_train_flutter/src/feature/map/widget/map_tiles.dart';
import 'package:halkyon_train_flutter/src/feature/music/data/recorder_music.dart';
import 'package:halkyon_train_flutter/src/feature/plan/data/plan_repository.dart';
import 'package:halkyon_train_flutter/src/feature/plan/model/plan.dart';
@ -2268,6 +2269,19 @@ void main() {
expect(find.textContaining('No way found there'), findsNothing);
});
testWidgets('the maps stop where their tiles stop being drawn', (
tester,
) async {
await openRoutes(tester);
await tester.tap(find.text('New route'));
await tester.pumpAndSettle();
expect(
tester.widget<FlutterMap>(find.byType(FlutterMap)).options.maxZoom,
mapMaxZoom,
);
});
testWidgets('an instance that plans no routes says so', (tester) async {
routing.isOffered = false;
await openRoutes(tester);
@ -2648,6 +2662,10 @@ void main() {
await tester.pumpAndSettle();
expect(find.byType(FlutterMap), findsOneWidget);
expect(
tester.widget<FlutterMap>(find.byType(FlutterMap)).options.maxZoom,
mapMaxZoom,
);
expect(find.text('2.50 km'), findsOneWidget);
expect(find.text('20 m'), findsOneWidget);
expect(find.text('whole time'), findsOneWidget);