---
title: "PaddingOptions | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Type Alias PaddingOptions

PaddingOptions: [RequireAtLeastOne](https://docs.maptiler.com/sdk-js/api-reference/types/RequireAtLeastOne/)<  
    { bottom: number; left: number; right: number; top: number },  
\>

Options for setting padding on calls to methods such as [Map.fitBounds](https://docs.maptiler.com/sdk-js/api-reference/classes/Map/#fitbounds), [Map.fitScreenCoordinates](https://docs.maptiler.com/sdk-js/api-reference/classes/Map/#fitscreencoordinates), and [Map.setPadding](https://docs.maptiler.com/sdk-js/api-reference/classes/Map/#setpadding). Adjust these options to set the amount of padding in pixels added to the edges of the canvas. Set a uniform padding on all edges or individual values for each edge. All properties of this object must be non-negative integers.

#### Example[](#example)

```typescript
let bbox = [[-79, 43], [-73, 45]];
map.fitBounds(bbox, {
  padding: {top: 10, bottom:25, left: 15, right: 5}
});
```

#### Example[](#example-1)

```typescript
let bbox = [[-79, 43], [-73, 45]];
map.fitBounds(bbox, {
  padding: 20
});
```

#### See[](#see)

-   [Fit to the bounds of a LineString](https://maplibre.org/maplibre-gl-js/docs/examples/zoomto-linestring/)
-   [Fit a map to a bounding box](https://maplibre.org/maplibre-gl-js/docs/examples/fitbounds/)
