---
title: "DOMRectReadOnly | 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.

# Interface DOMRectReadOnly

The **`DOMRectReadOnly`** interface specifies the standard properties (also used by DOMRect) to define a rectangle whose properties are immutable.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly)

interface DOMRectReadOnly {  
    [bottom](#bottom): number;  
    [height](#height): number;  
    [left](#left): number;  
    [right](#right): number;  
    [top](#top): number;  
    [width](#width): number;  
    [x](#x): number;  
    [y](#y): number;  
    [toJSON](#tojson-1)(): any;  
}

#### Hierarchy ([View Summary](https://docs.maptiler.com/sdk-js/api-reference/hierarchy/#Externals.DOMRectReadOnly))

-   DOMRectReadOnly
    -   [DOMRect](https://docs.maptiler.com/sdk-js/api-reference/interfaces/Externals.DOMRect/)

##### Index

### Properties[](#properties)

[bottom](#bottom) [height](#height) [left](#left) [right](#right) [top](#top) [width](#width) [x](#x) [y](#y)

### Methods[](#methods)

[toJSON](#tojson)

## Properties[](#properties-1)

### `Readonly`bottom[](#bottom)

bottom: number

The **`bottom`** read-only property of the DOMRectReadOnly interface returns the bottom coordinate value of the DOMRect. (Has the same value as y + height, or y if height is negative.)

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/bottom)

### `Readonly`height[](#height)

height: number

The **`height`** read-only property of the DOMRectReadOnly interface represents the height of the DOMRect.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/height)

### `Readonly`left[](#left)

left: number

The **`left`** read-only property of the DOMRectReadOnly interface returns the left coordinate value of the DOMRect. (Has the same value as x, or x + width if width is negative.)

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/left)

### `Readonly`right[](#right)

right: number

The **`right`** read-only property of the DOMRectReadOnly interface returns the right coordinate value of the DOMRect. (Has the same value as x + width, or x if width is negative.)

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/right)

### `Readonly`top[](#top)

top: number

The **`top`** read-only property of the DOMRectReadOnly interface returns the top coordinate value of the DOMRect. (Has the same value as y, or y + height if height is negative.)

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/top)

### `Readonly`width[](#width)

width: number

The **`width`** read-only property of the DOMRectReadOnly interface represents the width of the DOMRect.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/width)

### `Readonly`x[](#x)

x: number

The **`x`** read-only property of the DOMRectReadOnly interface represents the x coordinate of the DOMRect's origin.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/x)

### `Readonly`y[](#y)

y: number

The **`y`** read-only property of the DOMRectReadOnly interface represents the y coordinate of the DOMRect's origin.

[MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/y)

## Methods[](#methods-1)

### toJSON[](#tojson)

-   toJSON(): any[](#tojson-1)
    
    The DOMRectReadOnly method **`toJSON()`** returns a JSON representation of the DOMRectReadOnly object.
    
    [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMRectReadOnly/toJSON)
    
    #### Returns any
