0

je besoin d'imprimer traîné lorsque le marqueur est traîné est arrêté dans la carteévénement ionique MARKER_DRAG_END ne fonctionne pas

i ajouté un GoogleMapEvent.MARKERS_END il ne reçoit pas triggerd

 this.map.addMarker({ 
     title: 'Current Location', 
     icon: 'red', 
     animation: 'DROP', 
     position: { 
      lat: this.location.lat, 
      lng: this.location.lng, 
     }, 
     draggable: true, 
     }) 
     .then((marker) => { 
      marker.on(GoogleMapsEvent.MARKER_DRAG_END) 
      .subscribe(() => { 
       console.log('dragged'); 
      }); 
      marker.on(GoogleMapsEvent.MARKER_CLICK) 
      .subscribe(() => { 

       alert('clicked'); 
      }); 
     }); 

Répondre

0

Cela a été résolu lorsque en utilisant

this.map = this.googleMaps.create(this.mapElement, mapOptions); 

pour créer la carte

0
  this.map.on(GoogleMapsEvent.MAP_DRAG).subscribe(
      () => { 
       let pos = this.map.getCameraTarget(); 
       this.marker.setPosition(pos); 
       });