---
name: "getGyroLatestCleanMap"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.7.14" }
  - { name: "Base library", version: "2.29.0" }
title: "Latest Cleaning Map"
---

## getGyroLatestCleanMap

> [VERSION] @ray-js/ray >= 1.7.14 | Base library >= 2.29.0

### Description

Get the latest cleaning map data for a gyroscope-based robot vacuum

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `GetGyroLatestCleanMapParams` | Yes | Query parameters including Device ID and pagination info |

### Return Value

Type: `Promise<GetGyroLatestCleanMapResponse>`

Promise that resolves with the latest cleaning's map data and pagination info

##### GetGyroLatestCleanMapResponse

| Property | Type | Description |
| --- | --- | --- |
| `dataList` | `string[]` | Map data list |
| `startRow` | `string` | Start-row cursor |
| `devId` | `string` | Device ID |
| `mapId` | `number` | Map ID |
| `startTime` | `number` | Cleaning start timestamp |
| `endTime` | `number` | Cleaning end timestamp |
| `subRecordId` | `number` | Sub-record ID |
| `hasNext` | `boolean` | Has next page |

### Referenced Types

##### `interface` GetGyroLatestCleanMapParams

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID |
| `start` | `number` | Start row (startRow) |
| `size` | `number` | Number of items per fetch |


### Examples

```tsx
import React from 'react';
import { Button, getGyroLatestCleanMap } from '@ray-js/ray';

export default function Demo() {
  const handleFetch = async () => {
    const map = await getGyroLatestCleanMap({
      devId: 'your-device-id',
      start: 0,
      size: 100,
    });
    console.log(map.dataList, map.hasNext);
  };
  return <Button onClick={handleFetch}>Get latest map</Button>;
}
```
