-
Notifications
You must be signed in to change notification settings - Fork 509
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
Annotation manager moved to dart #779
Conversation
Overall I like this direction, but I will need to test if all of the features are still working fine. Annotations on both Android and iOS are some experimental plugins that are not maintained for years. I don't even understand why something like https://github.com/mapbox/mapbox-annotation-extension is still used by Mapbox powering some crucial features drawing something on top of the map, even though it clearly says there that repo If we will be able to rebuild all of the annotation features using geoJSON it might get easier to support them. |
For the next release we could keep the old code in place as well. Bot methods can life fine next to each other. |
@felix-ht We can generate the codes for annotation managers. |
@Chaoba I don't think we would gain to much by generating them. With the current implementation the code needed per manager is pretty limited. For lines this is all: class LineManager extends _AnnotationManager<Line> {
LineManager(MapboxMapController controller, {void Function(Line)? onTap})
: super(controller, onTap: onTap);
@override
LayerProperties get properties => const LineLayerProperties(
lineOpacity: [Expressions.get, 'lineOpacity'],
lineColor: [Expressions.get, 'lineColor'],
lineWidth: [Expressions.get, 'lineWidth'],
lineGapWidth: [Expressions.get, 'lineGapWidth'],
lineOffset: [Expressions.get, 'lineOffset'],
lineBlur: [Expressions.get, 'lineBlur'],
);
} |
a0459dd
to
37175a2
Compare
37175a2
to
fa33b77
Compare
8eb02b9
to
1b34a12
Compare
c50d89c
to
7210ea1
Compare
949682b
to
e1e5dc0
Compare
e1e5dc0
to
277d431
Compare
277d431
to
1967050
Compare
@m0nac0 do you want to still take a look as well or are you fine with me merging it? |
Feel free to merge! Are you planning on keeping both the old and the new approach for the next release? |
Asset Images added to the style are not showing on the ios platform. |
I tested it and automatic loading of assets is currently not working for ios. They have to be added manually (as it is done with add(asset image)). We have to handle the callbacks properly for ios for this to work. But i would solve that in a future PR. This one is large enough as it is. This would also be good for normal feature layers. @m0nac0 yes i would like to keep the old and the new api - we can deprecate it down the line tho. Than we could even move the annotation stuff to a separate package that just uses the apis exposed by this. |
Amazing work @felix-ht !
Great, I'd suggest putting a prominent note in the changelog to tell users about the rewrite and invite them to test it. (But I'm sure you planned something like this anyways 😄 ) |
@felix-ht will give more details, but it seems to be a bug in the original Mapbox Android SDK that is no longer maintained |
Sorry I just realized I was using the wrong version which did not have these changes. I confirm that android performance problems are fixed after this merge though it introduces another issue which causes lines and markers that are drawn on map won't be cleared |
With the addition of layers, we now have have the option to implement the annotation manager code in dart. This significantly reduces the required plugin surface area. This PR does this migration while keeping the old api stable.
New Features