function KmlDataSource(options) {
  options = options ?? Frozen.EMPTY_OBJECT;
  const camera = options.camera;
  const canvas = options.canvas;

  this._changed = new Event();
  this._error = new Event();
  this._loading = new Event();
  this._refresh = new Event();
  this._unsupportedNode = new Event();

  this._clock = undefined;
  this._entityCollection = new EntityCollection(this);
  this._name = undefined;
  this._isLoading = false;
  this._pinBuilder = new PinBuilder();
  this._networkLinks = new AssociativeArray();
  this._entityCluster = new EntityCluster();

  /**
   * The current size of this Canvas will be used to populate the Link parameters
   * for client height and width.
   *
   * @type {HTMLCanvasElement | undefined}
   */
  this.canvas = canvas;

  /**
   * The position and orientation of this {@link Camera} will be used to
   * populate various camera parameters when making network requests.
   * Camera movement will determine when to trigger NetworkLink refresh if
   * <code>viewRefreshMode</code> is <code>onStop</code>.
   *
   * @type {Camera | undefined}
   */
  this.camera = camera;

  this._lastCameraView = {
    position: defined(camera) ? Cartesian3.clone(camera.positionWC) : undefined,
    direction: defined(camera)
      ? Cartesian3.clone(camera.directionWC)
      : undefined,
    up: defined(camera) ? Cartesian3.clone(camera.upWC) : undefined,
    bbox: defined(camera)
      ? camera.computeViewRectangle()
      : Rectangle.clone(Rectangle.MAX_VALUE),
  };

  this._ellipsoid = options.ellipsoid ?? Ellipsoid.default;

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

  // Create a list of Credit's from the resource that the user can't remove
  this._resourceCredits = [];

  this._kmlTours = [];

  this._screenOverlays = [];
}
A {@link DataSource} which processes Keyhole Markup Language 2.2 (KML).
<p>
KML support in Cesium is incomplete, but a large amount of the standard,
as well as Google's <code>gx</code> extension namespace, is supported. See Github issue
{@link https://github.com/CesiumGS/cesium/issues/873|#873} for a
detailed list of what is and isn't supported. Cesium will also write information to the
console when it encounters most unsupported features.
</p>
<p>
Non visual feature data, such as <code>atom:author</code> and <code>ExtendedData</code>
is exposed via an instance of {@link KmlFeatureData}, which is added to each {@link Entity}
under the <code>kml</code> property.
</p>

@alias KmlDataSource
@constructor

@param {KmlDataSource.ConstructorOptions} [options] Object describing initialization options

@see {@link http://www.opengeospatial.org/standards/kml/|Open Geospatial Consortium KML Standard}
@see {@link https://developers.google.com/kml/|Google KML Documentation}

@demo {@link https://sandcastle.cesium.com/index.html?src=KML.html|Cesium Sandcastle KML Demo}

@example
const viewer = new Cesium.Viewer('cesiumContainer');
viewer.dataSources.add(Cesium.KmlDataSource.load('../../SampleData/facilities.kmz',
     {
          camera: viewer.scene.camera,
          canvas: viewer.scene.canvas
     })
);