mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-15 09:21:13 +08:00
41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
---
|
|
title: Location 地理位置
|
|
description:
|
|
type: 0
|
|
group: null
|
|
menuName: Location
|
|
icon:
|
|
order: 30
|
|
---
|
|
|
|
用于选择地理位置
|
|
|
|
## 基本用法
|
|
|
|
```schema: scope="body"
|
|
{
|
|
"type": "form",
|
|
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm",
|
|
"debug": true,
|
|
"controls": [
|
|
{
|
|
"type": "location",
|
|
"name": "location",
|
|
"ak": "LiZT5dVbGTsPI91tFGcOlSpe5FDehpf7",
|
|
"label": "地址"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
注意其中的 `ak` 参数只能在 amis 官网示例中使用,请前往[百度地图开放平台](http://lbsyun.baidu.com/)申请自己的 `ak`。
|
|
|
|
## 属性表
|
|
|
|
| 属性名 | 类型 | 默认值 | 说明 |
|
|
| ----------- | --------- | ------------ | ------------------------------ |
|
|
| vendor | 'baidu' | 'baidu' | 地图厂商,目前只实现了百度地图 |
|
|
| ak | `string` | 无 | 百度地图的 ak |
|
|
| clearable | `boolean` | false | 输入框是否可清空 |
|
|
| placeholder | `string` | '请选择位置' | 默认提示 |
|