Material: Pan gesture not working for navigation drawer when used with Google Maps or Mapkit

Created on 24 Jan 2018  路  5Comments  路  Source: CosmicMind/Material

Hi,
I have been facing this issue in pan gesture of navigation drawer. So when i use it with any of the maps i.e Google maps or MapKit the pan gesture does not open the side menu. One thing i noticed is that Google map's settings has a property called "consumesGesturesInView" and when i set it to false the pan gesture opens the side menu but also drag the map.

So what i want is pan gesture should open the side menu and does not drag the map.

Can you please look into this. I really appreciate the help.

So i am attaching the zip of the project where i use MapKit.

SideMenuTest.zip

good first issue help wanted investigate material question

Most helpful comment

Hi @ravigupta049,

I have encountered this issue before. The map will always win the gesture if the map's bounds is equal to the frame of the rootViewController.view If you want that kind of functionality you need to think of a custom solution. Here is a potential way to solve the problem:

  1. Implement a custom overlay that sets isUserInteractionEnabled = false (above the map on the X most edge of the rootViewController.view) give it like a 20 - 30 width and then implement a swipeGesture whose callback triggers the navigationDrawerController.openLeftView()

The underlying issue isn't problem with the drawer - it's mainly about conceiving a custom solution for that kind of UI.

All 5 comments

Hi @ravigupta049,

I have encountered this issue before. The map will always win the gesture if the map's bounds is equal to the frame of the rootViewController.view If you want that kind of functionality you need to think of a custom solution. Here is a potential way to solve the problem:

  1. Implement a custom overlay that sets isUserInteractionEnabled = false (above the map on the X most edge of the rootViewController.view) give it like a 20 - 30 width and then implement a swipeGesture whose callback triggers the navigationDrawerController.openLeftView()

The underlying issue isn't problem with the drawer - it's mainly about conceiving a custom solution for that kind of UI.

@ravigupta049 going to close this ticket for now :) feel free to message me directly on Gitter if you want to follow up.

My handle is @adamdahan

@adamdahan Thank you for your time and providing with a alternate for this problem.
So i tried adding pan gesture on map so that is does not move but still no luck.

Once again thanx :)

@ravigupta049 May you share your implementation of @adamdahan's recommendation?

Hi @danieldahan
So i haven't tried the Adam's solution yet but if i will try i will share it with you.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

goribchat picture goribchat  路  5Comments

chashmeetsingh picture chashmeetsingh  路  5Comments

shshalom picture shshalom  路  4Comments

Dengekiko picture Dengekiko  路  3Comments

aleufms picture aleufms  路  6Comments