ionic-team / ionic-native-google-maps

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

(Ionic 4.0.0, ionic-native 5) GoogleMapsEvent.MAP_READY not fired #162

Closed francovp closed 5 years ago

francovp commented 5 years ago

I'm submitting a ... (check one with "x")

If you choose 'problem or bug report', please select OS: (check one with "x")

cordova information: (run $> cordova plugin list)

cordova-plugin-device 2.0.2 "Device"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-googlemaps 2.5.0-beta-20190102-1842 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 3.0.0 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova.plugins.diagnostic 4.0.10 "Diagnostic"
phonegap-plugin-barcodescanner 8.0.1 "BarcodeScanner"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

"@ionic-native/core": "^5.0.0", "@ionic-native/google-maps": "^5.0.0-beta.26",

Current behavior:

The GoogleMapsEvent.MAP_READY event never gets fired.

Expected behavior:

Related code, data or error log (please format your code or data):

this.map = await GoogleMaps.create('map_canvas_details', mapOptions);

        console.log("Creating map");

      // Wait the MAP_READY before using any methods.

        this.map.one(GoogleMapsEvent.MAP_READY).then( async () => {
          console.log("Map ready");
          resolve();
        }).catch((error) => {
          console.error(error);
          reject(error);
        });

The "Map Ready" log never get printed and the promise never gets resolved

wf9a5m75 commented 5 years ago

Please try 2.5.0-beta-20190123-2007 at least.

wf9a5m75 commented 5 years ago
this.map = await GoogleMaps.create('map_canvas_details', mapOptions);

GoogleMaps.create() returns as synchronize.

francovp commented 5 years ago

I update the plugin to cordova-plugin-googlemaps 2.5.0-beta-20190124-1620 and remove the await from this.map = await GoogleMaps.create('map_canvas_details', mapOptions); but it doesn't make any difference :/

wf9a5m75 commented 5 years ago

Please share your project files on GitHub repository

francovp commented 5 years ago

The whole project? Or just the component? I can't post the whole project because is private and NDA.

I will try to reproduce the issue in a fresh project and will comment

wf9a5m75 commented 5 years ago

Github provides free secret repository for everyone.

wf9a5m75 commented 5 years ago

ping

wf9a5m75 commented 5 years ago

Since you don't share any program, I can not confirm the problem, but probably the problem is fix.

francovp commented 5 years ago

Sorry for the late response. I will try the fix you make and will comment. Question: for Ionic 4 I need to use the master branch now? or the v5 branch?

If it doesn't work I will share the project with you

wf9a5m75 commented 5 years ago

v5 branch

francovp commented 5 years ago

I'm getting Cannot find module '@ionic-native/google-maps/ngx'when using the v5 branch directly

I reference the branch like this in package.json "@ionic-native/google-maps": "git+https://github.com/ionic-team/ionic-native-google-maps.git#v5"

And have the bb604e0cad658872adb1ab060b9489a9b8ec7e98 commit installed

wf9a5m75 commented 5 years ago

https://github.com/mapsplugin/ionic-googlemaps-quickdemo-v4/blob/master/src/app/home/home.page.ts

francovp commented 5 years ago

So, that demo says that I have to import from @ionic-native/google-maps but the slide tutorial says that I need to import from @ionic-native/google-maps/ngx Ok

wf9a5m75 commented 5 years ago

@ionic-native/google-maps should be enough.

francovp commented 5 years ago

I'm getting ERROR in src/app/home/home.module.ts(5,28): error TS2307: Cannot find module '@ionic-native/google-maps'. src/app/home/home.page.ts(15,8): error TS2307: Cannot find module '@ionic-native/google-maps'.

now :/

I add you to my private project, can you check it please?

wf9a5m75 commented 5 years ago

For private repo support, I appreciate if you donate $5 to the project for maps plugin activity.

wf9a5m75 commented 5 years ago

Thank you for your donation. I investigated your code, and there were many problems, not this plugin's problem. I committed to your repo.

browser

android

ios

francovp commented 5 years ago

Hi, thank you very much for your help :) I really appreciate it because this was stopping my progress.

I pull your commits but I receiving the same errors that I mention here when I run ionic cordova build ios with 'ionic-native/google-maps": "git+https://github.com/ionic-team/ionic-native-google-maps.git#v5" in package.json.

I run npm install and nothing changes :/ So I can't build the project with that version.

I didn't push that change of the plugin's version to the github repo, the version of the repo was 5.0.0-beta.26. Maybe I need to use just that?

Any idea what it can be?

wf9a5m75 commented 5 years ago

I did just npm install

wf9a5m75 commented 5 years ago

Try this steps.

https://github.com/ionic-team/ionic-native-google-maps/issues/167#issuecomment-462157627

francovp commented 5 years ago

Works with version 5.0.0-beta.26. I don't now why the remote repo reference to the v5 branch doesn't work, but I will try that

wf9a5m75 commented 5 years ago

ping

wf9a5m75 commented 5 years ago

Please reinstall

francovp commented 5 years ago

Works pretty well with those versions :) Now is rendering the overlay correctly in my side. So my issue is solved :D

Thank you very much!