MASS mapping

by Brad Patton

HTML

<script src="https://code.highcharts.com/maps/highmaps.js"></script>
<script src="https://code.highcharts.com/maps/modules/exporting.js"></script>
<script src="https://code.highcharts.com/mapdata/countries/us/us-ma-all.js"></script>

Test
<div id="container">

</div>
Low

CSS

#container {
  height: 500px;
  min-width: 310px;
  max-width: 800px;
  margin: 0 auto;
}

.loading {
  margin-top: 10em;
  text-align: center;
  color: blue;
}

JavaScript

$(function () {
  $.getScript("https://code.highcharts.com/maps/highmaps.js", function () {});
  $.getScript("http://code.highcharts.com/maps/modules/map.js", function () {});
  $.getScript("https://code.highcharts.com/mapdata/countries/us/us-ma-all.js", function () {});

  districts = [{
    "city": "Worcester",
    "county": "Worcester",
    "lat": 42.30514167,
    "lon": -71.801,
    "district": "Abby Kelley Foster Charter Public",
    "school": "Abby Kelley Foster Charter Public School",
  }, {
    "city": "Abington",
    "county": "Plymouth",
    "lat": 42.1177,
    "lon": -70.955,
    "district": "Abington",
    "school": "Abington High",
  }];

  $('#container').highcharts('Map', {
    title: {
      text: 'Highmaps basic demo'
    },
    series: [{
      name: "Basemap",
      mapData: Highcharts.maps['countries/us/us-ma-all']
    }, {
      name: 'Cities',
      type: 'mappoint',
      data: districts,
      color: 'black',
      marker: {
        radius: 2
      },
                dataLabels: {
                    enabled: true,
                    format: '{point.city}'
                },
      animation: false,
      tooltip: {
        pointFormat: '{point.name}'
      }
    }]
  });

});