-
Notifications
You must be signed in to change notification settings - Fork 125
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
setDiv() no longer detaches the map (since 4.15.x) #167
Comments
@wf9a5m75 Masashi, if you want me to provide a sample project as well, please let me know, however it is about calling setDiv() on an active map. |
I had the same problem. I modified the
|
BTW the
|
Thanks @ChrisKemmerer, good catch! Not sure why you cannot open a pull request, this option seems to be available for everyone. |
@battika |
Because it does not use setDiv() any longer neither getDiv(), it lets the plugin manage page transitions. Unfortunately it is not always possible but I manually have to manage visibility. For example when I have two maps in the app on two different root pages. In that case, if I want to preserve the states of the maps for faster loading, before I run NavController's setRoot() function I need to run setDiv() to hide the map and setDiv(id) to restore when I come back. This is one possible usage scenario but there are more. Anyway, I update my example to show you the issue. |
Please share the reproduce project files on GitHub repository |
Updated this project: Please test the project with both versions 4.14.0 and 4.20.0. Results are below. |
Thank you for providing. I will check this tomorrow. |
Thank you |
Thank you. I fixed the problem. |
Thank you, Masashi. Can I install this version to test or do I need to wait for the next, post 4.20.0 release? |
You can install this version.
|
Thank you :) |
Donation sent |
Thank you! |
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
)If you use
@ionic-native/google-maps
, please tell the package.json (only@ionic-native/core
and@ionic-native/google-maps
are fine mostly)Current behavior:
Starting with ionic native version 4.15, calling setDiv() or setDiv(null) will not detach the map from the currently attached HTML element but throws an error:
According to the documentation omitting the argument should detach the map.
It is caused by the changes introduced in 4.15 to the setDiv() method.
Old, working setDiv() method:
ionic-native-google-maps/src/@ionic-native/plugins/google-maps/index.ts
Lines 2402 to 2413 in c28d95e
New, broken setDiv() method:
ionic-native-google-maps/src/@ionic-native/plugins/google-maps/index.ts
Lines 2734 to 2770 in edf5db6
In the new code when one attempts to call setDiv() with no parameters, it first checks whether string was passed, check fails, it then goes to the else branch where it checks whether HTML element is passed, check fails, it attempts to throw an exception:
ionic-native-google-maps/src/@ionic-native/plugins/google-maps/index.ts
Line 2767 in edf5db6
And actually the error is caused by the exception handler because domNode has not tagName property as it is null.
So, a check for empty setDiv() value is missing for detaching the webview. I tried passing empty string but it did not help either.
The text was updated successfully, but these errors were encountered: