I would like to put a div on a Google map, even when the map is in full screen.
I could already place the div in front of the map when it is not in full screen, but what I need is that the div is shown in both circumstances.
The div that i need to put over google map in fullscreen is: .cont-items-monitor
Here is my html code:
<div class="gx-card-body">
<div class="cont-items-monitor overlay" style="display: none">
<ul>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
</ul>
</div>
<div id="google-map"></div>
</div>
My css code:
.cont-items-monitor {
position: absolute;
top: 60px;
left: 0;
bottom: 30px;
z-index: 1;
background-color: white;
overflow-x: scroll;
padding: 10px 15px 10px 0;
}
I finally could solve it. What I had to do was put the div that I want to be superimposed on the first div that is generated when the Google map is initialized.
My html code is the same, the only thing I did was move it with jquery after all the elements of the website are loaded.
My html code super explained and verified: (Imagine that the following code is inside the basic structure of an html page)
<div class="gx-card-body">
<!-- <div class="cont-fab">
<a href="javascript:void(0)" class="gx-fab-btn gx-btn-primary">
<i class="zmdi zmdi-account-add zmdi-hc-fw zmdi-hc-lg"></i>
</a>
</div> -->
<div class="cont-items-monitor overlay" style="display: none">
<ul>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
<li>Seat León JMG-8823</li>
<li>Seat Ibiza JMG-8823</li>
<li>VW Vento JMG-8823</li>
<li>Nissan Versa JMG-8823</li>
<li>Nissan March JMG-8823</li>
<li>Lincoln Navigator JMG-8823</li>
</ul>
</div>
<div id="google-map"></div>
</div>
My JS code (jQuery):
$(document).ready(function () {
$('.cont-items-monitor').appendTo($('#google-map').find('div')[0]);
});
I hope it serves someone else
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With