-
-
Notifications
You must be signed in to change notification settings - Fork 860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Re-instate Anchor on Marker #1552
Comments
I think the best option out of those is the first one. The second one is too complex for users to understand. I don't think the re-calculation will be much of an issue, but I can imagine your second point about ambiguity being potentially annoying. However, I also wonder whether something like this would be OK? Unless I'm completely missing something, this wouldn't require a new calculation for every marker build, and it solves the second point. // In constructor
AnchorPos? anchor,
}) : _anchor = whatever(anchor);
// In class
final Anchor? _anchor;
Anchor get anchor => _anchor ?? layerAnchor; |
@JaffaKetchup I think what you proposed is similar to the option 2 I suggested. See this branch for what that would look like: https://github.com/fleaflet/flutter_map/compare/master...rorystephenson:flutter_map:restore-marker-anchor?expand=1 MarkerLayer keeps the anchorPos option rather than anchor because anchor requires the width/height of the Marker which you can only know at the MarkerLayer level if they are all the same. Alternatively we could revert to the old behaviour of only setting the anchor/anchorPos at the marker level. |
@rorystephenson I think it's similar. The difference is the user still defines the |
@JaffaKetchup ahhh I misunderstood what you were proposing, much better! As for the default value I've still included it because it is required by plugins which need to know what a Marker's anchor will be. For example flutter_map_marker_popup needs to know the anchor because it can position popups relative to the Marker. Adding a default value allows any change in the default to be automatically updated in packages which rely on it. See #1558. |
Closed through merging of #1558. Thanks @rorystephenson! |
What do you want implemented?
I'm opening this issue to continue a discussion I started here: #1532 (review)
In flutter_map 5.0.0 Marker's Anchor was replaced with AnchorPos. This was done for consistency with the newly added option to define AnchorPos at the MarkerLayer level. There are, however, two drawbacks to this approach:
What other alternatives are available?
Can you provide any other information?
@JaffaKetchup I've elaborated on a couple of options. Let me know what you think.
Severity
Annoying: Currently have to use workarounds
The text was updated successfully, but these errors were encountered: