2626import com .google .android .gms .maps .MapView ;
2727import com .google .android .gms .maps .OnMapReadyCallback ;
2828import com .google .android .gms .maps .model .CameraPosition ;
29+ import com .google .android .gms .maps .model .LatLng ;
2930import com .google .android .gms .maps .model .LatLngBounds ;
3031import com .google .android .gms .maps .model .Marker ;
3132import io .flutter .plugin .common .MethodCall ;
@@ -50,6 +51,7 @@ final class GoogleMapController
5051 GoogleMapOptionsSink ,
5152 MethodChannel .MethodCallHandler ,
5253 OnMapReadyCallback ,
54+ GoogleMap .OnMapClickListener ,
5355 PlatformView {
5456
5557 private static final String TAG = "GoogleMapController" ;
@@ -155,6 +157,7 @@ public void onMapReady(GoogleMap googleMap) {
155157 googleMap .setOnCameraMoveListener (this );
156158 googleMap .setOnCameraIdleListener (this );
157159 googleMap .setOnMarkerClickListener (this );
160+ googleMap .setOnMapClickListener (this );
158161 updateMyLocationEnabled ();
159162 markersController .setGoogleMap (googleMap );
160163 updateInitialMarkers ();
@@ -241,6 +244,13 @@ public void onMethodCall(MethodCall call, MethodChannel.Result result) {
241244 }
242245 }
243246
247+ @ Override
248+ public void onMapClick (LatLng latLng ) {
249+ final Map <String , Object > arguments = new HashMap <>(2 );
250+ arguments .put ("position" , Convert .toJson (latLng ));
251+ methodChannel .invokeMethod ("map#onTap" , arguments );
252+ }
253+
244254 @ Override
245255 public void onCameraMoveStarted (int reason ) {
246256 final Map <String , Object > arguments = new HashMap <>(2 );
0 commit comments