Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix included] GoogleMaps.java getLicenseInfo() not working before initializing the map #386

Closed
jpcancienne opened this issue Feb 4, 2015 · 4 comments
Milestone

Comments

@jpcancienne
Copy link

GoogleMaps.java
line 218:
if (("getMap".equals(action) == false && "isAvailable".equals(action) == false ) && [...]){ ... }

The above causes the plugin to reject the getLicenseInfo action if the map plugin has not been initialized. This action does not require initializing the map in order to display the License Information.

The fix is quite simple:
line 218:
if (("getMap".equals(action) == false && "isAvailable".equals(action) == false && "getLicenseInfo".equals(action) == false) && [...]){...}

I've tested this on my application on my Android device (Verizon Motorola Droid Mini) and it works. This problem does not seem to exist on the ios part of this plugin.

The application I am developing doesn't load a googlemap as the first screen. I also have the licensing info somewhere else in the application that doesn't require creating a google map screen initially. Please put this fix in for others who need this functionality in order to satisfy the terms of use.

You may need to review other commands that could have this same issue.

Thank you!

wf9a5m75 added a commit that referenced this issue Feb 4, 2015
@wf9a5m75
Copy link
Member

wf9a5m75 commented Feb 4, 2015

Thank you @jpcancienne
I patched it on the test branch, and it will include in the next release.

@wf9a5m75 wf9a5m75 closed this as completed Feb 4, 2015
@wf9a5m75 wf9a5m75 added this to the v1.2.5 milestone Feb 4, 2015
@jgiovanni
Copy link

Can you explain how you used this function, because I'm using v1.2.5 and when i try to call this function from plugin.google.maps.Map.getLicenseInfo() it is undefined?

I only use the map in one of my tabs so it is not always initialized either.

@jpcancienne
Copy link
Author

via:
https://github.com/wf9a5m75/phonegap-googlemaps-plugin/wiki/Map.getLicenseInfo()

plugin.google.maps.Map.getLicenseInfo(function(txt1,txt2){
    var textToUse = txt1 || txt2;
    //show the information
});

Remember that this is a native function, so you need to use a callback javascript function.

@jgiovanni
Copy link

worked like a charm, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants