Ionic Sidemonu and Native Google Maps

I am developing an Ionic application in which I use the side menu. When navigating to a template that contains only a div for rendering Google Maps (native using cordova-plugin-maps). A side menu is overlaid on the map. It is strange that I can interact with the card through the side menu.

It works great when using Javascript Google Maps.

Here is a screenshot of what it looks like:

enter image description here

The same thing appears on an Android device.

Help in resolving is welcome!

EDIT: I forgot to mention that I go from the normal page (and not the side menu), hence the back button. Hope this makes it more specific.

+5
source share
7 answers

I found it FINALLY !!

When switching to a map, you need to hide <ion-side-menu> . For example (what I did):

 document.getElementById("side-menu").style.visibility = 'hidden'; 

When moving from the card, in the callback of $ stateChangeSuccess, set it back to "visible"

Hope this helps!

0
source

This works for me: 1. Put ng-hide in

 <ion-side-menu side="left" data-ng-hide="hideLeft"> 
  1. observe the $ ionicSideMenuDelegate in the menu controller.

// hack sidemenu overlay $scope.$watch(function () { return $ionicSideMenuDelegate.getOpenRatio(); }, function (newValue, oldValue) { if (newValue == 0) { $scope.hideLeft = true; } else { $scope.hideLeft = false; } });

+5
source

scss ionic.app.scss or www / csss /

 body.menu-open .menu.menu-left { visibility: visible; } .menu.menu-left { visibility: hidden; } 
+2
source

you can install it like this:

Map

<ion-item nav-clear menu-close ng-click="fuction to call the map page">

or

 <ion-item nav-clear menu-close ui-sref="url to page"> 

* when you click β€œMap” in the menu, the side menu closes and the page is displayed.

+1
source

Personally, I found an elegant solution (right menu):

 .menu.menu-right { transform: translate3d(100%, 0, 0) !important; -webkit-transition: transform 200ms ease; transition: transform 200ms ease; } .menu-open { .menu.menu-right { transform: translate3d(0, 0, 0) !important; } } 
+1
source

You need to change the default type to ion-menu tag

 <ion-menu type="reveal" [content]="content"> ... ... ... </ion-menu> 
+1
source

Because the plugin map of cordova-google-maps follows the position of mapDiv.

The ionic structure creates a side menu under the card splitter.

You need to create a side menu above the map splitter.

Check out here. https://forum.ionicframework.com/t/using-google-maps-cordova-plugin/4456/49

0
source

Source: https://habr.com/ru/post/1245355/


All Articles