Libraries

by Kyle Lam

HTML

<script src="https://maps.googleapis.com/maps/api/js?sensor=true"></script>
<title>Google Maps Example</title>

<body>
    <div id="map" />
</body>

CSS

html, body {
    height: 100%;
}

#map {
    min-height: 100%; 
}

body {    
    margin: 0;
    padding: 0
}

JavaScript

var entries=[];
$(window).load(function() {
    URL = 'http://data.illinois.gov/resource/wsms-teqm.json';
    
    var center = new google.maps.LatLng(41.84979191875949,-87.64940858727015);
    var mapOptions = {
      zoom: 6,
      center: center
    }
    var map = new google.maps.Map(document.getElementById("map"), mapOptions);
    
 $.getJSON(URL, function(data, textstatus) {

              $.each(data, function(i, entry) {
                    
                  var contentString = '<div id="content">'+
                      '<div id="siteNotice">'+
                      '</div>'+
                      '<h1 id="firstHeading" class="firstHeading">' + entry.hospital_name + '</h1>'+ '<hr>' + 
                      '<div id="bodyContent">'+ 
                      '<p>' + entry.address + " " + entry.zip + '.<br>' + 
                      '<p>' + '<a href="tel:'+entry.phone.phone_number+'">' + entry.phone.phone_number + '</a>' + '</p>'+
                      '<p>' + entry.license_expiration_date + '</p>'+
                      '</div>'+
                      '</div>';
                         
    
                  var infowindow = new google.maps.InfoWindow({
                      content: contentString
                  });
                  
                  /*
                  var marker = new google.maps.Marker({
                      position: new google.maps.LatLng(entry.location.latitude, 
                                                       entry.location.longitude),
                      map: map,
                      title: entry["dba_name"] + "\n" + entry["address"]
                  });
                  
                  google.maps.event.addListener(marker, 'click', function() {
                    infowindow.open(map,marker);
                  });
                  
                  */
                  entries.push({
                      "zip": entry.zip,
                      "infowindow": infowindow,
                      "title":...