@@ -3,7 +3,6 @@ import 'dart:math' as math;
3
3
4
4
import 'package:collection/collection.dart' show MapEquality;
5
5
import 'package:flutter/material.dart' ;
6
- import 'package:flutter/widgets.dart' ;
7
6
import 'package:flutter_map/plugin_api.dart' ;
8
7
import 'package:flutter_map/src/layer/tile_layer/tile.dart' ;
9
8
import 'package:flutter_map/src/layer/tile_layer/tile_bounds/tile_bounds.dart' ;
@@ -104,6 +103,11 @@ class TileLayer extends StatefulWidget {
104
103
final TileDisplay tileDisplay;
105
104
106
105
/// Color shown behind the tiles
106
+ @Deprecated (
107
+ 'Prefer `MapOptions.backgroundColor`. '
108
+ 'This property has been removed simplify interaction when using multiple `TileLayer`s. '
109
+ 'This property is deprecated since v6.' ,
110
+ )
107
111
final Color backgroundColor;
108
112
109
113
/// Provider with which to load map tiles
@@ -231,7 +235,7 @@ class TileLayer extends StatefulWidget {
231
235
this .subdomains = const < String > [],
232
236
this .keepBuffer = 2 ,
233
237
this .panBuffer = 0 ,
234
- this .backgroundColor = const Color ( 0xFFE0E0E0 ) ,
238
+ this .backgroundColor = Colors .transparent ,
235
239
this .errorImage,
236
240
TileProvider ? tileProvider,
237
241
this .tms = false ,
@@ -474,7 +478,8 @@ class _TileLayerState extends State<TileLayer> with TickerProviderStateMixin {
474
478
475
479
_tileScaleCalculator.clearCacheUnlessZoomMatches (map.zoom);
476
480
477
- return Container (
481
+ return ColoredBox (
482
+ // ignore: deprecated_member_use_from_same_package
478
483
color: widget.backgroundColor,
479
484
child: Stack (
480
485
children: [
0 commit comments