JSFiddle - React, Tailwind, and code Playground

by Lawrence Ross

HTML

<body>
  <div id="map-canvas" />
</body>
<script async defer src="https://maps.googleapis.com/maps/api/js?callback=initialize">


</script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js'></script>

CSS

html, body, #map-canvas {
	margin: 0;
	padding: 0;
	height: 100%;
	max-width: none;
}
#map-canvas img {
	max-width: none !important;
}
.gm-style-iw {
	width: 350px !important;
	top: 15px !important;
	left: 0px !important;
	background-color: #fff;
	box-shadow: 0 1px 6px rgba(178, 178, 178, 0.6);
	border: 1px solid rgba(72, 181, 233, 0.6);
	border-radius: 2px 2px 10px 10px;
}
#iw-container {
	margin-bottom: 10px;
}
#iw-container .iw-title {
	font-family: 'Open Sans Condensed', sans-serif;
	font-size: 22px;
	font-weight: 400;
	padding: 10px;
	background-color: #48b5e9;
	color: white;
	margin: 0;
	border-radius: 2px 2px 0 0;
}
#iw-container .iw-content {
	font-size: 13px;
	line-height: 18px;
	font-weight: 400;
	margin-right: 1px;
	padding: 15px 5px 20px 15px;
	max-height: 140px;
	overflow-y: auto;
	overflow-x: hidden;
}
.iw-content img {
	float: right;
	margin: 0 5px 5px 10px;	
}
.iw-subTitle {
	font-size: 16px;
	font-weight: 700;
	padding: 5px 0;
}
.iw-bottom-gradient {
	position: absolute;
	width: 326px;
	height: 25px;
	bottom: 10px;
	right: 18px;
	background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
	background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
	background: -moz-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
	background: -ms-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%);
}

JavaScript

// map center
var center = {lat: 2.855262784366583, lng: 105.4302978515625};

// marker position
//var factory = new google.maps.LatLng(2.855262784366583, 105.4302978515625);

function initialize() {
  var mapOptions = {
    center: center,
    zoom: 7,
    mapTypeId: google.maps.MapTypeId.ROADMAP

  };
  PRbounds = {
      "south": 17.88124,
      "west": -67.95158170000002,
      "north": 18.5160099,
      "east": -65.22110989999999
    };
  var bounds = new google.maps.LatLngBounds(new google.maps.LatLng(PRbounds.south, PRbounds.west), new google.maps.LatLng(PRbounds.north, PRbounds.east));

         // Create a <script> tag and set the USGS URL as the source.
         var script = document.createElement('script');
         // This example uses a local copy of the GeoJSON stored at
         // http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojsonp
         script.src = 'https://developers.google.com/maps/documentation/javascript/examples/json/earthquake_GeoJSONP.js';
         document.getElementsByTagName('head')[0].appendChild(script);
  var map = new google.maps.Map(document.getElementById("map-canvas"),mapOptions);
  map.fitBounds(bounds);
  // Loop through the results array and place a marker for each
     // set of coordinates.
     window.eqfeed_callback = function(results) {
       for (var i = 0; i < results.features.length; i++) {
         var coords = results.features[i].geometry.coordinates;
         var latLng = new google.maps.LatLng(coords[1],coords[0]);
         // if (i < 10) bounds.extend(latLng);
         var marker = new google.maps.Marker({
           position: latLng,
           map: map
         });



         // InfoWindow content
         var content = '<div id="iw-container">' +
                           '<div class="iw-title">Porcelain Factory of Vista Alegre</div>' +
                           '<div class="iw-content">' +
                             '<div class="iw-subTitle">History</div>' +
                   ...