-
Notifications
You must be signed in to change notification settings - Fork 127
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
[BUG] Adding an existing source causes app to crash #512
Comments
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. |
It should be fixed. In some cases even this will not help: final existingSources = await _getVehicleSourceIds();
if (existingSources.contains(sourceId)) {
_logger.warning('_addSource() existingSources contains $sourceId, do _setSource');
await _setSource(sourceId, json);
return;
}
await _mapController.addGeoJsonSource(sourceId, json);
await _addCirclesLayer(sourceId);
await _addNamesLayer(sourceId);
} |
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
The text was updated successfully, but these errors were encountered: