Open albertmoravec opened 1 month ago
Not sure if this can be fixed from Swift side, so I opened an issue on MapLibre Native.
@albertmoravec I’ve also run into this issue multiple times – the same problem also occurs on Android
This was also an issue on the mapbox version of this plugin, any platform exceptions cause a full on app crash.
The solution I have been working with is to keep track of which layers you have added to your map in a provider and remove the layer and re-add with the new data. It's not ideal but it works and the performance hit isn't huge.
Platforms
iOS
Version of flutter maplibre_gl
0.20.0
Bug Description
Calling
controller.addSource()
more than once for the same source causes app crash on iOS withMLNRedundantSourceIdentifierException
.Steps to Reproduce
controller.addSource('123', VectorSourceProperties(...))
.controller.addSource('123', VectorSourceProperties(...))
again with the same ID.Expected Results
Exception should be returned.
Actual Results
App completely crashes with
MLNRedundantSourceIdentifierException
, not providing any option to handle the exception.Code Sample