text: /* 
  */
  /* An array containing all of the information needed to create Competative Districts Map markers
  Party R: Republican
  Party D: Democrate
  CPVI_Party: Cook Partisan Voting index - R, D, E(Even)
  CPVI_M: Cook Partisan Voting Magnitude
  CPVI_D: Cook Partisan Voting Direction: TossUp, Lean, Likely, Solid
  */
  
  var locations2018 =
  [
    {
      Coordinates: [37.6, -121.0],
      StateDistrict: "California10",
      District2018:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R" 
      }
    },
    {
      Coordinates: [35.8, 	-117.2],
      StateDistrict: "California25",
      District2018:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.5625, -117.5006],
      StateDistrict: "California39",
      District2018:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.4251, -117.4006],
      StateDistrict: "California45",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.3706, -117.5219],
      StateDistrict: "California48",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [25.4105, -80.5956],
      StateDistrict: "Florida26",
      District2018:
      {
        CPVI_Party: "D",
        CPVI_M: 6,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [25.3545, -80.2030],
      StateDistrict: "Florida27",
      District2018:
      {
        CPVI_Party: "D",
        CPVI_M: 5,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [41.1234, -94.3825],
      StateDistrict: "Iowa3",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.1030, -88.1312],
      StateDistrict: "Illinois6",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 2,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [38.00, -89.15],
      StateDistrict: "Illinois12",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 5,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [38.6, -95.3],
      StateDistrict: "Kansas2",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 10,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [38.0312, -84.0917],
      StateDistrict: "Kentucky6",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 9,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [45.2906, -69.0321],
      StateDistrict: "Maine2",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 2,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.3852, -83.5643],
      StateDistrict: "Michigan8",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.2247, -80.5018],
      StateDistrict: "NorthCarolina9",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 7,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.4700, -78.1247],
      StateDistrict: "NorthCarolina13",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 6,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.8533, -74.8498],
      StateDistrict: "NewJersey3",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 2,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [40.60, -74.50],
      StateDistrict: "NewJersey7",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.2307, -106.1758],
      StateDistrict: "NewMexico2",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 6,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.1340, -74.2532],
      StateDistrict: "NewYork19",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 2,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.955578, -78.677797],
      StateDistrict: "NewYork22",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 6,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.10, -84.34],
      StateDistrict: "Ohio1",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 5,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.5540, -75.1251],
      StateDistrict: "Pennsylvania1",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [29.4327, -95.3001],
      StateDistrict: "Texas7",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 7,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [32.5513, -96.3913],
      StateDistrict: "Texas32",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 5,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [40.6700, -111.9300],
      StateDistrict: "Urah4",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 13,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [37.4229, -75.5313],
      StateDistrict: "Virginia2",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [37.5805, -77.4448],
      StateDistrict: "Virginia7",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 6,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [47.18, -122.06],
      StateDistrict: "Washington8",
      District2018:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [43.5366, -93.4242],
      StateDistrict: "Minnesota1",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 5,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [47.1501, -92.5750],
      StateDistrict: "Minnesota8",
      District2018:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    }
  ];
  
  // CPVI based on latest Report
  var locations2016_Hillary =
  [
    {
      Coordinates: [31.5459, -109.5619],
      StateDistrict: "Arizona2",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [37.6, -121.0],
      StateDistrict: "California10",
      District2016_Hillary:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [36.5, -119],
      StateDistrict: "California21",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 5,
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.8, -117.2],
      StateDistrict: "California25",
      District2016_Hillary:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.5625, -117.5006],
      StateDistrict: "California39",
      District2016_Hillary:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.4251, 117.4006],
      StateDistrict: "California45",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "Tossup",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.3706, -117.5219],
      StateDistrict: "California48",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.4, -117.1],
      StateDistrict: "California49",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.4518, -104.4555],
      StateDistrict: "Colorado6",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 2,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [25.4105, -80.5956],
      StateDistrict: "Florida26",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 6,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [25.3545, -80.2030],
      StateDistrict: "Florida27",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 5,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.1030, -88.1312],
      StateDistrict: "Illinois6",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 2,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [38.8, -94.8],
      StateDistrict: "Kansas3",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [44.5945, -93.3143],
      StateDistrict: "Minnesota3",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 1,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [40.60, -74.50],
      StateDistrict: "NewJersey7",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [43.046119, -76.151616],
      StateDistrict: "NewYork24",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 3, 
        CPVI_D: "Lean_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.5540, -75.1251],
      StateDistrict: "Pennsylvania1",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [41.2314, -78.3414],
      StateDistrict: "Pennsylvania5",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 13,
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [40.0337, -75.3827],
      StateDistrict: "Pennsylvania6",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 2,
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.54, -75.55],
      StateDistrict: "Pennsylvania7",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 1,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [29.4237, -95.3001],
      StateDistrict: "Texas7",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 7,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [30.2321, -102.1936],
      StateDistrict: "Texas23",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "Lean_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [32.5513, -96.3913],
      StateDistrict: "Texas32",
      District2016_Hillary:
      {
        CPVI_Party: "R",
        CPVI_M: 5,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.0433, -77.5124],
      StateDistrict: "Virginia10",
      District2016_Hillary:
      {
        CPVI_Party: "D",
        CPVI_M: 1,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [47.18, -122.06],
      StateDistrict: "Washington8",
      District2016_Hillary:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    }
  ]
  
  var locations2016 =
  [
    {
      Coordinates: [30.1658, -84.4349],
      StateDistrict: "Florida2",
      District2016:
      {
        CPVI_Party: "R",
        CPVI_M: 18,
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [28.4333, -81.1311],
      StateDistrict: "Florida7",
      District2016:
      {
        CPVI_Party: "R",
        CPVI_M: 2,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [28.3058, -81.4428],
      StateDistrict: "Florida10",
      District2016:
      {
        CPVI_Party: "D",
        CPVI_M: 9,
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [27.5158, -82.4454],
      StateDistrict: "Florida13",
      District2016:
      {
        CPVI_Party: "D",
        CPVI_M: 3,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [27.0818, -80.2246],
      StateDistrict: "Florida18",
      District2016:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "Lean_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.1647, -87.5621],
      StateDistrict: "Illinois10",
      District2016:
      {
        CPVI_Party: "D",
        CPVI_M: 8,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [41.15, -96.00],
      StateDistrict: "Nebraska2",
      District2016:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.3948, -115.0915],
      StateDistrict: "Nevada3",
      District2016:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [37.7900, -117.6300],
      StateDistrict: "Nevada4",
      District2016:
      {
        CPVI_Party: "D",
        CPVI_M: 4,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [43.2728, -71.1157],
      StateDistrict: "NewHampshire1",
      District2016:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [41.1235, -74.3628],
      StateDistrict: "NewJersey5",
      District2016:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [36.5828, -77.1825],
      StateDistrict: "Virginia4",
      District2016:
      {
        CPVI_Party: "D",
        CPVI_M: 8,
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    }
  ];
  
  var locations2014 =
  [
    {
      Coordinates: [31.5459, -109.5619],
      StateDistrict: "Arizona2",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [34.0636, -117.2112],
      StateDistrict: "California31",
      District2014:
      {
        CPVI_Party: "D",
        CPVI_M: 5,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [30.1658, -84.4349],
      StateDistrict: "Florida2",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 6,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [25.4105, -80.5956],
      StateDistrict: "Florida26",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [32.544275, -82.1914],
      StateDistrict: "Georgia12",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 9,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.1647, -87.5621],
      StateDistrict: "Illinois10",
      District2014:
      {
        CPVI_Party: "D",
        CPVI_M: 8,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [38.00, -89.15],
      StateDistrict: "Illinois12",
      District2014:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [42.3140, -91.5346],
      StateDistrict: "Iowa1",
      District2014:
      {
        CPVI_Party: "D",
        CPVI_M: 5,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [45.2906, -69.0321],
      StateDistrict: "Maine2",
      District2014:
      {
        CPVI_Party: "D",
        CPVI_M: 2,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [41.15, -96.00],
      StateDistrict: "Nebraska2",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 4,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [37.7900, -117.6300],
      StateDistrict: "Nevada4",
      District2014:
      {
        CPVI_Party: "D",
        CPVI_M: 4,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [43.2728, -71.1157],
      StateDistrict: "NewHampshire1",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 1,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [40.728325, -74.006196],
      StateDistrict: "NewYork1",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 2,
        CPVI_D: "TossUP",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [44.0030, -74.3633],
      StateDistrict: "NewYork21",
      District2014:
      {
        CPVI_Party: "E",
        CPVI_M: 0,
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [43.046119, -76.151616],
      StateDistrict: "NewYork24",
      District2014:
      {
        CPVI_Party: "D",
        CPVI_M: 5,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [34.4114, -78.1932],
      StateDistrict: "NorthCarolina7",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 12,
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [30.2321, -102.1936],
      StateDistrict: "Texas23",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 3,
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [40.6700, -111.9300],
      StateDistrict: "Utah4",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 16,
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [37.5928, -81.1306],
      StateDistrict: "WestVirginia3",
      District2014:
      {
        CPVI_Party: "R",
        CPVI_M: 14,
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    }
  ];
  
  var locations2012 =
  [
    {
      Coordinates: [34.5816, -110.4333],
      StateDistrict: "Arizona1",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [33.25, -111.55],
      StateDistrict: "Arizona9",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [34.1311, -93.1216],
      StateDistrict: "Arkansas4",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [38.49, -121.3],
      StateDistrict: "California7",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [36.5, -119],
      StateDistrict: "California21",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [34.2, -117.8],
      StateDistrict: "California26",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [33.4336, -44.34],
      StateDistrict: "California36",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [34.6, -116],
      StateDistrict: "California41",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [33.4659, -117.5357],
      StateDistrict: "California47",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [32.87, -117.18],
      StateDistrict: "California52",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [28.0755, -81.1206],
      StateDistrict: "Florida9",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [27.0818, -80.2246],
      StateDistrict: "Florida18",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [26.2412, -80.0440],
      StateDistrict: "Florida22",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [25.4105, -80.5956],
      StateDistrict: "Florida26",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [42.0035, -88.0548],
      StateDistrict: "Illinois8",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [42.1647, -875621],
      StateDistrict: "Illinois10",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [41.3834, -88.0845],
      StateDistrict: "Illinois11",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [41.2322, -90.1307],
      StateDistrict: "Illinois17",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [41.30, -86.0],
      StateDistrict: "Indiana2",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [33.0312, -84.0917],
      StateDistrict: "Kentucky6",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [39.7, -78.1],
      StateDistrict: "Maryland6",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [47.1501, -92.5750],
      StateDistrict: "Minnesota8",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [37.7900, -117.6300],
      StateDistrict: "Nevada4",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [43.2728, -711157],
      StateDistrict: "NewHampshire1",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [43.4551, -71.4317],
      StateDistrict: "NewHampshire2",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [41.2442, -74.0452],
      StateDistrict: "NewYork18",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [43.046119, -76.151616],
      StateDistrict: "NewYork24",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [43.055021, -78.475194],
      StateDistrict: "NewYork27",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Lean_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.0721, -79.5705],
      StateDistrict: "NorthCarolina8",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.3312, -82.4716],
      StateDistrict: "NorthCarolina11",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.4700, -78.1247],
      StateDistrict: "NorthCarolina13",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [35.0, -95.7],
      StateDistrict: "Oklahoma2",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Likely_R",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [40.2542, -79.2911],
      StateDistrict: "Pennsylvania12",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "red",
        Party: "R"
      }
    },
    {
      Coordinates: [30.2321, -102.1936],
      StateDistrict: "Texas23",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "TossUp",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [25.9303, -97.4844],
      StateDistrict: "Texas34",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Solid_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [47.50, -122.24],
      StateDistrict: "Washington1",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Lean_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    },
    {
      Coordinates: [47.00, -122.50],
      StateDistrict: "Washington10",
      District2012:
      {
        CPVI_Party: "", // should take a look later for all
        CPVI_M: "", // should take a look later for all
        CPVI_D: "Solid_D",
        Winners_Vote_Percentage: 0,
        color: "blue",
        Party: "D"
      }
    }
  ];
  
  /* Looping through locations and creating district markers */
  var District2018Markers = [];
  for (var i = 0; i < locations2018.length; i++)
  {
    // Setting the marker radius for the District2018 by passing population into the markerSize function
    District2018Markers.push(
      L.circle
      (
        locations2018[i].Coordinates,
        {
          stroke: false,
          fillOpacity: 0.99,
          // color: "black",
          fillColor: locations2018[i].District2018.color,
          radius: 60000
        }
      ).bindPopup(locations2018[i].StateDistrict + "," + locations2018[i].District2018.CPVI_D + "-" + 
      locations2018[i].District2018.CPVI_Party + locations2018[i].District2018.CPVI_M)
    );
  }
  
  /* Looping through locations and creating district markers */
  var District2016Markers = [];
  for (var i = 0; i < locations2016.length; i++)
  {
    // Setting the marker radius for the District2018 by passing population into the markerSize function
    District2016Markers.push(
      L.circle
      (
        locations2016[i].Coordinates,
        {
          stroke: false,
          fillOpacity: 0.70,
          // color: "black",
          fillColor: locations2016[i].District2016.color,
          radius: 45000
        }
      ).bindPopup(locations2016[i].StateDistrict + "," + locations2016[i].District2016.CPVI_D + "-" + 
      locations2016[i].District2016.CPVI_Party + locations2016[i].District2016.CPVI_M)
    );
  }
  
  /* Looping through locations and creating district markers */
  var District2016_HillaryMarkers = [];
  for (var i = 0; i < locations2016_Hillary.length; i++)
  {
    // Setting the marker radius for the District2018 by passing population into the markerSize function
    District2016_HillaryMarkers.push(
      L.circle
      (
        locations2016_Hillary[i].Coordinates,
        {
          stroke: false,
          fillOpacity: 0.90,
          color: "purple",
          // fillColor: locations2016_Hillary[i].District2016_Hillary.color,
          radius: 30000
        }
      ).bindPopup(locations2016_Hillary[i].StateDistrict + "," + locations2016_Hillary[i].District2016_Hillary.CPVI_D + "-" + 
      locations2016_Hillary[i].District2016_Hillary.CPVI_Party + locations2016_Hillary[i].District2016_Hillary.CPVI_M)
    );
  }
  
  /* Looping through locations and creating district markers */
  var District2014Markers = [];
  for (var i = 0; i < locations2014.length; i++)
  {
    // Setting the marker radius for the District2018 by passing population into the markerSize function
    District2014Markers.push(
      L.circle
      (
        locations2014[i].Coordinates,
        {
          stroke: false,
          fillOpacity: 0.85,
          // color: "black",
          fillColor: locations2014[i].District2014.color,
          radius: 35000
        }
      ).bindPopup(locations2014[i].StateDistrict + "," + locations2014[i].District2014.CPVI_D + "-" + 
      locations2014[i].District2014.CPVI_Party + locations2014[i].District2014.CPVI_M)
    );
  }
  
  /* Looping through locations and creating district markers */
  var District2012Markers = [];
  for (var i = 0; i < locations2012.length; i++)
  {
    // Setting the marker radius for the District2018 by passing population into the markerSize function
    District2012Markers.push(
      L.circle
      (
        locations2012[i].Coordinates,
        {
          stroke: false,
          fillOpacity: 0.99,
          // color: "black",
          fillColor: locations2012[i].District2012.color,
          radius: 25000
        }
      ).bindPopup(locations2012[i].StateDistrict + "," + locations2012[i].District2012.CPVI_D + "-" + 
      locations2012[i].District2012.CPVI_Party + locations2012[i].District2012.CPVI_M)
    );
  }
  
  /* Defining variables for base layers */
  var streetmap = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
    attribution: "Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>",
    maxZoom: 18,
    id: "mapbox.streets",
    accessToken: API_KEY
  });
  
  var darkmap = L.tileLayer("https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}", {
    attribution: "Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>",
    maxZoom: 18,
    id: "mapbox.dark",
    accessToken: API_KEY
  });
  
  /* Creating two separate layer groups: one for districtS2016 and one for districtS2018 */
  var DistrictS2018 = L.layerGroup(District2018Markers);
  var DistrictS2016 = L.layerGroup(District2016Markers);
  var DistrictS2016_Hillary = L.layerGroup(District2016_HillaryMarkers);
  var DistrictS2014 = L.layerGroup(District2014Markers);
  var DistrictS2012 = L.layerGroup(District2012Markers);
  
  /* Creating a baseMaps object */
  var baseMaps =
  {
    "Street Map": streetmap,
    "Dark Map": darkmap
  };
  
  /* Creatig an overlay object */
  var overlayMaps =
  {
    "2018CompetativeDistricts": DistrictS2018,
    "2016Districts": DistrictS2016,
    "2016Districts_Hillary": DistrictS2016_Hillary,
    "2014Districts": DistrictS2014,
    "2012Districts": DistrictS2012
  };
  
  /* Defining a map object */
  var myMap = L.map("map",
  {
    center: [37.09, -95.71],
    zoom: 5,
    layers: [streetmap, DistrictS2018, DistrictS2016, DistrictS2016_Hillary, DistrictS2014, DistrictS2012]
  });
  
  /* Passing map layers into layer control, adding the layer control to the map */
  L.control.layers(baseMaps, overlayMaps,
  {
    collapsed: false
  }).addTo(myMap);