# GoogleMapsOverlay

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

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

Overlay that streams Google Maps 2D tile imagery on top of 3D tile geometry using the
Google Maps Tile API.

Example: Draping Google Maps imagery over the globe

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

const tiles = new TilesRenderer();
tiles.registerPlugin( new GeneratedSurfacePlugin( {
	overlay: new GoogleMapsOverlay( {
		apiToken: 'YOUR_GOOGLE_API_KEY',
		sessionOptions: { mapType: 'satellite', language: 'en-US', region: 'US' },
	} ),
	applyOverlayTexture: true,
} ) );
```

## Constructor

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

- `options`, `Object`, optional
  - `apiToken`, `string`, optional: Google Maps API key.
  - `sessionOptions`, `Object`, optional: Session creation options passed to the Google Maps
Tile API when establishing a tile session.
  - `autoRefreshToken`, `boolean`, optional, default `false`: Automatically refresh the session token
before it expires.
  - `logoUrl`, `string`, optional, default `null`: URL to a Google logo image. If provided, it is included
in the overlay attributions as required by Google's terms of service.
  - `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.
