Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add filterQuality parameter to (Base)OverlayImage #1989

Merged
merged 1 commit into from
Nov 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions lib/src/layer/overlay_image_layer/overlay_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ sealed class BaseOverlayImage extends StatelessWidget {
/// (false), when the image provider changes. The default value is false.
final bool gaplessPlayback;

/// The [FilterQuality] of the image, used to define how high quality the
/// overlay image should have on the map.
final FilterQuality filterQuality;

const BaseOverlayImage({
super.key,
required this.imageProvider,
this.opacity = 1,
this.gaplessPlayback = false,
this.filterQuality = FilterQuality.medium,
});

Widget _render(
Expand All @@ -36,6 +41,7 @@ sealed class BaseOverlayImage extends StatelessWidget {
color: Color.fromRGBO(255, 255, 255, opacity),
colorBlendMode: BlendMode.modulate,
gaplessPlayback: gaplessPlayback,
filterQuality: filterQuality,
),
camera: MapCamera.of(context),
);
Expand All @@ -57,6 +63,7 @@ class OverlayImage extends BaseOverlayImage {
required this.bounds,
super.opacity,
super.gaplessPlayback,
super.filterQuality,
});

@override
Expand Down Expand Up @@ -99,10 +106,6 @@ class RotatedOverlayImage extends BaseOverlayImage {
/// The coordinates of the bottom right corner of the image.
final LatLng bottomRightCorner;

/// The [FilterQuality] of the image, used to define how high quality the
/// overlay image should have on the map.
final FilterQuality? filterQuality;

/// Create a new [RotatedOverlayImage] instance that can be provided to the
/// [OverlayImageLayer].
const RotatedOverlayImage({
Expand All @@ -111,7 +114,7 @@ class RotatedOverlayImage extends BaseOverlayImage {
required this.topLeftCorner,
required this.bottomLeftCorner,
required this.bottomRightCorner,
this.filterQuality = FilterQuality.medium,
super.filterQuality,
super.opacity,
super.gaplessPlayback,
});
Expand Down
Loading