diff --git a/ios/Classes/MapboxMapController.swift b/ios/Classes/MapboxMapController.swift index 127d24d0b..6de7544e2 100644 --- a/ios/Classes/MapboxMapController.swift +++ b/ios/Classes/MapboxMapController.swift @@ -200,7 +200,10 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma result(nil) case "map#queryRenderedFeatures": guard let arguments = methodCall.arguments as? [String: Any] else { return } - let layerIds = arguments["layerIds"] as? Set + var styleLayerIdentifiers: Set? + if let layerIds = arguments["layerIds"] as? [String] { + styleLayerIdentifiers = Set(layerIds) + } var filterExpression: NSPredicate? if let filter = arguments["filter"] as? [Any] { filterExpression = NSPredicate(mglJSONObject: filter) @@ -210,7 +213,7 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma if let x = arguments["x"] as? Double, let y = arguments["y"] as? Double { features = mapView.visibleFeatures( at: CGPoint(x: x, y: y), - styleLayerIdentifiers: layerIds, + styleLayerIdentifiers: styleLayerIdentifiers, predicate: filterExpression ) } @@ -221,7 +224,7 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma { features = mapView.visibleFeatures( in: CGRect(x: left, y: top, width: right, height: bottom), - styleLayerIdentifiers: layerIds, + styleLayerIdentifiers: styleLayerIdentifiers, predicate: filterExpression ) }