---
metadata:
  - name: generator
    content: Diplodoc Platform v5.39.1
alternate:
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/en/v2-1/ref/reference/IRatioMap.md
  - https://yandex.com.tr/dev/jsapi-v2-1/doc/ru/v2-1/ref/reference/IRatioMap.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/dev/jsapi-v2-1/doc/en/llms.txt

# IRatioMap

Interface of an object containing the ratio of custom data to devicePixelRatio. Used when needed to support screens with a ratio of virtual to physical pixels greater than one. As keys for the object, use strings consisting of whole numbers or fractions indicating the pixel density coefficient.

[Constructor](#constructor-summary)

## Constructor {#constructor-summary}

```javascript
IRatioMap()
```

**Example:**

```javascript
// Let's say we need to display the image correctly.
var images = {
    // For regular screens we'll display the normal picture.
    "1": "100x100.png",
    // For HTC Desire, Samsung Galaxy S II and others with devicePixelRatio = 1.5.
    "1.5": "150x150.png",
    // For Apple devices with the Retina screen, as well as for Sony Xperia S, HTC One X and others
    // with the ratio = 2.
    "2": "200x100.png"
}
```
