In the mapView:didFinishLoadingStyle: method, I would like to be able to check to see if a MGLSymbolStyleLayer uses a specific class, similar to how we can use filter in a JSON style file to apply a style to only a certain class:
However, in my case, I want to check and see if a class exists on the map, and then hide it if it is part of an array of strings:
NSArray *poiTypesExcluded = @[@"airport"];
for (NSString *poiType in poiTypesExcluded) {
layer.visible = [NSExpression expressionWithFormat:@"class != %@", poiType];
}
This is giving me the error:
Unable to parse the format string "class != %@ == 1".
Any help on how to write the NSExpression to be able to compare a class property to another string?
