Add customId for for animated movements and don't trigger movement when it isn't necessary #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding an optional customId allows users to change the TileLayer's tileUpdateTransformer behaviour based on what triggers an animated movement.
In passing I noticed that it was possible to optimise the movement such that no calls to the MapController are made if no movement occurs and if both movement/rotation occur the MapControllers moveAndRotate method is used which is more efficient than calling both move() and rotate().
I also added a check to make sure that if we animate movement that we don't repeat the last movement (when animation.value == 1.0) and that we use the AnimatedMoveId.finish id exactly once.
Note in working on this I noticed a bug in my work for flutter_map 4.0.0 that actually breaks tileUpdateTransformers. The fix is merged in to master (fleaflet/flutter_map#1534) which will be released in 4.0.0. If it's helpful I have a branch on my own fork to apply it to 4.0.0: https://github.com/rorystephenson/flutter_map/tree/map-id-fix
Don't hesitate to modify/remove my changes if you don't like them. The reduced calls to MapController is actually technically a breaking change.