Better methods to organize the vertical position of layers #1553
Replies: 2 comments 1 reply
-
|
One thing worth bearing in mind, and I'm unsure of this, there could be a performance penalty with having multiple children each with their own rotation, vs one rotation with several children. It's worth trying to test that with any possible solutions (or at least have it somehow as an option still to group some together). |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Converted to #1564 to allow tracking in v6 Release Planning. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Converted to #1564 to allow tracking in v6 Release Planning.
In flutter_map, all
nonRotatedChildrenalways appear on top of allchildren. This can cause issues for some users, who need to be able to control exactly where each layer is positioned within the layer stack, and also need to control whether the layer rotates.As such, it may be desirable in the long term to find a solution to this issue. Three proposals discussed somewhat in #1551 (#1551 (comment), #1551 (comment), #1551 (comment), #1551 (comment)) are listed below, but all FM users are welcome to add their ideas or opinions!
The
builderproposalAn initial suggestion by @rorystephenson, started in #1551, was to introduce (or potentially replace the current
children/nonRotatedChildrenarguments with) abuildermethod. The user would create aStackwidget themselves, using a new widgetFlutterMapTransform.rotateto enable rotation on specific layers.I (@JaffaKetchup) think that having the user handle the stack and opt-in to rotation on layers:
Stackis required, or anotherFlutterMapTransformwrapper is requiredFlutterMapor a related widgetrequires migration across all users(a later proposal made the builder optional via an alternative constructor)The wrapper widget and mixin proposal
I (@JaffaKetchup) proposed an alternative that aimed to solve most of these. Create a widget
NonRotatedLayerthat did nothing more than direct it's builder to build thechildargument, meaning it essentially acts like a tag.nonRotatedChildrenstill appear above all otherchildren, and don't require an explicitNonRotatedLayer, howeverchildrencan use aNonRotatedLayerjust to force non-rotation to its direct descendant, as FM internals would recognise the tag.To avoid redundant wrapping, this could (also) be implemented via a mixin (as proposed by @rorystephenson), and be allowed to be applied to all widgets. This would allow maximum flexibility.
However, as pointed out by @rorystephenson, this will not work if the layer is not directly below the
children. If it is a descendant of, lets say aFutureBuilder, the effect will not apply.I'm (@JaffaKetchup) not sure this is an issue, as either method does not restrict it's
childtype, so the order of theFutureBuilderand mixin/NonRotatedLayercould be swapped to restore functionality.Beta Was this translation helpful? Give feedback.
All reactions