JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<div id="mycontainer" style="width: 500px; height:400px">
<div id="map-canvas"></div>
</div>
</body>
CSS
html, body, #map-canvas {
height: 99%;
margin: 60px;
padding: 0px
}
JavaScript
function initialize() {
var mapOptions = {
zoom: 8,
center: new google.maps.LatLng(-34.397, 150.644)
};
var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);
}
function loadScript() {
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&' +
'callback=initialize';
document.body.appendChild(script);
}
window.onload = loadScript;