How to use the @ionic-native/google-maps.GoogleMapsEvent.MAP_CLICK function in @ionic-native/google-maps

To help you get started, we’ve selected a few @ionic-native/google-maps examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / Ionic-MFP-App / IonicMobileApp / src / pages / report-new / report-new.ts View on Github external
this.map.one(GoogleMapsEvent.MAP_READY).then(() => {
      console.log('--> ReportNewPage: Map is Ready To Use');
      this.mapReady = true;
      // https://stackoverflow.com/questions/4537164/google-maps-v3-set-single-marker-point-on-map-click
      this.map.on(GoogleMapsEvent.MAP_CLICK).subscribe( event => {
        this.location = event[0];
        console.log('--> ReportNewPage: User clicked location = ' + event[0]);
        this.map.clear();
        this.map.addMarker({
          title: 'Selected location',
          position: event[0]
        }).then((marker: Marker) => {
          this.autoFillAddress();
          marker.showInfoWindow();
        });
      });
    });
  }
github zyra / ionic-native-playground / src / components / google-map / google-map.ts View on Github external
.then(() => {
        this.map = this.googleMaps.create(this.mapContainer, this.options);

        this.map.one(GoogleMapsEvent.MAP_READY)
          .then(() => {
            console.log('Map ready fired', this.map);

            this.mapReady.emit(this.map);
            this.isInit = true;
          });

        this.map.on(GoogleMapsEvent.MAP_CLICK)
          .subscribe(data => this.mapClick.emit(data));

      });