text: // Store our API endpoint inside queryUrl
  var queryUrl = "https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_week.geojson";
  
  // Perform a GET request to the query URL
  d3.json(queryUrl, function (data) {
      console.log(queryUrl)
      // Once we get a response, send the data.features object to the createFeatures function
      createFeatures(data.features);
  });
  
  function createFeatures(earthquakeData) {
  
      // Define a function we want to run once for each feature in the features array
      // Give each feature a popup describing the place, time, and magnitude of the earthquake
      function onEachFeature(feature, layer) {
          layer.bindPopup("<h3>" + feature.properties.place +
              "</h3><hr><p>" + new Date(feature.properties.time) + "</p>" +
              "<hr><p>" + "Magnitude: " + feature.properties.mag + "</p>");
      }
  
      // Define function to create circle radius based on magnitude
      function radiusSize(magnitude) {
          return magnitude * 20000;
      }
  
      // Function that will determine the color of an earthquake based on magnitude
      function circleColor(magnitude) {
          if (magnitude < 1) {
              return "chartreuse"
          }
          else if (magnitude < 2) {
              return "greenyellow"
          }
          else if (magnitude < 3) {
              return "gold"
          }
          else if (magnitude < 4) {
              return "darkorange"
          }
          else if (magnitude < 5) {
              return "orangered"
          }
          else {
              return "red"
          }
      }
      // Create a GeoJSON layer containing the features array on the earthquakeData object
      // Run the onEachFeature function once for each piece of data in the array
      var earthquakes = L.geoJSON(earthquakeData, {
          pointToLayer: function (earthquakeData, latlng) {
              return L.circle(latlng, {
                  radius: radiusSize(earthquakeData.properties.mag),
                  color: circleColor(earthquakeData.properties.mag),
                  fillOpacity: 1
              });
          },
          onEachFeature: onEachFeature
      });
  
      // Sending our earthquakes layer to the createMap function
      createMap(earthquakes);
  };
  
  
  function createMap(earthquakes) {
  
      // Define streetmap and darkmap layers
      var outdoorsmap = 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.outdoors",
          accessToken: API_KEY
      });
  
      var lightmap = 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.light",
          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
      });
  
      // Define a baseMaps object to hold our base layers
      var baseMaps = {
          "Outdoors Map": outdoorsmap,
          "Light Map": lightmap,
          "Dark Map": darkmap
      };
  
      // Create overlay object to hold our overlay layer
      var overlayMaps = {
          Earthquakes: earthquakes
      };
  
      // Create our map, giving it the streetmap and earthquakes layers to display on load
      var myMap = L.map("map", {
          center: [
              37.09, -95.71
          ],
          zoom: 5,
          layers: [outdoorsmap, earthquakes]
      });
  
      // Create a layer control
      // Pass in our baseMaps and overlayMaps
      // Add the layer control to the map
      L.control.layers(baseMaps, overlayMaps, {
          collapsed: false
      }).addTo(myMap);
  
      function getColor(d) {
          return d > 5 ? "red" :
              d > 4 ? "orangered" :
                  d > 3 ? "darkorange" :
                      d > 2 ? "gold" :
                          d > 1 ? "greenyellow" :
                              "chartreuse";
      }
  
      // Set up the legend
      var legend = L.control({ position: "bottomright" });
      legend.onAdd = function () {
          var div = L.DomUtil.create('div', 'info legend'),
              mags = [0, 1, 2, 3, 4, 5],
              labels = [];
  
          // loop through our density intervals and generate a label with a colored square for each interval
          for (var i = 0; i < mags.length; i++) {
              div.innerHTML +=
                  '<i style="background:' + getColor(mags[i] + 1) + '"></i> ' +
                  mags[i] + (mags[i + 1] ? '&ndash;' + mags[i + 1] + '<br>' : '+');
          }
  
          return div;
      };
  
      legend.addTo(map);
  
  }
  
  
  