diff --git a/CHANGELOG.md b/CHANGELOG.md index 4746ab90c..09acf58e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,10 +4,15 @@ This version has support for sound null safety. For this purpose, some inactive - Sound null safety migration (#851, #870) - requires flutter version 2.0.0 or higher - latlong is replaced with latlong2 + - ready-flag on map has been removed - Remove the package flutter_image and add http instead (#894) - http has to be version 0.13.2 or higher for this package (#894) +- Removed deprecated properties + - debug property has been removed + - interactive has been replaced by interactiveFlags +- Bounds getCenter has been replaced by center getter -Thanks to escamoteur, ThexXTURBOXx, Sata51, tazik561, kengu, passsy, Ahmed-gubara, johnpryan and josxha for this release! +Thanks to escamoteur, ThexXTURBOXx, Sata51, tazik561, kengu, passsy, Ahmed-gubara, johnpryan, josxha and andreandersson for this release! ## [0.12.0] - 3/16/2021 TileLayerOptions now takes some additional options, templateFunction, diff --git a/example/lib/pages/custom_crs/custom_crs.dart b/example/lib/pages/custom_crs/custom_crs.dart index 0cc0e8682..bdb7a7536 100644 --- a/example/lib/pages/custom_crs/custom_crs.dart +++ b/example/lib/pages/custom_crs/custom_crs.dart @@ -37,7 +37,6 @@ class _CustomCrsPageState extends State { // EPSG:3413 is a user-defined projection from a valid Proj4 definition string // From: http://epsg.io/3413, proj definition: http://epsg.io/3413.proj4 // Find Projection by name or define it if not exists - // TODO the warning here will go away as soon as proj4 is migrated to null safety epsg3413 = proj4.Projection.get('EPSG:3413') ?? proj4.Projection.add('EPSG:3413', '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs'); diff --git a/example/lib/pages/network_tile_provider.dart b/example/lib/pages/network_tile_provider.dart index e9eba1ffc..3d9ebccec 100644 --- a/example/lib/pages/network_tile_provider.dart +++ b/example/lib/pages/network_tile_provider.dart @@ -55,8 +55,8 @@ class NetworkTileProviderPage extends StatelessWidget { Padding( padding: EdgeInsets.only(top: 8.0, bottom: 8.0), child: Wrap(children: [ - Text('This is a map that is using NetworkTileProvider.'), - Text('Turn on flight mode to see that images are cached.'), + Text('This Provider does not provide caching.'), + Text('For further options about that, check flutter_map\'s README on GitHub.'), ]), ), Flexible( diff --git a/lib/flutter_map.dart b/lib/flutter_map.dart index 6db99f69e..7fade1536 100644 --- a/lib/flutter_map.dart +++ b/lib/flutter_map.dart @@ -122,8 +122,6 @@ abstract class MapController { /// through the [options] parameter. void fitBounds(LatLngBounds bounds, {FitBoundsOptions? options}); - bool get ready; - Future get onReady; LatLng get center; @@ -221,10 +219,6 @@ class MapOptions { final double? minZoom; final double? maxZoom; - @deprecated - final bool debug; // TODO no usage outside of constructor. Marked for removal? - @Deprecated('use interactiveFlags instead') - final bool? interactive; /// see [InteractiveFlag] for custom settings final int interactiveFlags; @@ -268,12 +262,7 @@ class MapOptions { MultiFingerGesture.pinchZoom | MultiFingerGesture.pinchMove, this.minZoom, this.maxZoom, - @Deprecated('') this.debug = false, - @Deprecated('Use interactiveFlags instead') this.interactive, - // TODO: Change when [interactive] is removed. - // Change this to [this.interactiveFlags = InteractiveFlag.all] and remove - // [interactiveFlags] from initializer list - int? interactiveFlags, + this.interactiveFlags = InteractiveFlag.all, this.allowPanning = true, this.onTap, this.onLongPress, @@ -286,9 +275,7 @@ class MapOptions { this.controller, this.swPanBoundary, this.nePanBoundary, - }) : interactiveFlags = interactiveFlags ?? - (interactive == false ? InteractiveFlag.none : InteractiveFlag.all), - center = center ?? LatLng(50.5, 30.51), + }) : center = center ?? LatLng(50.5, 30.51), assert(rotationThreshold >= 0.0), assert(pinchZoomThreshold >= 0.0), assert(pinchMoveThreshold >= 0.0) { @@ -365,7 +352,7 @@ class MapOptions { double _calculateScreenHeightInDegrees() => screenSize!.height * 170.102258 / pow(2, _getControllerZoom() + 8); - double _getControllerZoom() => controller!.ready ? controller!.zoom : zoom; + double _getControllerZoom() => controller!.zoom; } class FitBoundsOptions { diff --git a/lib/src/core/bounds.dart b/lib/src/core/bounds.dart index fbb204b17..3aa96eb5d 100644 --- a/lib/src/core/bounds.dart +++ b/lib/src/core/bounds.dart @@ -32,13 +32,10 @@ class Bounds { } /// This [Bounds] central point. - CustomPoint getCenter() { - //TODO should this be a getter? - return CustomPoint( - (min.x + max.x) / 2, - (min.y + max.y) / 2, - ); - } + CustomPoint get center => CustomPoint( + (min.x + max.x) / 2, + (min.y + max.y) / 2, + ); /// Bottom-Left corner's point. CustomPoint get bottomLeft => CustomPoint(min.x, max.y); diff --git a/lib/src/layer/tile_layer.dart b/lib/src/layer/tile_layer.dart index 34f6061eb..f7330e6ef 100644 --- a/lib/src/layer/tile_layer.dart +++ b/lib/src/layer/tile_layer.dart @@ -110,10 +110,10 @@ class TileLayerOptions extends LayerOptions { /// Opacity of the rendered tile final double opacity; - /// Provider to load the tiles. The default is CachedNetworkTileProvider, - /// which loads tile images from network and caches them offline. - /// - /// If you don't want to cache the tiles, use NetworkTileProvider instead. + /// Provider to load the tiles. The default is `NonCachingNetworkTileProvider()` which + /// doesn't cache tiles and won't retry the HTTP request. Use `NetworkTileProvider()` for + /// a provider which will retry requests. For the best caching implementations, see the + /// flutter_map readme. /// /// In order to use images from the asset folder set this option to /// AssetTileProvider() Note that it requires the urlTemplate to target @@ -925,7 +925,7 @@ class _TileLayerState extends State with TickerProviderStateMixin { var pixelBounds = _getTiledPixelBounds(center); var tileRange = _pxBoundsToTileRange(pixelBounds); - var tileCenter = tileRange.getCenter(); + var tileCenter = tileRange.center; final queue = >[]; var margin = options.keepBuffer; var noPruneRange = Bounds( diff --git a/lib/src/map/map.dart b/lib/src/map/map.dart index 408f4eee4..3706f365e 100644 --- a/lib/src/map/map.dart +++ b/lib/src/map/map.dart @@ -51,10 +51,6 @@ class MapControllerImpl implements MapController { _state.fitBounds(bounds, options!); } - @override - // TODO Remove getter since ready is always true (breaking change, was '=> _state != null' when state is never null) - bool get ready => true; - @override LatLng get center => _state.center;