# 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

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

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.

  #### Returns Coordinate

  The coordinates of the bottom left corner.

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

### getBottomRightCorner

- getBottomRightCorner(mapCenter): Coordinate

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

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.ç

  #### Returns Coordinate

  The coordinates of the bottom right corner.

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

### getOptimalResolution

- getOptimalResolution(mapSize, printMapSize, printMapScale): number

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

  #### 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

  The optimal map resolution.

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

### getOptimalScale

- getOptimalScale(mapSize, mapResolution, printMapSize, printMapScales): 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).

  #### 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

  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`.

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

### getUpLeftCorner

- getUpLeftCorner(mapCenter): Coordinate

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

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.

  #### Returns Coordinate

  The coordinates of the up left corner.

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

### getUpRightCorner

- getUpRightCorner(mapCenter): Coordinate

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

  #### Parameters

  - ##### mapCenter: Coordinate

    Center of the map to print.

  #### Returns Coordinate

  The coordinates of the up right corner.

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

Generated using TypeDoc