I'm having problems getting the map to display in a boostrap 5 modal. It works outside the modal. Inside the modal the default Layers show but not the map itself. My js function
function loadMap(zoom, lat, lng) {
var mapContainer = document.createElement('div');
mapContainer.style.height = '300px';
mapContainer.style.width = '600px';
document.getElementById('mapInsideModal').appendChild(mapContainer);
var defaultLayers = platform.createDefaultLayers();
// Instantiate the map:
var map = new H.Map(mapContainer, defaultLayers.vector.normal.map, {
zoom: zoom, center: { lng: lng, lat: lat,},
});
// add a resize listener to make sure that the map occupies the whole container
window.addEventListener('resize', function () {map.getViewPort().resize();});
// Create the default UI:
var ui = H.ui.UI.createDefault(map, defaultLayers);
}
I created an id <div id="mapInsideModal"></div>
in the Bootstrap modal html where I want the map displayed.