function setupUnitFeatures(
  bounding_box,
  OSM_data,
  unit_options = {},
  unit_layers,
) {
  let default_options = {
    color: "green",
    weight: 1,
    opacity: 0.87,
    front_buffer: 6,
    side_buffer: 3,
    length: 14,
    depth: 18,
  };

  unit_options = Object.assign(default_options, unit_options);

  let unit_feature_collection;

  //If no unit_layers is supplied, generate the units from scratch.
  if (typeof unit_layers === "undefined") {
    //Bind getUnitFeatures to "this" so it can access the agentmap as "this.agentmap".
    let unit_features = getUnitFeatures.bind(this)(
      bounding_box,
      OSM_data,
      unit_options,
    );

    unit_feature_collection = {
      type: "FeatureCollection",
      features: unit_features,
    };
  } else {
    unit_feature_collection = unit_layers;
  }

  this.units = L.geoJSON(unit_feature_collection, unit_options).addTo(this.map);

  //Having added the units as layers to the map, do any processing that requires access to those layers.
  this.units.eachLayer(function (unit) {
    if (typeof unit_layers === "undefined") {
      unit.street_id = unit.feature.properties.street_id;
    } else {
      unit.street_id =
        this.streets.id_map[unit.feature.properties.OSM_street_id];
    }

    (unit.street_anchors = unit.feature.properties.street_anchors),
      //Change the IDs of each unit in this unit's neighbours array into the appropriate Leaflet IDs.
      (unit.neighbors = getUnitNeighborLayerIDs.call(
        this,
        unit.feature.properties.neighbors,
      ));
  }, this);
}
Generate and setup building units based on the provided GeoJSON data.

@param {Array.<Array.<number>>} bounding_box - The map's top-left and bottom-right coordinates.
@param {object} OSM_data - A GeoJSON Feature Collection object containing the OSM street features inside the bounding box.
@param {object} unit_options - An object containing the Leaflet & AgentMaps styling options for units.
@param {object} [unit_layers] - If you want to load a previously generated AgentMaps.units object instead of generating one from scratch: A GeoJSON Feature Collection of an AgentMaps.units featureGroup.