I’m not sure how to capture the page changing event, but hiding the map is “map.setVisible(false)”
The most problem is Ionic uses the CSS transition.
W3C defines the “transitionend” event, but they don’t define “transitionstart” event.
So I can not catch any event when page transition occurs (as far as I know).
No worries, I already have it working using an event listener without problems, I was just wondering if there was a better way of doing it like at the onLoad/onExit event of the UI router.
In any case, I’m posting my way of doing it here so it might come handy for other users having this issue as well:
//Remove Map on Page Change
$scope.$on('$stateChangeStart',
function () {
//Code to call before state change is complete.
...
//Remove Map
map.remove();
})
Is there a way to use this plugin with the side menu template? Because I’m testing but the map is showing behind the side menu even when the side menu is not toggled.
Te ocurre el mismo problema sin el mapa? Tiene bastante pinta de que sea un problema de Absolutes.
El funcionamiento normal del side menu es el de trasladar todo el contenido hacia un lado para mostrar el menú. El menú nunca se mueve de sitio, y a mi me parece que es lo que te está ocurriendo, el menú está cerrado, pero se muestra sobre el content.
Prueba a eliminar el mapa y haz la prueba de ver si te sigue ocurriendo. En cualquier caso, pon z-index: 0 a la class .menu en ionic.css y z-index superior a ion-content.
Es problema del mapa que crea el plugin, poniendo un mapa desde la api de google maps con js no hay problema y no he tenido este problema en ninguna vista más.
Si tienes un android 4.4 puedes inspeccionar elemento desde Chrome, y ahí compruebas si el elemento que crea el plugin es un aboslute y su z-index. Me extrañaría mucho que fuera otra cosa.