Skip to content

Commit

Permalink
Fix type issues in query rendered features in rect (#862)
Browse files Browse the repository at this point in the history
* removed unnecessary cast to int

* added documentation
  • Loading branch information
felix-ht authored Jan 17, 2022
1 parent 4fd54c6 commit 689933a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/src/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -864,11 +864,13 @@ class MapboxMapController extends ChangeNotifier {
notifyListeners();
}

/// Query rendered features at a point in screen cooridnates
Future<List> queryRenderedFeatures(
Point<double> point, List<String> layerIds, List<Object>? filter) async {
return _mapboxGlPlatform.queryRenderedFeatures(point, layerIds, filter);
}

/// Query rendered features in a Rect in screen coordinates
Future<List> queryRenderedFeaturesInRect(
Rect rect, List<String> layerIds, String? filter) async {
return _mapboxGlPlatform.queryRenderedFeaturesInRect(
Expand Down
2 changes: 1 addition & 1 deletion mapbox_gl_web/lib/src/mapbox_map_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ class MapboxMapController extends MapboxGlPlatform
], options)
.map((feature) => {
'type': 'Feature',
'id': feature.id as int?,
'id': feature.id,
'geometry': {
'type': feature.geometry.type,
'coordinates': feature.geometry.coordinates,
Expand Down

0 comments on commit 689933a

Please sign in to comment.