From 792e3cb0697bfa5197be78f803e323e62fb63993 Mon Sep 17 00:00:00 2001 From: Francesco Date: Sun, 23 Jan 2022 01:31:34 +0100 Subject: [PATCH 1/2] fix #869 --- ios/Classes/MapboxMapController.swift | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ios/Classes/MapboxMapController.swift b/ios/Classes/MapboxMapController.swift index 127d24d0b..2858bfda1 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 ) } From 26652908de4b4d26a75d0a16d023561801324c32 Mon Sep 17 00:00:00 2001 From: Francesco Capaldi Date: Mon, 31 Jan 2022 17:22:14 +0100 Subject: [PATCH 2/2] fix swiftformat --- ios/Classes/MapboxMapController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Classes/MapboxMapController.swift b/ios/Classes/MapboxMapController.swift index 2858bfda1..6de7544e2 100644 --- a/ios/Classes/MapboxMapController.swift +++ b/ios/Classes/MapboxMapController.swift @@ -201,7 +201,7 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma case "map#queryRenderedFeatures": guard let arguments = methodCall.arguments as? [String: Any] else { return } var styleLayerIdentifiers: Set? - if let layerIds = arguments["layerIds"] as? [String]{ + if let layerIds = arguments["layerIds"] as? [String] { styleLayerIdentifiers = Set(layerIds) } var filterExpression: NSPredicate?