# MapImageOptions

Options for [`MapAdapter`](https://docs.mapcairn.com/api/core/MapAdapter.md).

This is an interface exported by `@mapcairn/core`, checked against version 0.2.0.

## Signature

```ts
import type { MapImageOptions } from "@mapcairn/core";
 
interface MapImageOptions
```

## Properties

### attribution

```ts
readonly attribution?: string;
```

Credit text drawn along the bottom edge of the image, so a saved image
keeps its sources. Nothing is drawn when it is empty or omitted.

### drawing

```ts
readonly drawing?: MapImageDrawing;
```

What the ui draws over the map (such as shapes a person has drawn), put
into the image above the data layers and below the credit text.

### pixelRatio

```ts
readonly pixelRatio?: number;
```

Image pixels for each CSS pixel of `size`. Defaults to 1, whatever the device.

### size

```ts
readonly size?: MapImageSize;
```

The size of the map the image shows, in CSS pixels, so labels and symbols
are as large against it as on a screen of that size. The image is this
many times `pixelRatio` pixels on each side. The size is rounded to whole
CSS pixels first, and the image's pixels to whole pixels. Defaults to the
size of the map on screen.

### view

```ts
readonly view?: MapImageView;
```

What the image shows. Defaults to where the map on screen is looking, but
north-up. It is drawn without moving the map on screen. Latitudes are
within the Web Mercator limit and longitudes within -180 to 180; a box has
its west below its east, and one across the antimeridian is given in the
short form, with its west inside -180 to 180 and its east past 180 (the
box of a Fiji-sized view is `west: 178.44`, `east: 180.1`), at most 360
degrees past its west. The long form, with its west beyond its east, is
`invalid`, and so is a west below -180 or above 180. A very wide box can
also be `invalid` from the framing check below. A box the map cannot frame
at the requested size (below the basemap's lowest zoom, or one it would
have to crop to fit) is `invalid` too, and so is any box on a globe for
now (a centre and zoom is drawn on either). What `getBounds()` gives for a
world-wide view (longitudes beyond -180 and 180, or latitudes beyond the
limit) is not an acceptable `bounds`. When a request names only a size or
pixel ratio, the view on screen is used, with its latitude clamped to the
Web Mercator limit and its longitude wrapped.

## See also

- [`MapImageDrawing`](https://docs.mapcairn.com/api/core/MapImageDrawing.md)
- [`MapImageSize`](https://docs.mapcairn.com/api/core/MapImageSize.md)
- [`MapImageView`](https://docs.mapcairn.com/api/core/MapImageView.md)

Source: [packages/core/src/ports/map.ts:362](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/ports/map.ts#L362)
