Cannot add features after remove features
Environment
- Xcode version: 15.1
- iOS version: 17.2
- Devices affected: iPhone 15
- Maps SDK Version: 11.0.0
Observed behavior and steps to reproduce
Calling removeGeoJSONSourceFeatures and then calling addGeoJSONSourceFeatures will not add the new features to the source. It works without issues if I set a delay between the calls.
Expected behavior
The new features should be added to the source without the need to set a delay.
@fawzirifai thanks for reporting this issue. I am testing locally, however, I cannot get this reproduced yet. It would be great if you could provide more details about your case, or a reproducible example would be even more appreciated.
- removeGeoJSONSourceFeatures, what's the input of this call? do you pass a user data Id along with it?
- addGeoJSONSourceFeatures, what's the input of this call? Are you adding back the same features you removed from the first call?
- set a delay between the calls, how long did the delay you set?
- How did you verify the features being added or not? Through the
SourceDataLoadedevents or by observing visual effects related to the source? - Are you calling from the functions from the main thread or other worker thread?
AddFeatures.zip Please check the attached sample project. @zmiao
- A feature identifier that's not available in the source. I don't pass data id.
- Yes, I am adding the same feature, after removing it.
- 0.1s
- I am looking for them on the map.
- From the main thread. @zmiao
Notice that if the feature I want to remove was already in the source, this issue does not occur. @zmiao
@fawzirifai thanks for the reproducible example, the root cause is found, a fix is in progress.