mapbox-maps-ios
mapbox-maps-ios copied to clipboard
querySourceFeatures returns wrong type for 'cluster_id'
Environment
- Xcode version: 13.2.1
- iOS version: latest
- Devices affected: IPhone 12, IOS Similator
- Maps SDK Version: 10.2.0
Observed behavior and steps to reproduce
I use the querySourceFeatures call from mapbox SDK to get the cluster_id value that I need to highlight the cluster on the map. But there is an issue with type conversion value for cluster_id in MapboxCoreMaps. The querySourceFeatures function returns the wrong type when cluster_id=1 (in MapboxCoreMaps, this value is converted to boolean type instead of number, i.e. now I get cluster_id=true ).
I have attached a screenshot for more details:
Expected behavior
I'm expecting to get the value of cluster_id as a numeric value.
Additional links and references
It seems to me that a similar issue was here: https://github.com/mapbox/mapbox-maps-ios/issues/726
Also I noticed that queryFeatureExtension call where feature.identifier=1 always returns an error.
self.mapView.mapboxMap.queryFeatureExtension(for: sourceId, feature: feature, extension: "supercluster", extensionField: "leaves") { extensionResult in ...
@alexeysatsunkevich thank you for reporting this issue. I am able to reproduce this on v10.2.0 with our SymbolClusteringExample and will investigate the root cause.