ionic-team / ionic-native-google-maps

Google maps plugin for Ionic Native
Other
221 stars 125 forks source link

Plugin suddenly stop working on Android #254

Closed talhaZahidch closed 4 years ago

talhaZahidch commented 4 years ago

Hi,

this plugin suddenly stop working . Just loading the map but other functions are not working e.g this.map.getMyLocation() etc

Please have a look this issue.

wf9a5m75 commented 4 years ago

Please share your project files on github repository.

talhaZahidch commented 4 years ago

Hi here is my loadMap function ...

 loadMap() {
    console.log('map called')

    Environment.setEnv({
      API_KEY_FOR_BROWSER_RELEASE: "My Api here",
      API_KEY_FOR_BROWSER_DEBUG: "My Api here"
    });
    let lat;
    let lng;
    let zoom;
    lat = 31.444630000000004
    lng = 74.28673
      zoom = 15

    let mapOptions: GoogleMapOptions = {
      camera: {
        target: {
          lat: lat,
          lng: lng
        },
        zoom: zoom,
        tilt: 10
      },
      styles: mapStyle
    };

    this.map = GoogleMaps.create(document.getElementById("map"), mapOptions);
console.log(this.map);
    // Wait the MAP_READY before using any methods.
   return this.map.one(GoogleMapsEvent.MAP_READY)
      .then(() => {
        this.map.getMyLocation().then(location => {
          console.log(location);
          this.location = location;
          console.log(location);
          this.map.moveCamera({
            target: location.latLng,
            tilt: 10,
            bearing: 0,
          }).then(suc => {
            console.log("In2");
            //this.startChecking();
          })
        })

      });
  }

the function this.map.getMyLocation() suddenly not executing and this also freezing my app when i comment this function app works fine.

wf9a5m75 commented 4 years ago

Thanks, but I asked "project files", not part of code.

talhaZahidch commented 4 years ago

Its solved i think it was my api issue thanks