---
name: "getCustomizePosition"
mode: "api"
versionRequirements:
  - { name: "@ray-js/ray", version: "1.5.2" }
title: "getCustomizePosition - 设备自定义位置信息获取"
---

## getCustomizePosition

> [VERSION] @ray-js/ray >= 1.5.2

### 描述

设备自定义位置信息获取

### 参数

`Params`

| 参数 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| `params` | `IGetCustomizePosition` | 是 | 请求参数 |

### 返回值

类型: `Promise<IGetCustomizePositionResponse>`

包含 lon（经度）和 lat（纬度）的位置信息对象

##### IGetCustomizePositionResponse

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `lon` | `string` | 经度 |
| `lat` | `string` | 纬度 |

### 引用对象

##### `interface` IGetCustomizePosition

| 属性 | 类型 | 描述 |
| --- | --- | --- |
| `devId` | `string` | 设备 ID |


### 示例代码

#### 基础用法

```ts
import { getCustomizePosition } from '@ray-js/ray';

getCustomizePosition({
  devId: 'your_device_id',
}).then((response) => {
  console.log('位置信息:', response);
}).catch((err) => {
  console.error(err);
});
```
