ionic-team / capacitor-google-maps

12 stars 16 forks source link

Map in iOS hidden in some cases #23

Open AE1NS opened 2 months ago

AE1NS commented 2 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