JSFiddle - React, Tailwind, and code Playground
by brightonmike
HTML
<link rel="stylesheet" href="http://www.maxumi.co.uk/wp-content/themes/maxumi/css/maxumi-style.css">
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript"></script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px;"></div>
<script type="text/javascript">
var locations = [
['<h3>South West Four</h3><a href="http://www.southwestfour.com/">Website</a>', 51.46174, -0.13829, 6],
['<h3>Creamfields</h3><a href="http://www.creamfields.com/">Website</a>', 53.331193, -2.629251, 4],
['<h3>Global Gathering</h3><a href="http://www.globalgathering.com/">Website</a>', 52.1375, -1.7525, 5],
['<h3>Lovebox</h3><a href="http://www.lovebox.net/">Website</a>', 51.533408, -0.041414, 3],
['<h3>Glade Festival</h3><a href="http://www.gladefestival.com/">Website</a>', 52.791661, 0.528995, 2],
['<h3>Visionquest</h3><a href="http://www.wegottickets.com/event/151450">Website</a>', 51.523513, -0.078714, 1]
];
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 5,
center: new google.maps.LatLng(53.865486,-1.032715),
mapTypeId: google.maps.MapTypeId.ROADMAP
});
var infowindow = new google.maps.InfoWindow();
var marker, i;
for (i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map
});
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
}
</script>
<div class="creamfields">
Texas Tribune 2010 Census Map
</div>
</body>
</html>