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

querySourceFeatures returns wrong type for 'cluster_id'

Open alexeysatsunkevich opened this issue 3 years ago • 2 comments

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:

Screenshot 2022-01-28 at 15 12 26

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

alexeysatsunkevich avatar Jan 28 '22 12:01 alexeysatsunkevich

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 avatar Jan 28 '22 16:01 alexeysatsunkevich

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

Screen Shot 2022-01-28 at 4.48.36 PM.png

ZiZasaurus avatar Jan 28 '22 22:01 ZiZasaurus