diff --git a/mapbox_gl_web/lib/src/feature_manager/feature_manager.dart b/mapbox_gl_web/lib/src/feature_manager/feature_manager.dart index 1ccfdc880..2f850d70a 100644 --- a/mapbox_gl_web/lib/src/feature_manager/feature_manager.dart +++ b/mapbox_gl_web/lib/src/feature_manager/feature_manager.dart @@ -66,8 +66,8 @@ abstract class FeatureManager { void _initClickHandler() { map.on('click', (e) { if (e is Event) { - final features = map.queryRenderedFeatures([e.point, e.point]); - if (features[0].source == sourceId) { + final features = map.queryRenderedFeatures([e.point.x, e.point.y]); + if (features.length > 0 && features[0].source == sourceId) { if (onTap != null) { onTap('${features[0].id}'); }