Google Maps doesn't show in a nav-tab. It doesn't show the place, but when I click on the map; it's correct in google.
HTML:
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade" id="locatie"><?php if ($object->hasLocation): ?>
<div>
<h2>Kaart</h2>
<div id="google-map"></div>
<h2>Street View</h2>
<div id="google-streetview"></div>
</div>
<?php endif; ?></div>
</div>
JS
(function($, exports) {
'use strict';
var GoogleMap = exports.GoogleMap = function(options) {
this.map = null;
this.markers = [];
this.bounds = null;
this.info = null;
this.options = $.extend({
container: '#google-map',
mapContainer: null,
map: {}
}, options || {});
this.$container = null;
};
CSS
.single-post-tst {
.entry-content {
width: 100%;
margin: 2% 0 10%;
display: inline-block;
p {
font-size: 16px;
}
}
.container-content-single {
ul, ol {
margin: 0 0 1.5em 0;
}
.nav-tabs {
border: 1px solid #ddd;
li {
margin-bottom: 0;
border-right: 1px solid #ddd;
}
li:last-child {
border-right: none;
}
li a {
border-radius: 0;
line-height: 2em;
margin-right: 0;
}
li a:hover {
background-color: #F29902;
color: #fff;
}
li.active > a {
padding-bottom: 12px;
}
a.nav-link.active {
background-color: #F29902;
color: #fff;
}
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:focus, .nav-tabs>li.active>a:hover {
border: none;
background-color: #F29902;
color: #fff;
}
}
}
#google-map,
#google-streetview {width:100%; height:500px;}
I think the problem is with this line in JS:
container: '#google-map',
When I put the map out off the tab, it works correct. But I can't find any solution to show the map correct in the tab.
It shows now but not full width, I add this to CSS:
.tab-content.tab-pane,
.tab-pane {
/* display: none; */
display: block;
visibility: hidden;
position: absolute;
}
.tab-content.active,
.tab-content .tab-pane.active,
.tab-pane.active {
/* display: block; */
visibility: visible;
position: static;
}
When I say width: 100%; it doesn't make full width