ionic-team / capacitor-google-maps

16 stars 24 forks source link

Map in iOS hidden in some cases #23

Open AE1NS opened 5 months ago

AE1NS commented 5 months ago

Bug Report

Plugin(s)

@capacitor/google-maps

Description

Some time ago I refactored the updateRender method. Afterwards some more changes were made in the getTargetContainer method in iOS. This makes trouble, when the map size changes.

let isWidthEqual = width == self.config.width
let isHeightEqual = actualHeight == self.config.height

This result in the following error: The map gets loaded on page enter. Now, in our case, we change the map size with dragging up a bottom sheet, so the map size changes. When you now leave the page forward and come back (we use ionic for this), the onDisplay method will be triggered, but will not find the map container, as still checks the inital values coming from self.config. The map will now not be shown again and is hidden. There is als another issue with the variable actualHeight, where the value gets ceiled in some cases in our app, which also will not trigger to show the map again, as the target container is not found, because the height differs by 1px. And we have issues with some iOS devices that are crashing, because the gmapview is null because the target container couldnt be found (1px differ issue).

Platform(s)

iOS

wahibimoh commented 1 month ago

I am noticing a similar issue, when rotating the screen in iOS, the map is blank. I tried the fix in pull request #24 but the issue is still there.

Is there any way we can make the map behave like in Android?