Event GoogleMapsEvent.MARKER_DRAG_END does not work IONIC 2

0

I am using native Google Maps on Ionic 2, the map appears and a bookmark is added, that works well. But events related to the marker do not work, in this test I am using the event MARKER_DRAG_END

Google Maps Native

export class Mapa {

  constructor(public navCtrl: NavController, public navParams: NavParams,
    private googleMaps:GoogleMaps) {}


  map;

  ionViewDidLoad() {
    this.loadMap();

  }
  loadMap(){
    let mapOptions  = {
      camera: {
        target: {
          lat: 43.0741904,
          lng: -89.3809802
        },
        zoom: 18,
        tilt: 30
      }
    };
    this.map = this.googleMaps.create('map_canvas',mapOptions);
    this.map.one(GoogleMapsEvent.MAP_READY).then(()=>{
      this.map.addMarker({
        title:'Marker',
        draggable:true,
        position: {
          lat: 43.0741904,
          lng: -89.3809802
        }
      });
    }).then(marker => {
            marker.on(GoogleMapsEvent.MARKER_DRAG_END)
              .subscribe(() => {
                alert('END DRAG');
              });
          });;

  }
    
asked by crrlos 29.01.2018 в 21:04
source

0 answers