1
The google map is not appearing on my site.
Code:
<div class="row"> //O ERRO OCORRE QUANDO INCLUO A DIV MAP DENTRO DESSA DIV ROW
<div id="map" class="col-6"></div>
<div class="col-6">teste</div>
</div>
<script>
var map;
function initMap() {
map = new google.maps.Map(document.getElementById('map'), {
center: {lat: -8.607014, lng: -35.951444},
zoom: 15
});
}
</script>
<script src="https://maps.googleapis.com/maps/api/js?key=XXXXX&callback=initMap" async defer></script>
If I don’t use the div ROW, the map appears normally, but since I want to divide the screen into two parts, I want to do it the way it is above.
Any hint?
Check div height, you might need to add css height
– N. Dias
Row is the bootstrap id or Row class?
– N. Dias
is already height so much that when I use outside the div, it works well. Row is the class, I will fix.
– Italo Rodrigo
the height is with 100%
– Italo Rodrigo
Try it this way
<div class="col-6"><div id="map"></div></div>
– Guilherme Nascimento