Q:

Google Map Data will not appear when i expand the accordion panel

When i expand my navigation panel on my webpage the google map does not appear with anything, it just appears as grey. Only when i open the console does the map appear. What do i need to change to my code for the map to appear with its marker and the location which i have programmed it to go to. When you place the map outside the panel it works perfect. If someone could maybe expand on the code i have written to help that would be great.
HTML Code:
    <button class="accordion">Navigation</button>
        <div class="panel">
            <div id="map" style="width:60%;height:300px"></div>

            </div>

CSS Code:
button.accordion {
            background-color: #eee;
            color: #444;
            cursor: pointer;
            padding: 18px;
            width: 100%;
            border: none;
            text-align: left;
            outline: none;
            font-size: 15px;
            transition: 0.4s;
        }

        button.accordion.active, button.accordion:hover {
            background-color: #ddd;
        }

        div.panel {
            padding: 0 18px;
            display: none;
            background-color: white;
        }

        div.panel.show {
            display: block;
        }

Script Code:
<script>
        var acc = document.getElementsByClassName("accordion");
        var i;

        for (i = 0; i < acc.length; i++) {
            acc[i].onclick = function(){
                this.classList.toggle("active");
                this.nextElementSibling.classList.toggle("show");
            }
        }
    </script>

    <script>
        function myMap() {
            var mapCanvas = document.getElementById("map");
            var myCenter = new google.maps.LatLng(51.508742,-0.120850);
            var mapOptions = {center: myCenter, zoom: 15};
            var map = new google.maps.Map(mapCanvas,mapOptions);
            var marker = new google.maps.Marker({
                position: myCenter,
                icon: "poi.png"
            });
            marker.setMap(map);
        }

        </script>
        <script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyB37us778WYnwNjHftUm3oL2oduV_WOt_E&callback=myMap"></script>

A:

Your accordion show handler needs to just trigger a map resize:
google.maps.event.trigger(map, "resize");

Your code for the first script block becomes:
<script>
    var acc = document.getElementsByClassName("accordion");
    var i;

    for (i = 0; i < acc.length; i++) {
        acc[i].onclick = function(){
            this.classList.toggle("active");
            this.nextElementSibling.classList.toggle("show");
            google.maps.event.trigger(map, "resize");  //added
        }
    }
</script>

Working fiddle: https://jsfiddle.net/vv0xtbrw/
(See line 14);

