From 18f3345b3f4a0ede92e03f8d3348ad052717f07c Mon Sep 17 00:00:00 2001 From: Ming Ming Date: Thu, 1 Sep 2022 18:49:50 +0800 Subject: [PATCH] Enable GMaps on web There's no reason to disable it on web in the first place --- app/lib/app_init.dart | 12 +++++++----- app/lib/widget/gps_map.dart | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/lib/app_init.dart b/app/lib/app_init.dart index d0310f9c..e960f092 100644 --- a/app/lib/app_init.dart +++ b/app/lib/app_init.dart @@ -74,11 +74,13 @@ Future init(InitIsolateType isolateType) async { await _initDiContainer(isolateType); _initVisibilityDetector(); - if (isolateType == InitIsolateType.main) { - try { - _isNewGMapsRenderer = await Activity.isNewGMapsRenderer(); - } catch (e, stackTrace) { - _log.severe("[init] Failed while isNewGMapsRenderer", e, stackTrace); + if (platform_k.isAndroid) { + if (isolateType == InitIsolateType.main) { + try { + _isNewGMapsRenderer = await Activity.isNewGMapsRenderer(); + } catch (e, stackTrace) { + _log.severe("[init] Failed while isNewGMapsRenderer", e, stackTrace); + } } } diff --git a/app/lib/widget/gps_map.dart b/app/lib/widget/gps_map.dart index 60d21758..d84fa704 100644 --- a/app/lib/widget/gps_map.dart +++ b/app/lib/widget/gps_map.dart @@ -4,6 +4,7 @@ import 'package:latlong2/latlong.dart'; import 'package:nc_photos/app_init.dart' as app_init; import 'package:nc_photos/mobile/platform.dart' if (dart.library.html) 'package:nc_photos/web/platform.dart' as platform; +import 'package:nc_photos/platform/k.dart' as platform_k; import 'package:nc_photos/pref.dart'; import 'package:nc_photos/url_launcher_util.dart'; import 'package:tuple/tuple.dart'; @@ -38,7 +39,7 @@ class GpsMap extends StatelessWidget { build(BuildContext context) { if (GpsMapProvider.values[Pref().getGpsMapProviderOr(0)] == GpsMapProvider.osm || - !app_init.isNewGMapsRenderer()) { + (platform_k.isAndroid && !app_init.isNewGMapsRenderer())) { return _OsmGpsMap( center: center, zoom: zoom,