Skip to content

Commit

Permalink
Fix 'TileLayer Reset' Example (#1372)
Browse files Browse the repository at this point in the history
* Fix Reset TileLayer example

* dart format to fix pipeline checks
  • Loading branch information
JosefWN authored Sep 23, 2022
1 parent 678a8ab commit 9e7bf7c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion example/lib/pages/reset_tile_layer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ResetTileLayerPageState extends State<ResetTileLayerPage> {
StreamController<void> resetController = StreamController.broadcast();

String layer1 = 'https://tile.openstreetmap.org/{z}/{x}/{y}.png';
String layer2 = 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';
String layer2 = 'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';
bool layerToggle = true;

@override
Expand Down Expand Up @@ -79,6 +79,7 @@ class ResetTileLayerPageState extends State<ResetTileLayerPage> {
TileLayer(
reset: resetController.stream,
urlTemplate: layerToggle ? layer1 : layer2,
subdomains: layerToggle ? const [] : const ['a', 'b', 'c'],
userAgentPackageName: 'dev.fleaflet.flutter_map.example',
),
MarkerLayer(markers: markers)
Expand Down
6 changes: 4 additions & 2 deletions lib/flutter_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,9 @@ class MapOptions {
class FitBoundsOptions {
final EdgeInsets padding;
final double maxZoom;
@Deprecated('This property is unused and will be removed in the next major release.')
@Deprecated(
'This property is unused and will be removed in the next major release.')

/// TODO: remove this property in the next major release.
final double? zoom;
final bool inside;
Expand All @@ -342,7 +344,7 @@ class FitBoundsOptions {
this.padding = EdgeInsets.zero,
this.maxZoom = 17.0,
@Deprecated('This property is unused and will be removed in the next major release.')
this.zoom,
this.zoom,
this.inside = false,
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class FMNetworkImageProvider extends ImageProvider<FMNetworkImageProvider> {
FMNetworkImageProvider key,
DecoderBufferCallback decode, [
bool useFallback = false,
]) async {
]) async {
assert(key == this);
assert(useFallback == false || fallbackUrl != null);

Expand All @@ -58,9 +58,9 @@ class FMNetworkImageProvider extends ImageProvider<FMNetworkImageProvider> {
statusCode: response.statusCode, uri: uri);
}

final codec =
await decode(await ImmutableBuffer.fromUint8List(response.bodyBytes));
final image = (await codec.getNextFrame()).image;
final codec =
await decode(await ImmutableBuffer.fromUint8List(response.bodyBytes));
final image = (await codec.getNextFrame()).image;

return ImageInfo(image: image);
} catch (e) {
Expand Down

0 comments on commit 9e7bf7c

Please sign in to comment.