map: removed connectivity check, harmonized layer background
This commit is contained in:
parent
3ea5ddd753
commit
b9ef030001
3 changed files with 109 additions and 113 deletions
|
@ -5,7 +5,6 @@ import 'package:aves/model/entry.dart';
|
||||||
import 'package:aves/model/settings/enums.dart';
|
import 'package:aves/model/settings/enums.dart';
|
||||||
import 'package:aves/model/settings/map_style.dart';
|
import 'package:aves/model/settings/map_style.dart';
|
||||||
import 'package:aves/model/settings/settings.dart';
|
import 'package:aves/model/settings/settings.dart';
|
||||||
import 'package:aves/services/common/services.dart';
|
|
||||||
import 'package:aves/theme/durations.dart';
|
import 'package:aves/theme/durations.dart';
|
||||||
import 'package:aves/utils/change_notifier.dart';
|
import 'package:aves/utils/change_notifier.dart';
|
||||||
import 'package:aves/utils/constants.dart';
|
import 'package:aves/utils/constants.dart';
|
||||||
|
@ -152,10 +151,6 @@ class _GeoMapState extends State<GeoMap> {
|
||||||
onTap(clusterAverageLocation, markerEntry, getClusterEntries);
|
onTap(clusterAverageLocation, markerEntry, getClusterEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
return FutureBuilder<bool>(
|
|
||||||
future: availability.isConnected,
|
|
||||||
builder: (context, snapshot) {
|
|
||||||
if (snapshot.data != true) return const SizedBox();
|
|
||||||
return Selector<Settings, EntryMapStyle>(
|
return Selector<Settings, EntryMapStyle>(
|
||||||
selector: (context, s) => s.infoMapStyle,
|
selector: (context, s) => s.infoMapStyle,
|
||||||
builder: (context, mapStyle, child) {
|
builder: (context, mapStyle, child) {
|
||||||
|
@ -264,8 +259,6 @@ class _GeoMapState extends State<GeoMap> {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ZoomedBounds _initBounds() {
|
ZoomedBounds _initBounds() {
|
||||||
|
|
|
@ -3,6 +3,8 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_map/flutter_map.dart';
|
import 'package:flutter_map/flutter_map.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
const _tileLayerBackgroundColor = Colors.transparent;
|
||||||
|
|
||||||
class OSMHotLayer extends StatelessWidget {
|
class OSMHotLayer extends StatelessWidget {
|
||||||
const OSMHotLayer({Key? key}) : super(key: key);
|
const OSMHotLayer({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@ -12,6 +14,7 @@ class OSMHotLayer extends StatelessWidget {
|
||||||
options: TileLayerOptions(
|
options: TileLayerOptions(
|
||||||
urlTemplate: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
|
urlTemplate: 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png',
|
||||||
subdomains: ['a', 'b', 'c'],
|
subdomains: ['a', 'b', 'c'],
|
||||||
|
backgroundColor: _tileLayerBackgroundColor,
|
||||||
tileProvider: _NetworkTileProvider(),
|
tileProvider: _NetworkTileProvider(),
|
||||||
retinaMode: context.select<MediaQueryData, double>((mq) => mq.devicePixelRatio) > 1,
|
retinaMode: context.select<MediaQueryData, double>((mq) => mq.devicePixelRatio) > 1,
|
||||||
),
|
),
|
||||||
|
@ -28,6 +31,7 @@ class StamenTonerLayer extends StatelessWidget {
|
||||||
options: TileLayerOptions(
|
options: TileLayerOptions(
|
||||||
urlTemplate: 'https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.png',
|
urlTemplate: 'https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.png',
|
||||||
subdomains: ['a', 'b', 'c', 'd'],
|
subdomains: ['a', 'b', 'c', 'd'],
|
||||||
|
backgroundColor: _tileLayerBackgroundColor,
|
||||||
tileProvider: _NetworkTileProvider(),
|
tileProvider: _NetworkTileProvider(),
|
||||||
retinaMode: context.select<MediaQueryData, double>((mq) => mq.devicePixelRatio) > 1,
|
retinaMode: context.select<MediaQueryData, double>((mq) => mq.devicePixelRatio) > 1,
|
||||||
),
|
),
|
||||||
|
@ -44,6 +48,7 @@ class StamenWatercolorLayer extends StatelessWidget {
|
||||||
options: TileLayerOptions(
|
options: TileLayerOptions(
|
||||||
urlTemplate: 'https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg',
|
urlTemplate: 'https://stamen-tiles-{s}.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg',
|
||||||
subdomains: ['a', 'b', 'c', 'd'],
|
subdomains: ['a', 'b', 'c', 'd'],
|
||||||
|
backgroundColor: _tileLayerBackgroundColor,
|
||||||
tileProvider: _NetworkTileProvider(),
|
tileProvider: _NetworkTileProvider(),
|
||||||
retinaMode: context.select<MediaQueryData, double>((mq) => mq.devicePixelRatio) > 1,
|
retinaMode: context.select<MediaQueryData, double>((mq) => mq.devicePixelRatio) > 1,
|
||||||
),
|
),
|
||||||
|
|
|
@ -83,7 +83,7 @@ class _Content extends StatefulWidget {
|
||||||
class _ContentState extends State<_Content> with SingleTickerProviderStateMixin {
|
class _ContentState extends State<_Content> with SingleTickerProviderStateMixin {
|
||||||
final List<StreamSubscription> _subscriptions = [];
|
final List<StreamSubscription> _subscriptions = [];
|
||||||
final AvesMapController _mapController = AvesMapController();
|
final AvesMapController _mapController = AvesMapController();
|
||||||
late final ValueNotifier<bool> _isPageAnimatingNotifier;
|
final ValueNotifier<bool> _isPageAnimatingNotifier = ValueNotifier(false);
|
||||||
final ValueNotifier<int?> _selectedIndexNotifier = ValueNotifier(0);
|
final ValueNotifier<int?> _selectedIndexNotifier = ValueNotifier(0);
|
||||||
final ValueNotifier<CollectionLens?> _regionCollectionNotifier = ValueNotifier(null);
|
final ValueNotifier<CollectionLens?> _regionCollectionNotifier = ValueNotifier(null);
|
||||||
final ValueNotifier<LatLng?> _dotLocationNotifier = ValueNotifier(null);
|
final ValueNotifier<LatLng?> _dotLocationNotifier = ValueNotifier(null);
|
||||||
|
@ -102,13 +102,11 @@ class _ContentState extends State<_Content> with SingleTickerProviderStateMixin
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
if (settings.infoMapStyle.isGoogleMaps) {
|
if (settings.infoMapStyle.isGoogleMaps) {
|
||||||
_isPageAnimatingNotifier = ValueNotifier(true);
|
_isPageAnimatingNotifier.value = true;
|
||||||
Future.delayed(Durations.pageTransitionAnimation * timeDilation).then((_) {
|
Future.delayed(Durations.pageTransitionAnimation * timeDilation).then((_) {
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
_isPageAnimatingNotifier.value = false;
|
_isPageAnimatingNotifier.value = false;
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
_isPageAnimatingNotifier = ValueNotifier(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_dotEntryNotifier.addListener(_updateInfoEntry);
|
_dotEntryNotifier.addListener(_updateInfoEntry);
|
||||||
|
|
Loading…
Reference in a new issue