JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://maps.googleapis.com/maps/api/js?&sensor=false"></script>
<div id="googleMap" style="width:100%;height:100%;"></div>
CSS
body, html {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
JavaScript
var center = new google.maps.LatLng(41.87774145109676, -87.62969970703125);
function initialize() {
var mapProp = {
center: center,
zoom: 10,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
google.maps.event.addListener(map, 'click', function (event) {
new google.maps.InfoWindow({
position: event.latLng,
content: event.latLng.toString()
}).open(map);
});
}
google.maps.event.addDomListener(window, 'load', initialize);