Skip to content
New issue

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

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

Already on GitHub? # to your account

map.setDiv() tries to change value of a readonly property #2809

Closed
3 of 5 tasks
longinius opened this issue Jul 8, 2020 · 3 comments
Closed
3 of 5 tasks

map.setDiv() tries to change value of a readonly property #2809

longinius opened this issue Jul 8, 2020 · 3 comments
Labels

Comments

@longinius
Copy link

I'm submitting a ...

  • question
  • any problem or bug report
  • feature request

If you choose 'problem or bug report', please select OS:

  • Android
  • iOS

cordova information: (run $> cordova plugin list)

com.googlemaps.ios 3.8.0 "Google Maps SDK for iOS"
cordova-androidx-build 1.0.4 "cordova-androidx-build"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-googlemaps 2.8.0-20200701-2202 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.2.0 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 4.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"

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.27.0",
"@ionic-native/google-maps": "^5.5.0",

Current behavior:
If you hide the map with the map.setDiv() method through the Ionic lifecycle methods ionViewWillLeave it works the first time. But the second time it can't hide the map.

To reproduce in the repository you need to go to "Next page" and back two times. The second time the error occurs. In the browser platform the error occurs on the first call.

Expected behavior:
Should hide the map without errors.

Screen capture or video record:

error

Related code, data or error log (please format your code or data):
Repository: https://github.com/longinius/ionic-native-maps-error

The person who share your project files on Github (or other git repository) is in faster lane than other people.
Please share your project files on Github or others(Bitbucket, Gitlabs...etc).
If you don't want to share your project files, please create a demo project, then share it.

Screen captures, and/or native logs(such as Logcat, xcode logs) are appreciate.

Giving much information, you are waiting time is less.
Thank you for your cooperation.
@wf9a5m75
Copy link
Member

wf9a5m75 commented Jul 8, 2020

Ok, I'll check it later

wf9a5m75 added a commit that referenced this issue Jul 10, 2020
@wf9a5m75
Copy link
Member

wf9a5m75 commented Jul 10, 2020

Ok, I fixed problem, however you also need to change your code.

First, please upgrade @ionic-native/google-maps

$ npm uninstall @ionic-native/google-maps
$ npm install @ionic-native/google-maps@5.27.0-beta-20200630

Second, you also need to reinstall the cordova-plugin-googlemaps

$ ionic cordova plugin rm cordova-plugin-googlemaps
$ ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps
$ ionic cordova plugin list

cordova-plugin-googlemaps 2.8.0-20200709-1800 "cordova-plugin-googlemaps"  <-- make sure `2.8.0-20200709-1800`

Third, modify your code
https://github.com/wf9a5m75/ionic-native-maps-error-fixed/


Then the app should work like this

capture

@wf9a5m75 wf9a5m75 added the fixed label Jul 10, 2020
@longinius
Copy link
Author

Many thanks for the quick response and the adaptations to the source code. It now works as desired.

paulnagle pushed a commit to paulnagle/cordova-plugin-googlemaps that referenced this issue Jan 29, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants