I am experiencing difficulties with implementing a responsive Google map on my webpage. To achieve a mobile-first and responsive design, I am utilizing Google Map API v3 along with Bootstrap 3 CSS. My objective is to obtain user addresses either through the automatic filling of the address form using Google Places API or by extracting coordinates from the map and GPS. I have set up radio buttons to allow users to choose between these two options. The default selection is the address form. However, when the 'Use Map' option is selected, the form should be hidden, and the Google map should appear in its place. Unfortunately, this functionality isn't working as expected. Upon inspection using Mozilla's Inspect Element, I confirmed that the map is loaded in the background.
The issue: The map refuses to display within the specified div, identified as div id="map-canvas." Everything else seems to be functioning correctly. I did manage to display a static Google map image in the same div by appending the image file using the .innerHTML() function.
The solution I seek is to successfully showcase the map inside the map-canvas div while ensuring it remains responsive.
Below is the code snippet (consisting of HTML, JS, and CSS):