maplibre / flutter-maplibre-gl

Customizable, performant and vendor-free vector and raster maps, flutter wrapper for maplibre-native and maplibre-gl-js (fork of flutter-mapbox-gl/maps)
https://pub.dev/packages/maplibre_gl
Other
186 stars 106 forks source link

Invalid filter value: filter property must be a string #379

Open bohdancorpsoft opened 4 months ago

bohdancorpsoft commented 4 months ago

App crashes when I try to create a style layer with following filter: [ "all", [ "!=", "cluster", true ], [ "has", "displayType" ], [ "==", "displayType", "map-marker" ] ]

Output from XCode:

<MGLShapeSource: 0x282cc5540; identifier = KRCYUYFpXH_0; URL = (null); shape = <MGLShapeCollectionFeature: 0x2800280f0>> <MGLShapeSource: 0x282ccfa20; identifier = KRCYUYFpXH_1; URL = (null); shape = <MGLShapeCollectionFeature: 0x2803da9a0>> <MGLShapeSource: 0x282cc21c0; identifier = tRWo2NuN1x_0; URL = (null); shape = <MGLShapeCollectionFeature: 0x2803db6c0>> <MGLShapeSource: 0x282ce46e0; identifier = ItS6YWw4Pz_0; URL = (null); shape = <MGLShapeCollectionFeature: 0x2803ddb60>> <MGLShapeSource: 0x282ce4690; identifier = 8E2KQOgI6O_0; URL = (null); shape = <MGLShapeCollectionFeature: 0x2803dea00>> <MGLShapeSource: 0x282ce4af0; identifier = 8E2KQOgI6O_1; URL = (null); shape = <MGLShapeCollectionFeature: 0x2803df540>> NSPredicate: Use of 'mgl_does:have:' as an NSExpression function is forbidden. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Invalid filter value: filter property must be a string' *** First throw call stack: (0x18cb9a678 0x184e4bc80 0x18cc1f494 0x106fb3b30 0x106f33b6c 0x108783e48 0x10878345c 0x10876f938 0x108762b2c 0x108762bd8 0x10d8e5564 0x10d341644 0x108970f50 0x108972b34 0x108982fec 0x108982ba0 0x18cae4f9c 0x18cae1ca8 0x18cae13f8 0x1d00674f8 0x18ef078a0 0x18ef06edc 0x1041f0e34 0x1af82edcc) NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'MGL_FUNCTION' as an NSExpression function is forbidden. NSPredicate: Use of 'mgl_does:have:' as an NSExpression function is forbidden. libc++abi: terminating due to uncaught exception of type NSException

m0nac0 commented 4 months ago

Could you please try [ "all", [ "!=", "cluster", true ], [ "has", "displayType" ], [ "==", ["get", "displayType"], "map-marker" ] ] ? Or if that does not work try to hunt down which sub-expression causes the issue by removing them one-by-one (e.g. test only [ "all", [ "!=", "cluster", true ], [ "has", "displayType" ] or [ "all", [ "has", "displayType" ], [ "==", "displayType", "map-marker" ] ] etc.)?