Here the thing : I want to create a view with my map all over my tab like in this codepen.
My problem is that my little div containing my p is sliding underneath my map… z-index isn’t my friend here.
Here’s my body
<body ng-app="starter" ng-controller="MapCtrl">
<ion-header-bar class="bar-stable">
<h1 class="title">Map</h1>
</ion-header-bar>
<ion-content scroll="false">
<map on-create="mapCreated(map)"></map>
<ion-scroll direction="y" class="hotel-view" on-scroll="onScrollHotelView()">
<p>Just drag-up this text to make it move ! I'm trying to allow the scroll over the map ! Anyway if you have an idea ..</p>
<p>I have also an ugly little space between my text and the footer !</p>
</ion-scroll>
</ion-content>
Any idea to put it over the map in order to display details on google maps markers selected ?
So you want that when you scroll your p, the map gets hidden in the behind?
I can’t look for a solution, but I can give you a hint: The problem here looks like you have a container with 2 other containers: The map and the scroll-view, each one has it’s size and one is after the other. When you try to scroll, the scroll-view content gets hidden (overflow:hidden) when it goes out of the scroll-view container.
From here you can take a very dirty solution: put overflow: visible in the scroll-view container, but it’s really really dirty, and might put more bugs into your app.
What I would suggest is something like using absolute positioning on the map container to get it out from the size flow, let the scroll-view container take the whole space and put a div transparent spacer inside to make the text start right after the map. When the user scrolls up, your p should get on the map.
You could add your map directly as a child under your body-tag and the ion-content and anything in the ioncontent scrolls over your map.
I used this for an app.
I had some other map functionalities like set marker by touch/click and so on.
On this views i had to remove ion-content from the dom with ng-if.
After that you can drag your map, click on markers and so on.
@voliva
I can see that my blocks are asides now, thanks. However, I tried your dirty solution Voliva, even if you informed me how dirty it was ! but It doesn’t suit me.
@bengtler
If i’m right, you suggest me to do something like this ?
<body ng-app="starter" ng-controller="MapCtrl">
// My header
<ion-header-bar class="bar-stable">
<h1 class="title">Map</h1>
</ion-header-bar>
// My map
<map on-create="mapCreated(map)"></map>
// My content over available to be scrolled over content
<ion-content scroll="false">
<ion-scroll direction="y" class="hotel-view" on-scroll="onScrollHotelView()">
<p>Informations on my Google maps markers selected.</p>
</ion-scroll>
</ion-content>
Hi,
Again trying to put this to work : I can’t put it in a good way… Moreover, my boss wanted me to use the Angular-google-maps so I’m trying to do this with it !
Aynone could help me with a plnkr or codepen ?
Yeah but if you content is “over” your map… it scrolls over your map right?^^
Or do you want to do something with your map annnnd content should scroll over it?
Ah this is very difficult with a map. because for that, you need to put the map back in the ion-content.
But when you are on the map, there are own “touch”-handlings. Scrolling = moving the map and so on.
The all you need is using $ionicScrollDelegate
and disable scroll when ng-mousedown over google map
and enable scroll when ng-mousedown over some other