Repository navigation
Conversation
Fixes fleaflet#2270. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016Y3VBYvK7DWkxsahXMaLYz
|
Please see why the attached issue was closed. Out of an abundance of caution changing this code, I don't want to do it without good reason. And why this may seem to make sense, I cannot be sure that this will not break something else. Especially as the initial bug report seemed to be suggesting that this was reproducing using explicitly unsupported behaviour (use of the controller to set the camera before first build). If I've misunderstood something, please ping me, and I'll have a second look. Worth noting for readers that this part of code goes all the way back to the big state rewrites in v6 at flutter_map/lib/src/map/widget.dart Line 171 in 2c60d63 |
|
See #2270 (comment): the same failure reproduces through |
Fixes #2270
Cause:
_updateAndEmitSizeIfConstraintsChangedcaptures the camera at layout and emits it in a post-frame callback. Amove/fitCamerafrom an earlier post-frame callback is overtaken by this stale event, so a debouncedTileLayerloads/prunes for the pre-move camera.Fix: read
_mapController.camerawhen emitting, not at layout.Test:
test/layer/tile_layer/tile_update_after_early_fit_test.dart— fails without the fix (only z3 tiles load), passes with it.Generated with Claude Code