function preload(that, data, options, clear) {
  //>>includeStart('debug', pragmas.debug);
  if (!defined(data)) {
    throw new DeveloperError("data is required.");
  }
  //>>includeEnd('debug');

  DataSource.setLoading(that, true);
  options = options ?? Frozen.EMPTY_OBJECT;

  // User specified credit
  let credit = options.credit;
  if (typeof credit === "string") {
    credit = new Credit(credit);
  }
  that._credit = credit;

  let promise = data;
  let sourceUri = options.sourceUri;
  if (typeof data === "string" || data instanceof Resource) {
    data = Resource.createIfNeeded(data);
    promise = data.fetchJson();
    sourceUri = sourceUri ?? data.getUrlComponent();

    // Add resource credits to our list of credits to display
    const resourceCredits = that._resourceCredits;
    const credits = data.credits;
    if (defined(credits)) {
      const length = credits.length;
      for (let i = 0; i < length; i++) {
        resourceCredits.push(credits[i]);
      }
    }
  }

  options = {
    describe: options.describe ?? defaultDescribeProperty,
    markerSize: options.markerSize ?? defaultMarkerSize,
    markerSymbol: options.markerSymbol ?? defaultMarkerSymbol,
    markerColor: options.markerColor ?? defaultMarkerColor,
    strokeWidthProperty: new ConstantProperty(
      options.strokeWidth ?? defaultStrokeWidth,
    ),
    strokeMaterialProperty: new ColorMaterialProperty(
      options.stroke ?? defaultStroke,
    ),
    fillMaterialProperty: new ColorMaterialProperty(
      options.fill ?? defaultFill,
    ),
    clampToGround: options.clampToGround ?? defaultClampToGround,
  };

  return Promise.resolve(promise)
    .then(function (geoJson) {
      return load(that, geoJson, options, sourceUri, clear);
    })
    .catch(function (error) {
      DataSource.setLoading(that, false);
      that._error.raiseEvent(that, error);
      throw error;
    });
}
Asynchronously loads the provided GeoJSON or TopoJSON data, without replacing any existing data.

@param {Resource|string|object} data A url, GeoJSON object, or TopoJSON object to be loaded.
@param {GeoJsonDataSource.LoadOptions} [options] An object specifying configuration options

@returns {Promise<GeoJsonDataSource>} a promise that will resolve when the GeoJSON is loaded.