@@ -45,7 +45,7 @@ import {
45
45
Style ,
46
46
TileOverlayOptions ,
47
47
} from '.' ;
48
- import { bearingProperty , JointType , latProperty , lngProperty , MapType , MapViewBase , tiltProperty , zoomProperty } from './common' ;
48
+ import { bearingProperty , preventDefaultMarkerTapBehaviorProperty , JointType , latProperty , lngProperty , MapType , MapViewBase , tiltProperty , zoomProperty } from './common' ;
49
49
50
50
import { intoNativeMarkerOptions , intoNativeCircleOptions , intoNativePolygonOptions , intoNativeGroundOverlayOptions , intoNativePolylineOptions , hueFromColor , intoNativeJointType , toJointType , intoNativeTileOverlayOptions , deserialize , serialize } from './utils' ;
51
51
@@ -185,13 +185,6 @@ export class MapView extends MapViewBase {
185
185
marker : Marker . fromNative ( marker ) ,
186
186
} ) ;
187
187
break ;
188
- case 'click' :
189
- ref ?. get ?.( ) . notify ( < MarkerTapEvent > {
190
- eventName : MapView . markerTapEvent ,
191
- object : ref ?. get ?.( ) ,
192
- marker : Marker . fromNative ( marker ) ,
193
- } ) ;
194
- break ;
195
188
}
196
189
} ,
197
190
onMapClickEvent ( latLng : com . google . android . gms . maps . model . LatLng , isLongClick : boolean ) {
@@ -369,6 +362,7 @@ export class MapView extends MapViewBase {
369
362
tilt : owner . tilt ,
370
363
zoom : owner . zoom ,
371
364
} ) ;
365
+ owner . _setMapClickListener ( map , owner . preventDefaultMarkerTapBehavior ) ;
372
366
}
373
367
374
368
ref . get ?.( ) . notify ?.( {
@@ -504,6 +498,12 @@ export class MapView extends MapViewBase {
504
498
}
505
499
}
506
500
501
+ [ preventDefaultMarkerTapBehaviorProperty . setNative ] ( value ) {
502
+ if ( this . _map ) {
503
+ this . _setMapClickListener ( this . _map , value ) ;
504
+ }
505
+ }
506
+
507
507
_updateCamera (
508
508
map ,
509
509
owner : {
@@ -555,6 +555,22 @@ export class MapView extends MapViewBase {
555
555
}
556
556
}
557
557
}
558
+
559
+ _setMapClickListener ( map , preventDefaultMarkerTapBehavior ) {
560
+ map . setOnMarkerClickListener (
561
+ new com . google . android . gms . maps . GoogleMap . OnMarkerClickListener ( {
562
+ onMarkerClick : ( marker ) => {
563
+ this . notify ( < MarkerTapEvent > {
564
+ eventName : MapView . markerTapEvent ,
565
+ object : this ,
566
+ marker : Marker . fromNative ( marker ) ,
567
+ } ) ;
568
+
569
+ return preventDefaultMarkerTapBehavior ;
570
+ } ,
571
+ } )
572
+ ) ;
573
+ }
558
574
}
559
575
560
576
export class IndoorLevel implements IIndoorLevel {
0 commit comments