# CesiumIonOverlay

class in `3d-tiles-renderer/three/plugins`, extends `TiledImageOverlay`

```js
import { CesiumIonOverlay } from '3d-tiles-renderer/three/plugins';
```

Overlay that streams imagery from a Cesium Ion asset. Supports Ion-hosted TMS assets as well
as external asset types (Google 2D Maps, Bing Maps) that Ion proxies.

Example: Draping Cesium ion imagery over the globe

```js
import { TilesRenderer } from '3d-tiles-renderer/three';
import { GeneratedSurfacePlugin, CesiumIonOverlay } from '3d-tiles-renderer/three/plugins';

const tiles = new TilesRenderer();
tiles.registerPlugin( new GeneratedSurfacePlugin( {
	overlay: new CesiumIonOverlay( { assetId: 3954, apiToken: 'YOUR_CESIUM_ION_TOKEN' } ),
	applyOverlayTexture: true,
} ) );
```

## Constructor

```js
new CesiumIonOverlay( options?: Object )
```

- `options`, `Object`, optional
  - `apiToken`, `string`, optional: Cesium Ion API token for authentication.
  - `assetId`, `number`, optional: Cesium Ion asset ID.
  - `autoRefreshToken`, `boolean`, optional, default `false`: Automatically refresh the auth token before
it expires.
  - `opacity`, `number`, optional, default `1`: Overlay opacity (0–1).
  - `color`, `number | Color`, optional, default `0xffffff`: Tint color.
  - `frame`, `Matrix4`, optional, default `null`: Planar projection frame. If null, cartographic projection is used.
  - `preprocessURL`, `function`, optional, default `null`: URL rewriting callback.
  - `alphaMask`, `boolean`, optional, default `false`: Use alpha channel as a surface mask.
  - `alphaInvert`, `boolean`, optional, default `false`: Invert the alpha channel.
