Skip to content

Commit

Permalink
Swift CGRect constructor for QueryRenderedFeaturesInRect (#1208)
Browse files Browse the repository at this point in the history
* fix swift CGRect constructor for query in rect

* make formating changes

---------

Co-authored-by: Aaron S Kennedy <36516690+aaronsamkennedy@users.noreply.github.com>
  • Loading branch information
aardrop and aardrop committed Jun 1, 2023
1 parent fa824ce commit ddad656
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ios/Classes/MapboxMapController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -227,12 +227,13 @@ class MapboxMapController: NSObject, FlutterPlatformView, MGLMapViewDelegate, Ma
)
}
if let top = arguments["top"] as? Double,
let bottom = arguments["bottom"] as? Double,
let left = arguments["left"] as? Double,
let right = arguments["right"] as? Double
let width = arguments["width"] as? Double,
let height = arguments["height"] as? Double
{
dump(arguments)
features = mapView.visibleFeatures(
in: CGRect(x: left, y: top, width: right, height: bottom),
in: CGRect(x: left, y: top, width: width, height: height),
styleLayerIdentifiers: styleLayerIdentifiers,
predicate: filterExpression
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,13 @@ class MethodChannelMapboxGl extends MapboxGlPlatform {
<String, Object?>{
'left': rect.left,
'top': rect.top,
//specific arguments needed for android rect function
'right': rect.right,
'bottom': rect.bottom,
//specific arguments needed for iOS rect function
'width': rect.width,
'height': rect.height,
//arguments for mapbox
'layerIds': layerIds,
'filter': filter,
},
Expand Down

0 comments on commit ddad656

Please sign in to comment.