mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Cannot add features after remove features

Open fawzirifai opened this issue 2 years ago • 5 comments

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 avatar Dec 24 '23 18:12 fawzirifai

@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.

  1. removeGeoJSONSourceFeatures, what's the input of this call? do you pass a user data Id along with it?
  2. addGeoJSONSourceFeatures, what's the input of this call? Are you adding back the same features you removed from the first call?
  3. set a delay between the calls, how long did the delay you set?
  4. How did you verify the features being added or not? Through the SourceDataLoaded events or by observing visual effects related to the source?
  5. Are you calling from the functions from the main thread or other worker thread?

zmiao avatar Jan 04 '24 09:01 zmiao

AddFeatures.zip Please check the attached sample project. @zmiao

fawzirifai avatar Jan 08 '24 16:01 fawzirifai

  1. A feature identifier that's not available in the source. I don't pass data id.
  2. Yes, I am adding the same feature, after removing it.
  3. 0.1s
  4. I am looking for them on the map.
  5. From the main thread. @zmiao

fawzirifai avatar Jan 08 '24 16:01 fawzirifai

Notice that if the feature I want to remove was already in the source, this issue does not occur. @zmiao

fawzirifai avatar Jan 08 '24 16:01 fawzirifai

@fawzirifai thanks for the reproducible example, the root cause is found, a fix is in progress.

zmiao avatar Jan 09 '24 18:01 zmiao