MGLShapeSource.features(matching predicate: NSPredicate?) returns 0 features
Platform: iOS Mapbox SDK version: 3.6.1
Steps to trigger behavior
- Add an MGLShapeSource with one MGLShape feature
- Query style for the source by identifier and cast it as MGLShapeSource
- Query features in source with MGLShapeSource.features(matching predicate: NSPredicate?) and nil predicate to retrieve all features
Expected behavior
Return an array of features similar to
(lldb) po source.features(matching: nil)
▿ 2 elements
- 0 : <MGLPolygonFeature: 0x1702cc8d0; count = 4; bounds = { sw = {29.4, -99.1}, ne = {29.4, -99.0}}>
- 1 : <MGLPolygonFeature: 0x1704ce070; count = 4; bounds = { sw = {29.4, -99.1}, ne = {29.4, -99.0}}>
Actual behavior
0 elements are returned
Screenshots
Mapview with purple polygon feature added created in step 1
One thing I noticed is that after the source is retrieved in step 2 from the query from the style the shape attribute of it is nil. Don't know if it is related nor why it is nil even though the feature is added and visible in the map.
Thanks.
The expected behavior example was taken from version 3.5 of the sdk where it was working
Might be similar to https://github.com/mapbox/mapbox-gl-native/issues/9646
Related to #9646 and fixed in #9784.