Skip to content

Commit 41fea7a

Browse files
authored
Restore map tap/long tap/scroll listeners (#526)
1 parent 0f244cc commit 41fea7a

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

lib/src/map_widget.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,12 @@ class _MapWidgetState extends State<MapWidget> {
238238
}
239239

240240
void onPlatformViewCreated(int id) {
241-
final MapboxMap controller =
242-
MapboxMap(mapboxMapsPlatform: _mapboxMapsPlatform);
241+
final MapboxMap controller = MapboxMap(
242+
mapboxMapsPlatform: _mapboxMapsPlatform,
243+
onMapTapListener: widget.onTapListener,
244+
onMapLongTapListener: widget.onLongTapListener,
245+
onMapScrollListener: widget.onScrollListener,
246+
);
243247
_controller.complete(controller);
244248
if (widget.onMapCreated != null) {
245249
widget.onMapCreated!(controller);

lib/src/mapbox_map.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ part of mapbox_maps_flutter;
44
class MapboxMap extends ChangeNotifier {
55
MapboxMap({
66
required _MapboxMapsPlatform mapboxMapsPlatform,
7+
this.onMapTapListener,
8+
this.onMapLongTapListener,
9+
this.onMapScrollListener,
710
}) : _mapboxMapsPlatform = mapboxMapsPlatform {
811
_proxyBinaryMessenger = _mapboxMapsPlatform.binaryMessenger;
912

0 commit comments

Comments
 (0)