File tree 3 files changed +12
-8
lines changed
3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,12 @@ base class _PolygonPainter<R extends Object>
52
52
required math.Point <double > point,
53
53
required LatLng coordinate,
54
54
}) {
55
- final polygon = projectedPolygon.polygon;
56
- if (! polygon.boundingBox.contains (coordinate)) {
57
- return false ;
58
- }
55
+ // TODO: We should check the bounding box here, for efficiency
56
+ // However, we need to account for map rotation
57
+ //
58
+ // if (!polygon.boundingBox.contains(touch)) {
59
+ // continue;
60
+ // }
59
61
60
62
final projectedCoords = getOffsetsXY (
61
63
camera: camera,
Original file line number Diff line number Diff line change @@ -25,9 +25,11 @@ base class _PolylinePainter<R extends Object>
25
25
}) {
26
26
final polyline = projectedPolyline.polyline;
27
27
28
- // TODO: For efficiency we'd ideally filter by bounding box here. However
29
- // we'd need to compute an extended bounding box that accounts account for
30
- // the `borderStrokeWidth` & the `minimumHitbox`
28
+ // TODO: We should check the bounding box here, for efficiency
29
+ // However, we need to account for:
30
+ // * map rotation
31
+ // * extended bbox that accounts for `minimumHitbox`
32
+ //
31
33
// if (!polyline.boundingBox.contains(touch)) {
32
34
// continue;
33
35
// }
Original file line number Diff line number Diff line change @@ -347,7 +347,7 @@ class _TileLayerState extends State<TileLayer> with TickerProviderStateMixin {
347
347
348
348
late final _resetSub = widget.reset? .listen ((_) {
349
349
_tileImageManager.removeAll (widget.evictErrorTileStrategy);
350
- _loadAndPruneInVisibleBounds (MapCamera .of (context));
350
+ if (mounted) _loadAndPruneInVisibleBounds (MapCamera .of (context));
351
351
});
352
352
353
353
// This is called on every map movement so we should avoid expensive logic
You can’t perform that action at this time.
0 commit comments