# Class PrintUtils

#### Hierarchy

- PrintUtils

- Defined in src/print/Utils.js:32

#####
Index

### Properties

extentHalfHorizontalDistance_
extentHalfVerticalDistance_

### Methods

getBottomLeftCorner
getBottomRightCorner
getOptimalResolution
getOptimalScale
getUpLeftCorner
getUpRightCorner

## Properties

### extentHalfHorizontalDistance_

extentHalfHorizontalDistance_: number

- Defined in src/print/Utils.js:36

### extentHalfVerticalDistance_

extentHalfVerticalDistance_: number

- Defined in src/print/Utils.js:41

## Methods

### getBottomLeftCorner

- getBottomLeftCorner(mapCenter: Coordinate): Coordinate

- Get the coordinates of the bottom left corner of the printed map.

  ### Returns

  The coordinates of the bottom left corner.

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.

  #### Returns Coordinate

  - Defined in src/print/Utils.js:114

### getBottomRightCorner

- getBottomRightCorner(mapCenter: Coordinate): Coordinate

- Get the coordinates of the bottom right corner of the printed map.

  ### Returns

  The coordinates of the bottom right corner.

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.ç

  #### Returns Coordinate

  - Defined in src/print/Utils.js:124

### getOptimalResolution

- getOptimalResolution(mapSize: Size, printMapSize: Size, printMapScale: number): number

- Get the optimal map resolution for a print scale and a map size.

  ### Returns

  The optimal map resolution.

  #### Parameters

  - ##### mapSize: Size

    Size of the map on the screen (px).

  - ##### printMapSize: Size

    Size of the map on the paper (dots).

  - ##### printMapScale: number

    Map scale on the paper.

  #### Returns number

  - Defined in src/print/Utils.js:97

### getOptimalScale

- getOptimalScale(mapSize: Size, mapResolution: number, printMapSize: Size, printMapScales: number[]): number

- Get the optimal print scale for a map, the map being defined by its size (in pixels) and resolution (in map units per pixel).

  ### Returns

  The best scale. `-1` is returned if there is no optimal scale, that is the optimal scale is lower than or equal to the first value in `printMapScales`.

  #### Parameters

  - ##### mapSize: Size

    Size of the map on the screen (px).

  - ##### mapResolution: number

    Resolution of the map on the screen.

  - ##### printMapSize: Size

    Size of the map on the paper (dots).

  - ##### printMapScales: number[]

    Supported map scales on the paper. The scales are provided as scale denominators, sorted in ascending order. E.g. `[500, 1000, 2000, 4000]`.

  #### Returns number

  - Defined in src/print/Utils.js:70

### getUpLeftCorner

- getUpLeftCorner(mapCenter: Coordinate): Coordinate

- Get the coordinates of the up left corner of the printed map.

  ### Returns

  The coordinates of the up left corner.

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.

  #### Returns Coordinate

  - Defined in src/print/Utils.js:134

### getUpRightCorner

- getUpRightCorner(mapCenter: Coordinate): Coordinate

- Get the coordinates of the up right corner of the printed map.

  ### Returns

  The coordinates of the up right corner.

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.

  #### Returns Coordinate

  - Defined in src/print/Utils.js:144

Generated using TypeDoc