Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70750

Callbacks Not Firing - Google Maps

$
0
0

@bschmuck wrote:

Are Google Maps callbacks broken in Ionic 2? I’m trying to reload markers when a user drags on a map view, but none of my callbacks are firing. I tried adding the following callbacks in ionViewDidLoad, but they are never fired. I also noticed that events.js in the Google Maps library includes a lot of callbacks that throw errors when I try to use them.

I’m using the following import line:
import { GoogleMap, GoogleMapsEvent, GoogleMapsLatLng, CameraPosition } from ‘ionic-native’;

I’ve tried including the callbacks wrapped in both the MAP_READY callback and outside of it.

      this.map.on(GoogleMapsEvent.MAP_READY).subscribe(() => {
          this.map.addEventListener(GoogleMapsEvent.CAMERA_CHANGE).subscribe(() => {
            console.log("Camera has changed!");
          });

          this.map.addEventListener(GoogleMapsEvent.MAP_CLICK).subscribe(() => {
            console.log("Map clicked!");
          });
      });

Posts: 2

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70750

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>