Skip to content

Commit dc24088

Browse files
feat: add separate RotatedOverlayImage.transformFilterQuality parameter (#2169)
Co-authored-by: JaffaKetchup <github@jaffaketchup.dev>
1 parent 8be2db8 commit dc24088

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

lib/src/layer/overlay_image_layer/overlay_image.dart

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ abstract class BaseOverlayImage extends StatelessWidget {
1818

1919
/// The [FilterQuality] of the image, used to define how high quality the
2020
/// overlay image should have on the map.
21+
///
22+
/// Defaults to [FilterQuality.medium].
2123
final FilterQuality filterQuality;
2224

2325
/// Display an [Image] on the map at a specific coordinate location
@@ -115,6 +117,19 @@ class RotatedOverlayImage extends BaseOverlayImage {
115117
/// The coordinates of the bottom right corner of the image.
116118
final LatLng bottomRightCorner;
117119

120+
/// The [FilterQuality] of the transformed image.
121+
///
122+
/// See [Transform.filterQuality] for more information.
123+
///
124+
/// See [filterQuality] for the quality of the image before transformation.
125+
///
126+
/// When non-null (as by default), the bitmap render result of the
127+
/// transformation is cached by Flutter. This may improve performance, but can
128+
/// cause flickering on zooming when the raster cache is at its limits.
129+
///
130+
/// Defaults to [FilterQuality.medium].
131+
final FilterQuality? transformFilterQuality;
132+
118133
/// Create a new [RotatedOverlayImage] instance that can be provided to the
119134
/// [OverlayImageLayer].
120135
const RotatedOverlayImage({
@@ -123,6 +138,7 @@ class RotatedOverlayImage extends BaseOverlayImage {
123138
required this.topLeftCorner,
124139
required this.bottomLeftCorner,
125140
required this.bottomRightCorner,
141+
this.transformFilterQuality = FilterQuality.medium,
126142
super.filterQuality,
127143
super.opacity,
128144
super.gaplessPlayback,
@@ -167,7 +183,7 @@ class RotatedOverlayImage extends BaseOverlayImage {
167183
height: bounds.size.height,
168184
child: Transform(
169185
transform: Matrix4(a, b, 0, 0, c, d, 0, 0, 0, 0, 1, 0, tx, ty, 0, 1),
170-
filterQuality: filterQuality,
186+
filterQuality: transformFilterQuality,
171187
child: child,
172188
),
173189
);

0 commit comments

Comments
 (0)