diff --git a/lib/src/layer/shared/layer_projection_simplification/state.dart b/lib/src/layer/shared/layer_projection_simplification/state.dart index d15a5861c..b65cb0cd6 100644 --- a/lib/src/layer/shared/layer_projection_simplification/state.dart +++ b/lib/src/layer/shared/layer_projection_simplification/state.dart @@ -42,10 +42,10 @@ mixin ProjectionSimplificationManagement< /// /// Do not use before invoking [build]. Only necessarily up to date directly /// after [build] has been invoked. - late Iterable simplifiedElements; + late List simplifiedElements; - Iterable? _cachedProjectedElements; - final _cachedSimplifiedElements = >{}; + List? _cachedProjectedElements; + final _cachedSimplifiedElements = >{}; double? _devicePixelRatio; @@ -89,12 +89,12 @@ mixin ProjectionSimplificationManagement< } simplifiedElements = - (_cachedSimplifiedElements[camera.zoom.floor()] ??= _simplifyElements( + _cachedSimplifiedElements[camera.zoom.floor()] ??= _simplifyElements( camera: camera, projectedElements: projected, pixelTolerance: widget.simplificationTolerance, devicePixelRatio: newDPR, - )); + ).toList(growable: false); } return Builder(