mapsplugin / cordova-plugin-googlemaps

Google Maps plugin for Cordova
Apache License 2.0
1.66k stars 913 forks source link

iPad Orientation issue with Google Maps plugin MyPluginLayer #2908

Open ksp143 opened 1 year ago

ksp143 commented 1 year ago

I am facing Touch issue in my Angular Ionic Cordova iOS application, when app launches in landscape mode and changes to portrait after Splash screen is loaded and navigates to next screen.

After changing to Portrait mode, the addition portion at bottom of the screen is not touchable after integrating Google Maps plugin.

Adding few more additional steps:

Below code is causing the issue for me when auto rotate is enabled.

Screenshot 2022-06-14 at 7 39 33 PM
- (id)initWithWebView:(UIView *)webView {
    self.executeQueue = [NSOperationQueue new];
    self._lockObject = [[NSObject alloc] init];
    self.CACHE_FIND_DOM = [NSMutableDictionary dictionary];

    self = [super initWithFrame:[webView frame]];
    self.webView = webView;
    self.isSuspended = false;
    self.opaque = NO;
    [self.webView removeFromSuperview];
    // prevent webView from bouncing
    if ([self.webView respondsToSelector:@selector(scrollView)]) {
        ((UIScrollView*)[self.webView scrollView]).bounces = NO;
    } else {
        for (id subview in [self.webView subviews]) {
            if ([[subview class] isSubclassOfClass:[UIScrollView class]]) {
                ((UIScrollView*)subview).bounces = NO;
            }
        }
    }

    self.pluginScrollView = [[MyPluginScrollView alloc] initWithFrame:[self.webView frame]];

    self.pluginScrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;

    self.pluginScrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    UIView *uiview = self.webView;
    uiview.scrollView.delegate = self;
    [self.pluginScrollView setContentSize:self.webView.scrollView.frame.size ];

    [self addSubview:self.pluginScrollView];

    [self addSubview:self.webView];

//    dispatch_queue_t q_background = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0);
//
//    dispatch_async(q_background, ^{
//      [self startRedrawTimer];
//    });

    return self;
}