-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[ios] predicateWithMGLJSONObject can return Invalid filter value: filter property must be a string
#14805
Comments
See https://github.com/react-native-mapbox-gl/maps/issues/70 The issue seems to be that the following JSON [
'all',
['==', '$type', 'Point'],
['in', 'type', 'Blue Project', 'WFW Project']
] Becomes the following NSPredicate for "$type" == "Point" AND MGL_FUNCTION("in", "type", "Blue Project", "WFW Project") == 1 And for that [
'all',
['==', '$type', 'Point'],
['==', ['in', 'type', 'Blue Project', 'WFW Project'], 1]
] And it sounds like the first argument to Seems to be coming from mapbox-gl-native/src/mbgl/style/conversion/filter.cpp Lines 132 to 146 in 3ceabcd
mapbox-gl-native/src/mbgl/style/conversion/filter.cpp Lines 207 to 211 in 3ceabcd
|
Thanks for the detailed report @mfazekas! |
|
@1ec5 nevermind if i convert "in" to expression from legacy filter as well it works fine: @[
@"all",
@[@"==", @[@"geometry-type"], @"Point"],
@[@"match",
@[@"get", @"type"],
@[@"Blue Project", @"WFW Project"], @YES,
@NO]
] |
Using
predicateWithMGLJSONObject
can returnInvalid filter value: filter property must be a string
for a valid expression because of NSPredicate conversion.Steps to reproduce
Expected behavior
Expected to work.
Actual behavior
Raises exception:
Configuration
Mapbox SDK versions: 316584f - 5.1.0.alpha1
iOS/macOS versions: 12.2/10.14.4
Device/simulator models: iPhone X
Xcode version: 10.2.1
The text was updated successfully, but these errors were encountered: