-
Notifications
You must be signed in to change notification settings - Fork 25
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
Error while initializing map on IOS device #53
Comments
- Updated IOS Map.buildMarker to also support base64 data urls - Bumped version to 6.0.3
Experiencing the same issue on iPhone 13 Pro. GMapView is not being properly initialized and causing our app to crash if any setting like setMapType is called. |
On our test device, the issue went away when we set a fixed height (we had a variable height of 35vh) for the maps element. We will monitor our crash logs to see if that's true for all iPhone models that have been affected. |
@yiannis-spyridakis Are you getting this error when your iOS app is launched in the background? You can simulate an app launching in the background by editing your Scheme like so: I believe the error is caused because the |
I also encountered the same problem on iOS 16.7.6 on iPhone X, and based on this comment I changed my code to ensure that the capacitor-google-maps element always has an explicit width and height in pixels. That fixed it for me too. |
I can also confirm the issue goes away when explicit map width and height is used. Furthermore without explicit dimensions the fix I suggested leads to unstable map, especially on IOS. We still needed the map to be responsive to our layout so we are kept the map element width and height to 100% and are hardcoding dimensions explicitly in code before initializing the map plugin:
|
Bug Report
I am getting a crash while running ann app that uses @capacitor/google-maps on a test device (iPhone 8). The app crashes in
Map.enableCurrentLocation
and the error is:Which is caused by
self.mapViewController.GMapView
not being initialized.Plugin(s)
@capacitor/google-maps
Capacitor Version
Platform(s)
IOS
Current Behavior
Crash on (I am guessing) certain device/ app setup combinations when loading map
Expected Behavior
Fix
Code Reproduction
I have debugged the plugin and the issue originates in Map.getTargetContainer
In the function above isHeightEqual is always false. In the case of the 'correct' view it is off by one (367.0 <> 366.0) which, I am guessing has to do with the specific dimensions of my device and some rounding error.
This works for me:
The text was updated successfully, but these errors were encountered: